Abstract

Automated test data generation tools produce test data that can achieve high coverage faster than test data generated manually by a tester. However, the test data generated by automated tools has been shown to not help developers find more bugs. The main reason is that it is difficult for human testers to understand and evaluate the test data. In this paper, an approach is introduced to automatically generate readable test data, which has been implemented in a tool called CTS. CTS can mine constant information from projects under testing and obtain heuristic information by aggregating and rating related constants. CTS adds heuristic information to the automatic test data generation process to generate test data that is quick and easy for a human to comprehend and check. Empirical experiments show that the proposed approach can improve the efficiency of test data generation and generate test data that is more convenient for a human oracle.

Highlights

  • Software testing is an important activity in software development and is widely used to assure software quality (Panda and Mohapatra, 2017; Pan et al, 2018; Neves et al, 2016)

  • Symbolic execution is performed by traversing the control flow graph (CFG) along the given path and simulating the effect of executing the code contained in a node of the abstract syntax tree (AST) that corresponds to the node in the CFG

  • code testing system (CTS) is divided into two versions: CTS with related constant analysis and CTS without related constant analysis (CTS-Basic)

Read more

Summary

Introduction

Software testing is an important activity in software development and is widely used to assure software quality (Panda and Mohapatra, 2017; Pan et al, 2018; Neves et al, 2016). For the CBT approach, incorporating knowledge about the input domain in the generation process would mean adding extra constraints to the program constraints or designating a start point to seed the generation of test data. Compared with under-constrained variables, variables with integrated constraints reduce the solution space, but determining how to generate readable test data in the solution space is an important problem that needs to be solved As a result, both obtaining extra constraints and providing a starting point to seed test data generation are important issues that must be addressed in generating readable test data based on the CBT approach. Rather than relying on frequently unavailable program specifications and expert knowledge to generate readable test data, we leverage constant information mined from the source code to generate extra constraints and seed the generation process.

Background and basic idea of our approach
Semantic readability
Extracting program constraints and related constants
Under-constrained analysis
Aggregating and rating related constants to generate heuristic information
Specific operators in related constant extraction
Aggregating and rating related constants
Evaluation
Threats to validity
Related work
Conclusions
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call