Skip to main content
Log in

Test data generation using flocking of fireflies in software testing

  • Original Research
  • Published:
Life Cycle Reliability and Safety Engineering Aims and scope Submit manuscript

Abstract

This paper presents test data generation using Artificial Firefly (AF) algorithm in software testing based on Markov model. This concept initially focus on flow graph by connecting decision-to-decision (DD-graph) from the control flow graph of the program. Moreover, the Linear Code Sequence and Jump (LCSAJ) coverage is used to identify minimum number of test paths which covers all edges and nodes in flow graph as compared to cyclomatic complexity. Automatic test cases are generated and the nature of test case is a combined data-types such as integer-float-Boolean values. With the help of these initial test suite, the branch coverage summary is generated using gcov coverage compiler and it is considered as an edge weight of DD-graph. These weight values are considered as Markov Transition Probability (TPM) which is more helpful to describe the fitness function. Now, the members of population for the AF algorithm is randomly selected from the generated initial test suite. Moreover, the path coverage metric is used as a fitness function which maximizes the high light intensity. This present study ensures 100% coverage and it is compared to Artificial Bee Colony (ABC) optimization technique. Moreover, this present study increases the randomness, convergence speed, attain quick coverage and generates an optimal test data for the program.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7

Similar content being viewed by others

References

  • Ahmed S (2010) Ghiduk. A new software data flow testing approach via ant colony algorithms. Univers J Comput Sci Eng Technol 1(1):64–72

    Google Scholar 

  • Anupriya S, Hari MP, Deepti M (2015) Comparative review of selection techniques in genetic algorithm. IEEE Int Conf Futuristic Trends Comput Anal Knowl Manag (ABLAZE) 7(5):515–519

    Google Scholar 

  • Babu PA, Senthil Kumar C, Murali N et al (2012) A hybrid approach to quantify software reliability in nuclear safety systems. Ann Nucl Energy 50:133–140

    Article  Google Scholar 

  • Bali B, Brij MS (2021) Unification of firefly algorithm with density-based spatial clustering for segmentation of medical images. Int J Comput Appl Technol 65(4):316–324

    Article  Google Scholar 

  • Barisal S, Dutta A, Godboley S, Mohapatra DP (2021) MC/DC guided test sequence prioritization using firefly algorithm. Evol Intel 14:105–118

    Article  Google Scholar 

  • Boopathi M, Sujatha R, Senthil Kumar CS, Narasimman S (2017) Quantification of software code coverage using artificial bee colony optimization based on Markov approach. Arab J Sci Eng 42(8):3503–3519

    Article  MATH  Google Scholar 

  • Boopathi M, Sujatha R, Senthil Kumar C, Narasimman S, Rajan A (2019) Markov approach for quantifying the software code coverage using genetic algorithm in software testing. Int J Bio-Inspired Comput 14(1):27–45

    Article  Google Scholar 

  • Brian G, Stallman R (2004) An introduction to GCC: for the GNU Compilers gcc and G++. Network Theory Limited

  • Cheung RC (1980) A user-oriented software reliability model. IEEE Trans Softw Eng 6(2):118–125

    Article  MATH  Google Scholar 

  • Darwish A (2018) Bio-inspired computing: algorithms review, deep analysis, and the scope of applications. Future Comput Inf J 3(2):231–246

    Article  MathSciNet  Google Scholar 

  • Djam XY, Nachamada VB, Modesta EE (2021) A comparative evaluation of test coverage techniques effectiveness. J Softw Eng Appl 14(4):95–109

    Article  Google Scholar 

  • Dokeroplu T, Sevinc E, Kucukyilmaz T, Cosar A (2019) A survey on new generation metaheuristic algorithms. Comput Ind Eng 137:1–29

    Google Scholar 

  • Dokeroplu T, Sevinc E, Cosar A (2019) Artificial bee colony optimization for the quadratic assignment problem. Comput Inf 76:595–606

    Google Scholar 

  • Essiz ES, Oturakci M (2021) Artificial bee colony-based feature selection algorithm for cyberbullying. Comput J 64(3):305–3136

    Article  Google Scholar 

  • Eva T, Mrkela L, Tuba M (2016) Support vector machine parameter tuning using firefly algorithm. In: 26th Conference Radioelektronika, IEEE, pp 413–418

  • Fan S, Yao N, Wan L, Ma B, Zhang Y (2021) An evolutionary generation method of test data for multiple paths based on coverage balance. IEEE Access 9:86759–86772

    Article  Google Scholar 

  • Fister I Jr, Yang XS, Fister I, Brest J, Fister D (2013) A brief review of nature-inspired algorithms for optimization. Elektroteh Vestn (English Ed) 80(3):1–7

    MATH  Google Scholar 

  • Fister I, Yang X-S, Brest J et al (2016) A comprehensive review of firefly algorithms. Swarm Evolut Comput 13:34–46

    Article  Google Scholar 

  • Ghatasheh N, Faris H, Aljarah I, Al-Sayyed RM (2015) Optimizing software effort estimation models using firefly algorithm. J Softw Eng Appl 8(3):133–143

    Article  Google Scholar 

  • Girgis MR, Ghiduk AS, Abd-elkawy EH (2014) Automatic generation of data flow test paths using a genetic algorithm. Int J Comput Appl 89(12):29–36

    Google Scholar 

  • (2014) How to generate random float number in C. stack overflow. http://stackoverflow.com/questions/13408990/how-to-generate-random-float-number-in-c. Accessed 8 April 2014

  • Huang Z, Chen Y (2015) Log-linear model based behavior selection method for artificial fish swarm algorithm. Comput Intell Neurosci 5:01–10

    Google Scholar 

  • Jatana N, Suri B (2019) Particle swarm and genetic algorithm applied to mutation testing for test data generation: a comparative evaluation. J King Saud Univ 32(4):514–521

    Google Scholar 

  • Khatibsyarbini M, Mohd AI, Dayang NAJ, Haza NAH, Muhammad DMS (2019) Test case prioritization using firefly algorithm for software testing. IEEE Access 7:132360–132373

    Article  Google Scholar 

  • Kumar S, Yadav DK, Khan DA, Anurag S (2015) A tool to generate all DU paths automatically. In: 2nd IEEE International Conference on computing for sustainable global development (INDIACom), New Delhi, India

  • Majumdar R, Kapur PK, Sunil KK (2016) Measuring testing efficiency and effectiveness for software upgradation and its impact on CBP. In: International Conference on Innovation and Challenges in Cyber Security, IEEE, pp 123–128

  • McMinn P (2004) Search-based software test data generation: A survey. Softw Test Verif Reliab 14(2):105–156

    Article  Google Scholar 

  • Oliveira MS, Schirru R, De Medeiros JACC (2009) On the performance of an artificial bee colony optimization algorithm applied to the accident diagnosis in a PWR nuclear power plant. In: In Proceedings of International Nuclear Atlantic Conference, INAC Brazil, pp 1–11

  • Omur S, Akay B (2016) Comparisons of metaheuristic algorithms and fitness functions on software test data generation. Appl Soft Comput 49:1202–1214

    Article  Google Scholar 

  • Pandey A, Banerjee S (2021) Test suite optimization using chaotic firefly algorithm in software testing. In: Research Anthology on Recent Trends, Tools, and Implications of Computer Programming, IGI Global, pp 722-739

  • Parsai A, Demeyer S (2020) Comparing mutation coverage against branch coverage in an industrial setting. Int J Softw Tools Technol Transfer 22:365–388

    Article  Google Scholar 

  • Razali NM, Geragthy J (2011) Genetic algorithm performance with different selection strategies in solving TSP. Proc World Congr Eng 7(5):1134–1139

    Google Scholar 

  • Saadatjoo MA, Babamir BM (2019) Test-data generation directed by program path coverage through imperialist competitive algorithm. Sci Comput Progr 184:102304

    Article  Google Scholar 

  • Sahoo RR, Ray M (2020) PSO based test case generation for critical path using improved combined fitness function. J King Saud Univ 32(4):479–490

    Google Scholar 

  • Srivastava PR, Kim T-H (2009) Application of genetic algorithm in software testing. Int J Softw Eng Appl 3(4):87–96

    Google Scholar 

  • Srivatsava PR, Mallikarjun B, Xin SY (2013) Optimal test sequence generation using firefly algorithm. Swarm Evol Comput 8:44–53

    Article  Google Scholar 

  • Sujatha R, Boopathi M, Senthil Kumar C (2014) Genetic algorithm approach based on Markov model basic path testing for MIMO systems in software testing. SRESA’s Int Life cycle Reliab Saf Eng 3(4):01–07

    Google Scholar 

  • Surafel LT, Hong CO (2012) Modified firefly algorithm. J Appl Math 3:1–12

    MathSciNet  MATH  Google Scholar 

  • Syed U, Ahmed M, Asim A, Charu B et al (2014) How to design and test safety critical software systems. Int J Adv Comput Sci Technol 3(1):19–22

    Google Scholar 

  • Syed RJS, Shah TU, Johar ZU, Shah Y, Fazlullah K et al (2015) An innovative approach to investigate various software testing techniques and strategies. Int J Sci Res Sci Eng Technol 2(2):682–689

    Google Scholar 

  • Tang J, Liu G, Pan Q (2021) A review on representative swarm intelligence algorithms for solving optimization problems: applications and trends. IEEE/CAA J Autom Sin 8(10):1627–1643

    Article  MathSciNet  Google Scholar 

  • Thirugnanasambandam K, Rajeswari M, Debnath B, Jung-yoon K (2022) Directed artificial bee colony algorithm with revamped search strategy to solve global numerical optimization problems. Autom Softw Eng 29:13

    Article  Google Scholar 

  • Varshney S, Mehrotra M (2016) Search-based test data generator for data flow dependencies using dominance concepts, branch distance and elitism. Arab J Sci Eng 41(3):853–881

    Article  Google Scholar 

  • Verma OP, Aggarwal D, Patodi T (2016) Opposition and dimensional based modified firefly algorithm. Expert Syst Appl 44:168–176

    Article  Google Scholar 

  • Wahab MNA, Nefti-Meziani S, Atyabi A (2015) A comprehensive review of swarm optimization algorithms. PLoS ONE 10(5):1–36

    Article  Google Scholar 

  • Wang B, Li DX, Jiang JP, Liao YH (2015) A modified firefly algorithm based on light intensity difference. J Comb Optim 31(3):1045–1060

    Article  MathSciNet  MATH  Google Scholar 

  • Wang H, Wang W, Sun H, Rahnamayan S (2016) Firefly algorithm with random attraction. Int J Bio-Inspir Comput 8(1):33–41

    Article  Google Scholar 

  • Wei X, Zhang J, Zhou DS, Zhang Q (2015) Multiswarm particle swarm optimization with transfer of the best particle. Comput Intell Neurosci 2015:1–9

    Article  Google Scholar 

  • (2017) Why a complete graph has \(\displaystyle n(n-1)/2\) edges? https://math.stackexchange.com/questions/17747/why-a-complete-graph-has-fracnn-12-edges. Accessed 8 July 2017

  • Yuan-Bin M, Yan-Zhui M, Qiao-Yan Z (2012) Optimal choice of parameters for firefly algorithm. In: Proceedings of the Fourth International Conference on Digital Manufacturing and Automation, pp 887–892

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to R. Sujatha.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Boopathi, M., Senthil Kumar, C. & Sujatha, R. Test data generation using flocking of fireflies in software testing. Life Cycle Reliab Saf Eng 11, 117–133 (2022). https://doi.org/10.1007/s41872-022-00191-6

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s41872-022-00191-6

Keywords

Navigation