One of the trickiest things about software testing is knowing when we have tested enough. We could spend hours testing the software and believe that we have done a good job and later find have a bug show up that was triggered by an input that we did not think to test.
One way that we could quantify the amount of testing done is to use a coverage metric. The coverage metric is a score that based on the number of functions tested in the source code.
I used the EclEmma code coverage plugin for Eclipse and I used the code from my previous blog. The following was the output of the code coverage.
One thing that I noticed was that the coverage metric only tests to see if a particular method was traversed by a test case and not whether the test case passes. One of the test cases could have failed and the test coverage metric would stay the same. Obviously!
From the blog Software Testing – The blog about software by Sudarshan and used with permission of the author. All other rights reserved by the author.