Generating Class-Level Integration Tests Using Call Site Information
Authors:
- Pouria DerakhshanfarPDPouria Derakhshanfar
- Xavier DevroeyXDXavier Devroey
- Annibale PanichellaAPAnnibale Panichella
- Andy ZaidmanAZAndy Zaidman
- Arie van DeursenADArie van Deursen
Preprint
Abstract
Search-based approaches have been used in the literature to automate the process of creating unit test cases. However, related work has shown that generated unit-tests with high code coverage could be ineffective, i.e., they may not detect all faults or kill all injected mutants. In this paper, we propose CLING, an integration-level test case generation approach that exploits how a pair of classes, the caller and the callee, interact with each other through method calls. In particular, CLING generates integration-level test cases that maximize the Coupled Branches Criterion (CBC). Coupled branches are pairs of branches containing a branch of the caller and a branch of the callee such that an integration test that exercises the former also exercises the latter. CBC is a novel integration-level coverage criterion, measuring the degree to which a test suite exercises the interactions between a caller and its callee classes. We implemented CLING and evaluated the approach on 140 pairs of classes from five different open-source Java projects. Our results show that (1) CLING generates test suites with high CBC coverage, thanks to the definition of the test suite generation as a many-objectives problem where each couple of branches is an independent objective; (2) such generated suites trigger different class interactions and can kill on average 7.7% (with a maximum of 50%) of mutants that are not detected by tests generated at the unit level; (3) CLING can detect integration faults coming from wrong assumptions about the usage of the callee class (32 for our subject systems) that remain undetected when using automatically generated unit-level test suites.Keywords
All Related Versions
This publication has 21 references indexed in Scilit:
- A Systematic Comparison of search-Based approaches for LDA hyperparameter tuningInformation and Software Technology, 2021
- An empirical evaluation of evolutionary algorithms for unit test suite generationInformation and Software Technology, 2018
- A large scale empirical comparison of state-of-the-art search-based test case generatorsInformation and Software Technology, 2018
- Investigating faults missed by test suites achieving high code coverageJournal of Systems and Software, 2018
- A systematic literature review of how mutation testing supports quality assurance processesSoftware Testing, Verification and Reliability, 2018
- 1600 faults in 100 projects: automatically finding faults while achieving high coverage with EvoSuiteEmpirical Software Engineering, 2013
- Parameter tuning or default values? An empirical investigation in search-based software engineeringEmpirical Software Engineering, 2013
- Multi-objective optimization algorithms applied to the class integration and test order problemInternational Journal on Software Tools for Technology Transfer, 2012
- A study on the use of non-parametric tests for analyzing the evolutionary algorithms’ behaviour: a case study on the CEC’2005 Special Session on Real Parameter OptimizationJournal of Heuristics, 2008
- Using Coupling-Based Weights for the Class Integration and Test Order ProblemThe Computer Journal, 2007