Skip to main content
QUICK REVIEW

[Paper Review] A Genetic Algorithm based Approach for Test Data Generation in Basis Path Testing

Yeresime Suresh, Santanu Kumar Rath|arXiv (Cornell University)|Jan 21, 2014
Software Testing and Debugging TechniquesComputer Science14 references28 citations
TL;DR

This paper proposes a genetic algorithm (GA)-based approach to automate test data generation for basis path testing, leveraging GA's global optimization to efficiently explore complex predicate conditions. The method uses fitness-driven evolution to generate optimal test cases that satisfy all basis paths, reducing manual effort and eliminating redundant test data, as validated through an ATM withdrawal use case with successful convergence to valid test inputs.

ABSTRACT

Software Testing is a process to identify the quality and reliability of software, which can be achieved through the help of proper test data. However, doing this manually is a difficult task due to the presence of number of predicate nodes in the module. So, this leads towards a problem of NP-complete. Therefore some intelligence-based search algorithms have to be used to generate test data. In this paper, we use a soft computing based approach, genetic algorithm to generate test data based on the set of basis paths. This paper combines the characteristics of genetic algorithm with test data, making use of the merits of respective global and local optimization capability to improve the generation capacity of test data. This automated process of generating test data optimally helps in reducing the test effort and time of a tester. Finally, the proposed approach is applied for ATM withdrawal task. Experimental results show that genetic algorithm was able to generate suitable test data based on a fitness value and avoid redundant data by optimization.

Motivation & Objective

  • To address the NP-complete challenge of generating optimal test data for software modules with complex predicate logic.
  • To reduce manual testing effort and time by automating test data generation using soft computing techniques.
  • To improve test coverage and efficiency by generating test data that satisfies all basis paths derived from control flow graphs.
  • To minimize redundant test cases through fitness-based selection and evolutionary optimization in a genetic algorithm framework.

Proposed method

  • The approach begins by constructing a control flow graph (CFG) from the source code to identify all basis paths.
  • Each basis path is represented as a chromosome in the genetic algorithm, with test data encoded as gene sequences.
  • A fitness function evaluates how well a test case satisfies the path's predicate conditions, guiding evolutionary selection.
  • Crossover and mutation operators are applied to generate new test data candidates, improving fitness over generations.
  • The algorithm evolves test data until a fitness threshold is met, indicating a valid test case for the path.
  • The process is iterated across all basis paths to generate a complete, optimized test suite.

Experimental results

Research questions

  • RQ1Can a genetic algorithm effectively generate test data that satisfies all basis paths in a software module?
  • RQ2How does the fitness function influence the convergence and quality of generated test cases?
  • RQ3To what extent can the GA approach reduce redundant test data compared to manual or exhaustive methods?
  • RQ4How does the proposed method compare in efficiency and coverage to traditional test data generation techniques?

Key findings

  • The genetic algorithm successfully generated valid test data for all basis paths in the ATM withdrawal use case, demonstrating feasibility.
  • Fitness-based evaluation effectively guided the search toward valid test cases, minimizing redundant data generation.
  • The approach significantly reduced manual test design effort by automating the generation process.
  • The algorithm converged to optimal or near-optimal test cases within a reasonable number of generations, indicating scalability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.