An Adaptive Search Budget Allocation Approach for Search-Based Test Case Generation

2021 ◽  
Vol 30 (3) ◽  
pp. 1-26
Author(s):  
Simone Scalabrino ◽  
Antonio Mastropaolo ◽  
Gabriele Bavota ◽  
Rocco Oliveto

Search-based techniques have been successfully used to automate test case generation. Such approaches allocate a fixed search budget to generate test cases aiming at maximizing code coverage. The search budget plays a crucial role; due to the hugeness of the search space, the higher the assigned budget, the higher the expected coverage. Code components have different structural properties that may affect the ability of search-based techniques to achieve a high coverage level. Thus, allocating a fixed search budget for all the components is not recommended and a component-specific search budget should be preferred. However, deciding the budget to assign to a given component is not a trivial task. In this article, we introduce Budget Optimization for Testing (BOT), an approach to adaptively allocate the search budget to the classes under test. BOT requires information about the branch coverage that will be achieved on each class with a given search budget. Therefore, we also introduce BRANCHOS, an approach that predicts coverage in a budget-aware way. The results of our experiments show that (i) BRANCHOS can approximate the branch coverage in time with a low error, and (ii) BOT can significantly increase the coverage achieved by a test generation tool and the effectiveness of generated tests.

Author(s):  
KAI H. CHANG ◽  
JAMES H. CROSS II ◽  
W.HOMER CARLISLE ◽  
SHIH-SUNG LIAO

Software testing is an important step in the development of complex systems. The construction of test cases using traditional methods usually requires considerable manual effort. QUEST/Ada—Query Utility Environment for Software Testing of Ada, is a prototype test case generation system that uses various heuristics-based approaches to generate test cases. The system, which is designed for unit testing, generates test cases by monitoring the branch coverage progress and intelligently modifying existing test cases to achieve additional coverage. Three heuristics-based approaches along with a random test case generation method were studied to compare their branch coverage performance. Although some constraints are imposed by the prototype, the framework provides a useful foundation for further heuristics-based test case generation research. The design of the system, the heuristic rules used in the system, and an evaluation of each rule’s performance are presented.


Sign in / Sign up

Export Citation Format

Share Document