Multi-Objective Fault-Coverage Based Regression Test Selection and Prioritization Using Enhanced ACO_TCSP
Abstract
:1. Introduction
- (1)
- Highest fault coverage achieved i.e., maximum faults should be caught by the test suite, and
- (2)
- The least possible test case execution time.
2. Related Work
3. Ant Colony Optimization
3.1. Concept
3.2. Limitations of ACO
- (1)
- Lower Termination condition (TC) values lead the ACO_TSCP to fall into the local optima problem by restricting exploration of newer paths.
- (2)
- Around 5% of the time, the ACO_TCSP could explore the optimum path, but due to the lack of pheromone that could be deposited, it is not the best path, i.e., the algorithm ended by meeting set TC criteria.
- (3)
- Lower TC value directly implies a lower number of iterations. Hence, changes are made in the algorithm to reach the set TC value as delayed as possible.
4. Proposed Enhancements
4.1. Expand the Searched Space
4.2. Elitism
4.3. Modifying Total Time Calculation
5. Implementing the Enhancements
5.1. Problem Representation and Execution Steps
- MAX represents the overall Time Constraint.
- Z stands for an intermediary variable used for TC calculations.
- {a1 EF, a2 EF, …, an EF} represents a set of artificial ants, where ‘EF’ is the enhancement factor.
- S1 to S (n EF) be the sets in which (n EF) ants maintain the record of the covered test cases.
5.2. Modified Algorithm and its Complexity
Algorithm 1: Enhanced ACO_TCSP |
Stage-1 |
1.Initialization Statement-wise complexity |
Set Wi = 0 …………………………1 |
Set TC = MAX (User Defined) |
…………………………1 |
Set EF = Enhancement Factor (User defined) …………………………1 |
Set Zx = 0 for all x = 1 to (N EF) ……………………N EF |
Create N EF artificial ants {a1, a2,……. a(N*EF)} ……………………N EF |
…S1, S2, …… S(N EF) = NULL ……………………N EF |
Stage-2 |
2. Do // LOOP 3—outermost |
For x = 1 to (N EF) // LOOP 2 …………………… Runs N EF times |
Sx = Sx + { txEF } // Initial test case for ant ax is ……………………1 |
TmpT = txEF // the starting vertex for ant ax on the graph ……………………1 |
Do // Loop 1—Innermost loop |
tt = Call_select_test_case (ax, tmpT) ……………………6 |
tUpdate Sx = Sx + {t} . ……………………1 |
tZx = Zx + texec_time ……………………1 |
tmpT = t ……………………1 |
While (total faults are covered) // Max N times (no of all Test Cases) |
// Loop 1 (Innermost loop)—ENDS |
EndFor // Loop 2 ENDS |
minTime = min {Zx} ……………………N * EF |
currTime = CuurTime + minTime ……………………1 |
Zx = 0, for all x =0 to N EF ……………………N EF |
Update pheromone on all egdes of bestPath with minTime ……………………n − 1 |
Evaporate k% pheromonee from each edge ……………………n − 1 |
Last_Path = Sx for k of the last iteration of Loop2 ……………………1 |
Sx = null for all x ……………………EF |
While (TC ≥ currTime) // End of Loop 3 |
// MODULE select_test_case is presented below (As taken from [7,8]) |
select_test_case (x, next_node) |
{ |
If(max_pheromene edge out of all the edges from next_node to a node ‘k’ (W[nxtnode][k] ) does not exist in S[i][1 … N]) ……………………2 |
Then |
Return ‘k’ ……………………1 |
Else |
Select a random edge [next_node,k], from next_node to node ‘k’ not existing in P[i][1 … N], from all edges having next max (W[nxtnode][h]) |
……………………3 |
Return ‘h ……………………1 |
} |
6. Experimental Design
6.1. Benchmark Programs
6.2. Design
6.3. ACO Parameter Settings for Enhanced ACO_TCSP
7. Result Analysis
7.1. Execution Time of Paths Discovered
7.2. Correctness of the Technique
7.3. APFD and Statistical Analysis
8. Discussion
- (1)
- The proposed technique results in the minimization of the test suite as the EF increases,
- (2)
- The running time is substantially reduced, and with the rise in EF, it is further reduced,
- (3)
- The precision of results achieved is encouraging for most of the test programs,
- (4)
- The percentage improvement in correctness is very high compared to the previous technique,
- (5)
- A comparison of the Enhanced ACO_TCSP prioritized test suite with No Order, Reverse Order, Random Order and Optimal Order prioritized test suites using APFD has been carried out. The results yielded APFD values for ACO that are equivalent to the optimum values (values that have maximum possible fault exposure in minimum possible time). The effect of the enhancement factor for different values of EF depicted motivating observations validates the Enhanced ACO_TCSP against the old approach [31]. The time reduction for the chosen resultant test suite by ACO was found to be almost the same for varying values of EF. This is due to the balancing provided by the increase in the number of ants for the new algorithm. The resultant test suite thus obtained potentially provides fast fault coverage.
- A higher number of possible best paths are found at increased EF.
- The selected best path is about the same for low and high values of EF.
- The iteration number for convergence of Enhanced ACO_TCSP reduces with the increase in EF, this validates more exploration at the initial stages of the algorithm also.
- Enhanced ACO_TCSP tends to yield optimum results at higher values of EF.
9. Conclusions and Future Scope
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Bajaj, A.; Abraham, A.; Ratnoo, S.; Gabralla, L.A. Test Case Prioritization, Selection, and Reduction Using Improved Quantum-Behaved Particle Swarm Optimization. Sensors 2022, 22, 4374. [Google Scholar] [CrossRef] [PubMed]
- Ansari, A.; Khan, A.; Khan, A.; Mukadam, K. Optimized regression test using test case prioritization. Procedia Comput. Sci. 2016, 79, 152–160. [Google Scholar] [CrossRef] [Green Version]
- Kumar, S.; Ranjan, P. ACO based test case prioritization for fault detection in maintenance phase. Intern. J. Appl. Eng. Res. 2017, 12, 5578–5586. [Google Scholar]
- Mohapatra, S.K.; Prasad, S. Finding Representative Test Case for Test Case Reduction in Regression Testing. Int. J. Intell. Syst. Appl. 2015, 7, 60. [Google Scholar] [CrossRef] [Green Version]
- Noemmer, R.; Haas, R. An evaluation of test suite minimization techniques. In Software Quality: Quality Intelligence in Software and Systems Engineering; Springer: Vienna, Austria, 2019. [Google Scholar]
- Sharma, B.; Hashmi, A.; Gupta, C.; Jain, A. Collaborative Recommender System based on Improved Firefly Algorithm. Comput. Y Sist. 2022, 26, 2. [Google Scholar] [CrossRef]
- Singh, Y.; Kaur, A.; Suri, B. Test case prioritization using ant colony optimization. ACM SIGSOFT Softw. Eng. Notes 2010, 35, 1–7. [Google Scholar] [CrossRef]
- Suri, B.; Singhal, S. Implementing Ant Colony Optimization for Test Case Selection and Prioritization. Int. J. Comput. Sci. Eng. 2011, 3, 1924–1932. [Google Scholar]
- Wu, L.; Huang, X.; Cui, J.; Liu, C.; Xiao, W. Modified adaptive ant colony optimization algorithm and its application for solving path planning of mobile robot. Expert Syst. App. 2023, 215, 119410. [Google Scholar] [CrossRef]
- Bajaj, A.; Sangwan, O.P. A systematic literature review of test case prioritization using genetic algorithms. IEEE Access 2019, 7, 126355–126375. [Google Scholar] [CrossRef]
- Li, F.; Zhou, J.; Li, Y.; Hao, D.; Zhang, L. Aga: An accelerated greedy additional algorithm for test case prioritization. IEEE Trans. Softw. Eng. 2021, 48, 5102–5119. [Google Scholar] [CrossRef]
- Jatana, N.; Suri, B. Particle swarm and genetic algorithm applied to mutation testing for test data generation: A comparative evaluation. J. King Saud Univ.-Comput. Inf. Sci. 2020, 32, 514–521. [Google Scholar] [CrossRef]
- Chaudhary, N.; Sangwan, O. Multi Objective Test Suite Reduction for GUI Based Software Using NSGA-II. Int. J. Inf. Technol. Comput. Sci. 2016, 8, 59–65. [Google Scholar] [CrossRef]
- Öztürk, M.M. A bat-inspired algorithm for prioritizing test cases. Vietnam. J. Comput. Sci. 2018, 5, 45–57. [Google Scholar] [CrossRef] [Green Version]
- Dhareula, P.; Ganpati, A. Flower Pollination Algorithm for Test Case Prioritization in Regression Testing. In ICT Analysis and Applications: Proceedings of ICT4SD 2019; Springer: Singapore, 2020; Volume 93, pp. 155–167. [Google Scholar] [CrossRef]
- Srivastava, P.; Reddy, D.P.K.; Reddy, M.S.; Ramaraju, C.V.; Nath, I.C.M. Test Case Prioritization Using Cuckoo Search. In Advanced Automated Software Testing: Frameworks for Refined Practice; IGI Global: Hershey, PA, USA, 2020; pp. 113–128. [Google Scholar]
- Kaushik, A.; Verma, S.; Singh, H.J.; Chhabra, G. Software cost optimization integrating fuzzy system and COA-Cuckoo optimization algorithm. Int. J. Syst. Assur. Eng. Manag. 2017, 8, 1461–1471. [Google Scholar] [CrossRef]
- Mann, M.; Sangwan, O.P. Test case prioritization using Cuscuta search. Netw. Biol. 2014, 4, 179–192. [Google Scholar]
- Jatana, N.; Suri, B. An Improved Crow Search Algorithm for Test Data Generation Using Search-Based Mutation Testing. Neural Process. Lett. 2020, 52, 767–784. [Google Scholar] [CrossRef]
- Panwar, D.; Tomar, P.; Singh, V. Hybridization of Cuckoo-ACO algorithm for test case prioritization. J. Stat. Manag. Syst. 2018, 21, 539–546. [Google Scholar] [CrossRef]
- Yoo, S.; Harman, M. Using hybrid algorithm for Pareto efficient multi-objective test suite minimisation. J. Syst. Softw. 2010, 83, 689–701. [Google Scholar] [CrossRef]
- Xu, Z.; Gao, K.; Khoshgoftaar, T.M.; Seliya, N. System regression test planning with a fuzzy expert system. Inf. Sci. 2014, 259, 532–543. [Google Scholar] [CrossRef]
- Zhou, Z.Q.; Sinaga, A.; Susilo, W.; Zhao, L.; Cai, K.-Y. A cost-effective software testing strategy employing online feedback information. Inf. Sci. 2018, 422, 318–335. [Google Scholar] [CrossRef] [Green Version]
- Dorigo, M.; Maniezzo, V.; Colorni, A. The Ant System: An Autocatalytic Optimizing Process. In Technical Report TR91-016; Politecnico di Milano: Milano, Italy, 1991. [Google Scholar]
- Chaudhary, R.; Agrawal, A.P. Regression Test Case Selection for Multi-Objective Optimization Using Metaheu-ristics. Int. J. Inf. Technol. Comput. Sci. 2015, 7, 50–56. [Google Scholar]
- Bian, Y.; Li, Z.; Zhao, R.; Gong, D. Epistasis based aco for regression test case prioritization. IEEE Trans. Emerg. Top. Comput. Intell. 2017, 1, 213–223. [Google Scholar] [CrossRef]
- Vescan, A.; Pintea, C.M.; Pop, P.C. Solving the test case prioritization problem with secure features using ant colony system. In Proceedings of the International Joint Conference: 12th International Conference on Computational Intelligence in Security for Information Systems (CISIS 2019) and 10th International Conference on European Transnational Education (ICEUTE 2019), Seville, Spain, 13–15 May 2019; Springer: Cham, Switzerland, 2019. [Google Scholar]
- Suri, B.; Singhal, S. Understanding the effect of time-constraint bounded novel technique for regression test selection and prioritization. Int. J. Syst. Assur. Eng. Manag. 2015, 6, 71–77. [Google Scholar] [CrossRef]
- Noguchi, T.; Washizaki, H.; Fukazawa, Y.; Sato, A.; Ota, K. History-Based Test Case Prioritization for Black Box Testing Using Ant Colony Optimization. In Proceedings of the IEEE 8th International Conference on Software Testing, Verification and Validation (ICST), Graz, Austria, 13–17 April 2015. [Google Scholar] [CrossRef]
- Ahmad, S.F.; Singh, D.K.; Suman, P. Prioritization for Regression Testing Using Ant Colony Optimization Based on Test Factors. In Intelligent Communication, Control and Devices; Springer: Berlin, Germany, 2018; pp. 1353–1360. [Google Scholar] [CrossRef]
- Singhal, S.; Jatana, N.; Suri, B.; Misra, S.; Fernandez-Sanz, L. Systematic literature review on test case selection and prioritization: A tertiary study. Appl. Sci. 2021, 11, 12121. [Google Scholar] [CrossRef]
- Suri, B.; Singhal, S. Evolved regression test suite selection using BCO and GA and empirical comparison with ACO. CSI Trans. ICT 2016, 3, 143–154. [Google Scholar] [CrossRef]
- Suri, B.; Singhal, S. Literature survey of Ant Colony Optimization in software testing. In Proceedings of the CONSEG, CSI Sixth International Conference On Software Engineering, Indore, India, 5–7 September 2012. [Google Scholar] [CrossRef]
- Kavitha, R.; Jothi, D.K.; Saravanan, K.; Swain, M.P.; Gonzáles, J.L.A.; Bhardwaj, R.J.; Adomako, E. Ant colony optimization-enabled CNN deep learning technique for accurate detection of cervical cancer. BioMed Res. Int. 2023, 2023, 1742891. [Google Scholar] [CrossRef]
- Singhal, S.; Suri, B. Multi objective test case selection and prioritization using African buffalo optimization. J. Inf. Optim. Sci. 2020, 41, 1705–1713. [Google Scholar] [CrossRef]
- Singhal, S.; Jatana, N.; Dhand, G.; Malik, S.; Sheoran, K. Empirical Evaluation of Tetrad Optimization Methods for Test Case Selection and Prioritization. Indian J. Sci. Technol. 2023, 16, 1038–1044. [Google Scholar] [CrossRef]
- Suri, B.; Singhal, S. Analyzing test case selection & prioritization using ACO. ACM SIGSOFT Softw. Eng. Notes 2011, 36, 1–5. [Google Scholar]
- Dorigo, M.; Di Caro, G.; Gambardella, L.M. Ant Algorithms for Discrete Optimization. Artif. Life 1999, 5, 137–172. [Google Scholar] [CrossRef] [Green Version]
- Chen, X.; Gu, Q.; Zhang, X.; Chen, D. Building Prioritized Pairwise Interaction Test Suites with Ant Colony Optimization. In Proceedings of the 2009 Ninth International Conference on Quality Software, Jeju, Korea, 24–25 August 2009; pp. 347–352. [Google Scholar] [CrossRef]
- Zhu, A.; Xu, C.; Li, Z.; Wu, J.; Liu, Z. Hybridizing grey wolf optimization with differential evolution for global optimization and test scheduling for 3D stacked SoC. J. Syst. Eng. Electron. 2015, 26, 317–328. [Google Scholar] [CrossRef]
Program | Program Title | Lines of Code (kloc) | No. of Mutations | Test Suite Size (TS) | Execution Time (ms) |
---|---|---|---|---|---|
P1 | Coll_Admison | 0.281 | 5 | 9 | 1.0532 |
P2 | Triangle_sides | 0.037 | 6 | 19 | 3.82 |
P3 | Basic_calculator | 0.101 | 9 | 25 | 0.825 |
P4 | Railways Booking | 0.129 | 10 | 26 | 1.77 |
Na | N * EF |
---|---|
A | 1.0 (Parameter to control exploration level) |
Β | 0.2 (Parameter to keep exploitation in check) |
Ρ | 0.1 (Evaporation Rate of pheromone—10% as used by majority researchers) |
Τ | 1.0 (Amount of Pheromone to be deposited on best path edges) |
q0 | 1.0 (chosen constant used on calculation of pheromone to be evaporated) |
RUN | Na | Running Time (sec) | Best Path | Total Exec. Time | Best P Exec. Time | No. of Test Cases Covered | No. of Iterations | Best P Found at Iteration | Optimal P Found at Iteration |
---|---|---|---|---|---|---|---|---|---|
TC = 200 | |||||||||
ants | 1 | 0.054945 | 8 | 82.10127 | 18.796 | 2 | 10.7 | 2.4 | 2.25 |
ants | 2 | 0.054945 | 9 | 82.3225 | 18.563 | 2 | 10.8 | 3.8 | 4 |
ants | 3 | 0.049451 | 10 | 82.54895 | 18.33 | 2 | 10.9 | 3.2 | 3.2 |
ants | 4 | 0.054945 | 10 | 82.54373 | 18.33 | 2 | 11 | 2.3 | 2.3 |
avg | 0.053571 | 82.37911 | 18.50475 | 2 | 10.85 | 2.925 | 2.945946 | ||
TC = 300 | |||||||||
ants | 1 | 0.043956 | 6 | 80.87737 | 20.096 | 2.1 | 15.3 | 3.2 | 3.666667 |
ants | 2 | 0.06044 | 9 | 82.23752 | 18.647 | 2 | 16.2 | 4.5 | 4.555556 |
ants | 3 | 0.054945 | 10 | 82.54373 | 18.33 | 2 | 16.9 | 1.8 | 1.8 |
ants | 4 | 0.065934 | 10 | 82.53329 | 18.33 | 2 | 17 | 1.7 | 1.7 |
avg | 0.056319 | 82.04798 | 18.85075 | 2.025 | 16.35 | 2.8 | 2.8 | ||
TC = 400 | |||||||||
ants | 1 | 0.049451 | 8 | 81.96406 | 18.946 | 2 | 20.8 | 7.2 | 7.5 |
ants | 2 | 0.054945 | 10 | 82.54373 | 18.33 | 2 | 22 | 3.4 | 3.4 |
ants | 3 | 0.06044 | 10 | 82.53851 | 18.33 | 2 | 22 | 1.3 | 1.3 |
ants | 4 | 0.071429 | 10 | 82.52808 | 18.33 | 2 | 22 | 1.8 | 1.8 |
avg | 0.059066 | 82.39359 | 18.484 | 2 | 21.7 | 3.425 | 3.289474 | ||
TC = 500 | |||||||||
ants | 1 | 0.054945 | 9 | 82.3225 | 18.563 | 2 | 26.5 | 6.2 | 6.555556 |
ants | 2 | 0.054945 | 10 | 82.54373 | 18.33 | 2 | 27.4 | 3.7 | 3.7 |
ants | 3 | 0.06044 | 10 | 82.53851 | 18.33 | 2 | 27.8 | 2.2 | 2.2 |
ants | 4 | 0.071429 | 10 | 82.52808 | 18.33 | 2 | 27.4 | 1.3 | 1.3 |
avg | 0.06044 | 82.4832 | 18.38825 | 2 | 27.275 | 3.35 | 3.358974 | ||
TC = 600 | |||||||||
ants | 1 | 0.054945 | 10 | 82.54373 | 18.33 | 2 | 32.2 | 5.6 | 5.6 |
ants | 2 | 0.065934 | 10 | 82.53329 | 18.33 | 2 | 32.5 | 5.7 | 5.7 |
ants | 3 | 0.06044 | 10 | 82.53851 | 18.33 | 2 | 32.8 | 4.2 | 4.2 |
ants | 4 | 0.076923 | 10 | 82.52286 | 18.33 | 2 | 33 | 1.8 | 1.8 |
avg | 0.06456 | 82.5346 | 18.33 | 2 | 32.625 | 4.325 | 4.325 |
Prog. No. | OLD % Correctness | NEW % Correctness | % Improvement |
---|---|---|---|
P1 | 65.714 | 95 | 44.565846 |
P3 | 100 | 100 | 0 |
P6 | 47.143 | 79.5 | 68.635853 |
P8 | 18.571 | 46 | 147.69802 |
p-value obtained for % correctness | 0.05896016215814072 |
p-value obtained for % time reduction | 0.11581073519437922 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Singhal, S.; Jatana, N.; Sheoran, K.; Dhand, G.; Malik, S.; Gupta, R.; Suri, B.; Niranjanamurthy, M.; Mohanty, S.N.; Ranjan Pradhan, N. Multi-Objective Fault-Coverage Based Regression Test Selection and Prioritization Using Enhanced ACO_TCSP. Mathematics 2023, 11, 2983. https://doi.org/10.3390/math11132983
Singhal S, Jatana N, Sheoran K, Dhand G, Malik S, Gupta R, Suri B, Niranjanamurthy M, Mohanty SN, Ranjan Pradhan N. Multi-Objective Fault-Coverage Based Regression Test Selection and Prioritization Using Enhanced ACO_TCSP. Mathematics. 2023; 11(13):2983. https://doi.org/10.3390/math11132983
Chicago/Turabian StyleSinghal, Shweta, Nishtha Jatana, Kavita Sheoran, Geetika Dhand, Shaily Malik, Reena Gupta, Bharti Suri, Mudligiriyappa Niranjanamurthy, Sachi Nandan Mohanty, and Nihar Ranjan Pradhan. 2023. "Multi-Objective Fault-Coverage Based Regression Test Selection and Prioritization Using Enhanced ACO_TCSP" Mathematics 11, no. 13: 2983. https://doi.org/10.3390/math11132983
APA StyleSinghal, S., Jatana, N., Sheoran, K., Dhand, G., Malik, S., Gupta, R., Suri, B., Niranjanamurthy, M., Mohanty, S. N., & Ranjan Pradhan, N. (2023). Multi-Objective Fault-Coverage Based Regression Test Selection and Prioritization Using Enhanced ACO_TCSP. Mathematics, 11(13), 2983. https://doi.org/10.3390/math11132983