Wednesday, December 12, 2007

TDD Standards, Code Coverage

Code coverage defines the percentages of the methods tested by unit tests. Ideally it should be 100%. In this case all the lines in the code should be exercised. It does not tell about if all the possible scenarios are tested or not. With code coverage we try to execute every piece of code and test it. We can also use other coverage techniques to improve the quality of the tests. They are nicely written in this link. How many tests should we write then? Ideally all the tests should be written so that there is nothing left to break the code.

No comments: