Open Access
ARTICLE
Automatic PSO Based Path Generation Technique for Data Flow Coverage
1 College of Computers and Information Technology, Taif University,PO BOX 11099, Taif, 21944,Saudi Arabia
2 Dept. of Mathematics and Computer Science, Faculty of Science, Beni-Suef University,Beni-Suef, 62521,Egypt
3 Dept. of Computer Science, Faculty of Science, Minia University,Minia,Egypt
4 Faculty of Computing and IT, Northern Border University,Saudi Arabia
* Corresponding Author: Ahmed S. Ghiduk. Email:
Intelligent Automation & Soft Computing 2021, 29(1), 147-164. https://doi.org/10.32604/iasc.2021.015708
Received 03 December 2020; Accepted 06 March 2021; Issue published 12 May 2021
Abstract
Path-based testing involves two main steps: 1) finding all paths throughout the code under test; 2) creating a test suite to cover these paths. Unfortunately, covering all paths in the code under test is impossible. Path-based testing could be achieved by targeting a subset of all feasible paths that satisfy a given testing criterion. Then, a test suite is created to execute this paths subset. Generating those paths is a key problem in path testing. In this paper, a new path testing technique is presented. This technique employs Particle Swarm Optimization (PSO) for generating a set of paths to satisfy the all-uses criterion. To construct such paths for programs with loops, the proposed technique applies the ZOT-criterion. This criterion selects paths that traverse loops 0, 1, and 2 times. The proposed technique utilizes the decision-decision graph of the program under test to represent the position vector of the particle. To evaluate the efficiency of the presented technique, an empirical study has been conducted, which included 15 C# programs. In this study, the proposed technique has been compared with a genetic algorithm (GA)-based one. The results showed that the PSO required 199 generations, while the GA required 349 generations, to satisfy all def-use paths of all programs. In addition, the proposed technique required a smaller number of paths than the GA-based one.Keywords
Cite This Article
This work is licensed under a Creative Commons Attribution 4.0 International License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.