Bytecode Testability Transformation
Bytecode as produced by modern programming languages is well suited for search-based testing: Different languages compile to the same bytecode, bytecode is available also for third party libraries, all predicates are atomic and side-effect free, and instrumentation can be performed without recompilation. However, bytecode is also susceptible to the flag problem; in fact, regular source code statements such as floating point operations might create unexpected flag problems on the bytecode level. We present an implementation of state-of-the-art testability transformation for Java bytecode, such that all Boolean values are replaced by integers that preserve information about branch distances, even across method boundaries. The transformation preserves both the original semantics and structure, allowing it to be transparently plugged into any bytecode-based testing tool. Experiments on flag problem benchmarks show the effectiveness of the transformation, while experiments on open source libraries show that although this type of problem can be handled efficiently it is less frequent than expected.
KeywordsNest Predicate Test Data Generation Testability Transformation Branch Instruction Open Source Library
Unable to display preview. Download preview PDF.
- 1.Arcuri, A.: It really does matter how you normalize the branch distance in search-based software testing. Software Testing, Verification and Reliability (2011)Google Scholar
- 2.Arcuri, A., Briand, L.: A practical guide for using statistical tests to assess randomized algorithms in software engineering. In: IEEE International Conference on Software Engineering, ICSE (2011)Google Scholar
- 4.Baresel, A., Binkley, D., Harman, M., Korel, B.: Evolutionary testing in the presence of loop-assigned flags: a testability transformation approach. In: Proceedings of the 2004 ACM SIGSOFT International Symposium on Software Testing and Analysis, ISSTA 2004, pp. 108–118. ACM Press, New York (2004)CrossRefGoogle Scholar
- 5.Binkley, D.W., Harman, M., Lakhotia, K.: Flagremover: A testability transformation for transforming loop assigned flags. ACM Transactions on Software Engineering and Methodology 2(3), 110–146 (2009)Google Scholar
- 6.Fraser, G., Arcuri, A.: Evolutionary generation of whole test suites. In: International Conference On Quality Software, QSIC (2011)Google Scholar
- 7.Fraser, G., Zeller, A.: Mutation-driven generation of unit tests and oracles. In: ISSTA 2010: Proceedings of the ACM International Symposium on Software Testing and Analysis, pp. 147–158. ACM, New York (2010)Google Scholar
- 9.Lindholm, T., Yellin, F.: Java Virtual Machine Specification, 2nd edn. Addison-Wesley Longman Publishing Co., Inc., Amsterdam (1999)Google Scholar
- 11.McMinn, P., Binkley, D., Harman, M.: Testability transformation for efficient automated test data search in the presence of nesting. In: Proceedings of the 3rd UK Software Testing Research Workshop (UKTest 2005), Sheffield, UK, September 5-6, pp. 165–182 (2005)Google Scholar
- 14.Vargha, A., Delaney, H.D.: A critique and improvement of the CL common language effect size statistics of McGraw and Wong. Journal of Educational and Behavioral Statistics 25(2), 101–132 (2000)Google Scholar
- 15.Wappler, S., Baresel, A., Wegener, J.: Improving evolutionary testing in the presence of function-assigned flags. In: Proceedings of the Testing: Academic and Industrial Conference Practice and Research Techniques - MUTATION, pp. 23–34. IEEE Computer Society Press, Washington, DC, USA (2007)Google Scholar
- 16.Wappler, S., Lammermann, F.: Using evolutionary algorithms for the unit testing of object-oriented software. In: GECCO 2005: Proceedings of the 2005 Conference on Genetic and Evolutionary Computation, pp. 1053–1060. ACM, New York (2005)Google Scholar