Generating Class-Level Integration Tests Using Call Site Information
- 14 October 2022
- journal article
- research article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 49 (4) , 2069-2087
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 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 randomly or at the unit level; (3) Cling can detect integration faults coming from wrong assumptions about the usage of the callee class (25 for our subject systems) that remain undetected when using automatically generated random and unit-level test suites.Keywords
All Related Versions
Funding Information
- eu (731529)
- Horizon 2020 (H2020-ICT-2020-1-RIA)
- COSMOS (957254)
- NWO (VI.C.182.032)
This publication has 69 references indexed in Scilit:
- A Hitchhiker's guide to statistical tests for assessing randomized algorithms in software engineeringSoftware Testing, Verification and Reliability, 2012
- Search-based software engineeringACM Computing Surveys, 2012
- Testing coupling relationships in object‐oriented programsSoftware Testing, Verification and Reliability, 2010
- Using Coupling-Based Weights for the Class Integration and Test Order ProblemThe Computer Journal, 2007
- Search‐based software test data generation: a surveySoftware Testing, Verification and Reliability, 2004
- The construction of contextual def-use associations for object-oriented systemsIEEE Transactions on Software Engineering, 2003
- An investigation of graph-based class integration test order strategiesIEEE Transactions on Software Engineering, 2003
- Interface Mutation: an approach for integration testingIEEE Transactions on Software Engineering, 2001
- Performing data flow testing on classesACM SIGSOFT Software Engineering Notes, 1994
- Control flow analysisACM SIGPLAN Notices, 1970