MC/DC Test Data Generation Algorithm Based on Whale Genetic Algorithm
Author:
Affiliation:

North China Institute of Aerospace Engineering

Clc Number:

Fund Project:

  • Article
  • |
  • Figures
  • |
  • Metrics
  • |
  • Reference
  • |
  • Related
  • |
  • Cited by
  • |
  • Materials
  • |
  • Comments
    Abstract:

    The automatic generation of test data is a key step in realizing automated testing. Most automated testing tools for unit testing only provide test case execution drivers and cannot generate test data that meets coverage requirements. This paper presents an improved Whale Genetic Algorithm for generating test data required for unit testing MC/DC coverage. The proposed algorithm introduces an elite retention strategy to avoid the genetic algorithm from falling into iterative degradation. At the same time, the mutation threshold of the whale algorithm is introduced to balance the global exploration and local search capabilities of the genetic algorithm. The threshold is dynamically adjusted according to the diversity and evolution stage of current population, which positively guides the evolution of the population. Finally, an improved crossover strategy is proposed to accelerate the convergence of the algorithm. The improved whale genetic algorithm is compared with genetic algorithm, whale algorithm and particle swarm algorithm on two benchmark programs. The results show that the proposed algorithm is faster for test data generation than comparison methods and can provide better coverage with fewer evaluations, and has great advantages in generating test data.

    Reference
    Related
    Cited by
Get Citation

LIU Huiying, LIU Ziyang, YAN Minghui.[J]. Instrumentation,2022,9(2):1-12

Copy
Share
Article Metrics
  • Abstract:
  • PDF:
  • HTML:
  • Cited by:
History
  • Received:
  • Revised:
  • Adopted:
  • Online: October 04,2022
  • Published:
License
  • Copyright (c) 2023 by the authors. This work is licensed under a Creative
  • Creative Commons Attribution-ShareAlike 4.0 International License.