Abstract

Test case generation and optimization is the foremost requirement of software evolution and test automation. In this paper, a bio-inspired Crow Search Algorithm (CSA) is suggested with an improved objective function to fulfill this requirement. CSA is a nature-inspired optimization method. The improved objective function combines branch distance and predicate distance to cover the critical path on the control flow graph. CSA is a search-based technique that uses heuristic information for automation testing, and CSA optimizers minimize test cases generated by satisfying the objective function. This paper focuses on generating test cases for all paths, including critical paths. The control flow graph covers the information flow among all the classes, functions, and conditional statements and provides test paths. The number of test cases examined through graph path coverage analysis. The minimum number of test paths is counted through complexity metrics using the cyclomatic complexity of the constructed graph. The proposed method is evaluated as mathematical optimization functions to validate their effectiveness in locating optimal solutions. The python codes are considered for evaluation and revealed that our approach is time-efficient and outperforms various optimization algorithms. The proposed approach achieved 100% path coverage, and the algorithm executes and gives optimum results in approximately 0.2745 seconds.

Highlights

  • The generation or selection of test cases is critical for software testing to ensure its eminence as a product

  • A comparative analysis is done with the other metaheuristic algorithm such as Particle Swarm Optimization (PSO) and APSO

  • These optimization algorithms are applied with Branch Distance Fitness (BDF) and Combined Fitness Function (CFF)

Read more

Summary

Introduction

The generation or selection of test cases is critical for software testing to ensure its eminence as a product. Manual testing consumes 40%–70% of the time and expense associated with software development. The testing team performs software testing by examining the structure of the code deeply. It passes through each line of code to generate a test case suite and test data. A population based metaheuristic CSA is utilized for searching all crucial paths for test case generation. A graphical representation of source code called Control Flow Graph [24] is generated for path coverage. CC is a software metric measured to analyze the code's probable error. Using the McCabe formula, CC is determined from the source code’s CFG. CFG is the combination of nodes and edges that denote instructions and flow of control or data, respectively

Methods
Results
Conclusion
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