Code coverage differences of Java']Java bytecode and source code instrumentation tools

被引:16
作者
Horvath, Ferenc [1 ]
Gergely, Tamas [1 ]
Beszedes, Arpad [1 ]
Tengeri, David [1 ]
Balogh, Gergo [2 ]
Gyimothy, Tibor [1 ,2 ]
机构
[1] Univ Szeged, Dept Software Engn, Szeged, Hungary
[2] Univ Szeged, MTA SZTE Res Grp Artificial Intelligence, Szeged, Hungary
关键词
Code coverage; White-box testing; !text type='Java']Java[!/text] bytecode instrumentation; Source code instrumentation; Coverage tools; Empirical study;
D O I
10.1007/s11219-017-9389-z
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Many software testing fields, like white-box testing, test case generation, test prioritization, and fault localization, depend on code coverage measurement. If used as an overall completeness measure, the minor inaccuracies of coverage data reported by a tool do not matter that much; however, in certain situations, they can lead to serious confusion. For example, a code element that is falsely reported as covered can introduce false confidence in the test. This work investigates code coverage measurement issues for the Java programming language. For Java, the prevalent approach to code coverage measurement is using bytecode instrumentation due to its various benefits over source code instrumentation. As we have experienced, bytecode instrumentation-based code coverage tools produce different results than source code instrumentation-based ones in terms of the reported items as covered. We report on an empirical study to compare the code coverage results provided by tools using the different instrumentation types for Java coverage measurement on the method level. In particular, we want to find out how much a bytecode instrumentation approach is inaccurate compared to a source code instrumentation method. The differences are systematically investigated both in quantitative (how much the outputs differ) and in qualitative terms (what the causes for the differences are). In addition, the impact on test prioritization and test suite reduction-a possible application of coverage measurement-is investigated in more detail as well.
引用
收藏
页码:79 / 123
页数:45
相关论文
共 33 条
[1]  
Alemerien Khalid., 2014, Int. J. Softw. Eng. Appl., V8, P139
[2]  
[Anonymous], 1995, P 12 INT C TEST COMP
[3]  
Binder W., 2007, P 5 INT S PRINC PRAC, DOI DOI 10.1145/1294325.1294344
[4]  
Black R., 2012, FDN SOFTWARE TESTING
[5]   A Comparative Study of Industrial Static Analysis Tools [J].
Emanuelsson, Par ;
Nilsson, Ulf .
ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2008, 217 (0C) :5-21
[6]  
Fontana F. A., 2011, 2011 IEEE Fourth International Conference on Software Testing, Verification and Validation Workshops (ICSTW), P450, DOI 10.1109/ICSTW.2011.12
[7]  
Fraser G., 2011, P 19 ACM SIGSOFT S 1, P416
[8]  
Gonzalez-Sanchez A., 2011, 2011 26th IEEE/ACM International Conference on Automated Software Engineering, P83, DOI 10.1109/ASE.2011.6100153
[9]   An empirical study of regression test selection techniques [J].
Graves, TL ;
Harrold, MJ ;
Kim, JM ;
Porter, A ;
Rothermel, G .
ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2001, 10 (02) :184-208
[10]   An empirical investigation of program spectra [J].
Harrold, MJ ;
Rothermel, G ;
Wu, R ;
Yi, L .
ACM SIGPLAN NOTICES, 1998, 33 (07) :83-90