Code coverage, what does it mean in terms of quality?

Unit code test coverage has long been known to be an important metric for testing software, and many development groups require 85% coverage to achieve quality targets. Assume we have a test, T/sub 1/ which has 100% code coverage and it detects a set of defects, D/sub 1/. The question, which is answered here, is "What percentage of the defects in D/sub 1/ will be detected if a random subset of the tests in T/sub 1/ are applied to the code, which has code coverage of X% of the code?" The purpose of this paper is to show the relation between code quality and code coverage. The relationship is derived via a model of code defect levels. A sampling technique is employed and modeled with the hypergeometric distribution while assuming uniform probability and a random distribution of defects in the code, which invokes the binomial distribution. The result of this analysis is a simple relation between defect level and quality of the code delivered after the unit code is tested. This model results in the rethinking of the use of unit code test metrics and the use of support tools.

[1]  Hermann Kopetz,et al.  Dependability: Basic Concepts and Terminology , 1992 .

[2]  L. Apfelbaum,et al.  Automated functional test generation , 1995, Conference Record AUTOTESTCON '95. 'Systems Readiness: Test Technology for the 21st Century'.

[3]  Yashwant K. Malaiya,et al.  Estimating the Number of Defects: A Simple and Intuitive Approach , 1998 .

[4]  Thomas J. Ostrand,et al.  Experiments on the effectiveness of dataflow- and control-flow-based test adequacy criteria , 1994, Proceedings of 16th International Conference on Software Engineering.

[5]  William E. Howden,et al.  Reliability of the Path Analysis Testing Strategy , 1976, IEEE Transactions on Software Engineering.

[6]  John S. Gourlay A Mathematical Framework for the Investigation of Testing , 1983, IEEE Transactions on Software Engineering.

[7]  Larry Apfelbaum,et al.  Reducing the Time to Thoroughly Test a GUI , 1998 .

[8]  William E. Howden,et al.  Functional program testing and analysis , 1986 .

[9]  Jacob Slonim,et al.  Software reliability assurance in early development phases: a case study in an industrial setting , 1996, 1996 IEEE Aerospace Applications Conference. Proceedings.

[10]  Paul Piwowarski,et al.  Coverage measurement experience during function test , 1993, Proceedings of 1993 15th International Conference on Software Engineering.

[11]  P. David Coward,et al.  A review of software testing , 1988 .

[12]  Richard G. Hamlet Theoretical comparison of testing methods , 1989 .

[13]  Avi Ziv,et al.  User defined coverage—a tool supported methodology for design verification , 1998, DAC.

[14]  Brown,et al.  Defect Level as a Function of Fault Coverage , 1981, IEEE Transactions on Computers.