Content deleted Content added
→Steering phase: move decription to TDD, which is a cycle, with each steps taking minutes at most, preferably much less |
→Test driven development: insert under TDD and explain |
||
Line 115:
=== Test driven development ===
[[Unit testing|Unit tests]] are automated tests that test the functionality of pieces of the code (e.g. classes, methods). Within XP, unit tests are written before the eventual code is coded. This approach is intended to stimulate the programmer to think about conditions in which his or her code could fail. XP says that the programmer is finished with a certain piece of code when he or she cannot come up with any further condition on which the code may fail.
Test driven programming proceeds by quickly cycling through the following steps, with each step taking minutes at most, preferably much less. Since each user story will usually require one to two days of work, a very large number of such cycles will be necessary per story.
* Write [[unit test]]: The programmers write a minimal test that should break the code because the functionality hasn't been fully implemented.
* Fail test: The programmers verify the code does indeed fail the test.
* Write code: The programmers write the minimal amount of code to pass the test.
* Run test: The unit tests are run to test the code.
* [[Code refactoring|Refactor]]: Remove any [[code smells]] from the code.
=== Whole team ===<!-- This section is linked from [[Extreme programming]] -->
|