Code Coverage

Code Coverage

Code coverage can be beneficial to help drive the test design. However, there is a danger that development teams are driven by achieving only high coverage numbers and sacrifice thinking about a good design. Code coverage numbers are limited in what they can communicate about the quality of an application.

One of the reasons is described by Glass (1981), who identified that the most persistent (expensive) defects in software are "faults of omission", faults that are not complex enough for the problem. Code coverage tools cannot find code that does not exist and will therefore miss the most expense defects in software. Marick (1999), argues that test coverage tools can be used well if they enhance thought about test design, instead of replacing it with the urge to increase the coverage percentage.

As a side-effect code coverage can also identify unused code. It could surface code that is never exercised after a test suite or parts of an application are run. This could improve the maintainability and potentially even the performance of the application.

References

Marick, B. (1999). How to miss use Code Coverage. In Proceedings of the 16th Interational Conference on Testing Computer Software. Retrieved September 07, 2008 from: http://www.testing.com/writings/coverage.pdf

Glass, R. (March, 1981). Persistent Software Errors, IEEE Transactions on Software Engineering, 7(2).

### Cairngorm 3 - [ Home ][1] - [ Guidelines ][3] - [ Tools ][4] - [ Libraries Downloads ][2]
### Cairngorm 2 - [ Home ][5] - [ Framework Downloads ][6] - [ Eclipse Plugin ][7]
### Project - [ Source ][8] - [ Bug Database ][9] - [ Submitting a Patch ][10] - [ Developer Documentation ][11] - [ Forums ][12] - [ License ][13]

MongoDB Logo MongoDB