The Community for Technology Leaders
2009 Ninth IEEE International Working Conference on Source Code Analysis and Manipulation (2009)
Edmonton, Alberta, Canada
Sept. 20, 2009 to Sept. 21, 2009
ISBN: 978-0-7695-3793-1
pp: 55-64
Test coverage is an important indicator for unit test quality. Tools such as Clover compute coverage by first instrumenting the code with logging functionality, and then logging which parts are executed during unit test runs. Since computation of test coverage is a dynamic analysis, it presupposes a working installation of the software. In the context of software quality assessment by an independent third party, a working installation is often not available. The evaluator may not have access to the required libraries or hardware platform. The installation procedure may not be automated or documented. In this paper, we propose a technique for estimating test coverage at method level through static analysis only. The technique uses slicing of static call graphs to estimate the dynamic test coverage. We explain the technique and its implementation. We validate the results of the static estimation by statistical comparison to values obtained through dynamic analysis using Clover. We found high correlation between static coverage estimation and real coverage at system level but closer analysis on package and class level reveals opportunities for further improvement.
test coverage, static analysis, slicing, estimation, metrics

T. L. Alves and J. Visser, "Static Estimation of Test Coverage," 2009 Ninth IEEE International Working Conference on Source Code Analysis and Manipulation(SCAM), Edmonton, Alberta, Canada, 2009, pp. 55-64.
89 ms
(Ver 3.3 (11022016))