Wednesday, 6 April 2016

What is Test driven development (TDD) ?


Test driven development (TDD)

TDD is a software development process that relies on the repetition of a very short development cycle :
 a. First the developer writes an (initially failing) automated test case that defines a desired improvement or new function.
 b. Produces the minimum amount of code to pass that test.
 c. Finally refactors the new code to acceptable standards.

TDD cycle
1. Add a test
2. Run all tests and see if the new one fails 
    (if Not - means functionality already exists, so discard that)
3. Write some code
4. Run the automated tests and see them succeed
5. Refactor code
6. Repeat

No comments:

Post a Comment

Note: only a member of this blog may post a comment.