Skip to main content

Advertisement

Log in

An accelerating PSO algorithm based test data generator for data-flow dependencies using dominance concepts

  • Original Article
  • Published:
International Journal of System Assurance Engineering and Management Aims and scope Submit manuscript

Abstract

One of the most important and effort intensive activity of the entire software development process is software testing. The effort involved chiefly increases because of the need to obtain optimal test data out of the entire search space of the problem under testing. Software test data generation is one area that has seen tremendous research in terms of automation and optimization. Generating or identifying an optimal test set that satisfies a more robust adequacy criteria, like data flow testing, is still a challenging task. A number of heuristic and meta-heuristics like GA, PSO have been applied to optimize the test data generation problem. GA, although more popular, has its own difficulties such as complex to implement and slow convergence rate. In this paper an accelerating particle swarm optimization algorithm (APSO) is applied to generate test data for data-flow dependencies of a program guided by a new fitness function. APSO is used because of its capability of balancing in exploration and exploitation. A new fitness function is designed based on the concepts of dominance relations, weighted branch distance for APSO to guide the search direction. A set of benchmark programs and four modules of Krishna Institute of Engineering and Technology ERP system were taken for the experimental analysis. The experimental results show that the proposed APSO based approach performed significantly better than random search, genetic algorithm and PSO in enhancing the convergence speed.

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

  • Agarwal K, Pachauri A, Srivastava G (2008) Towards software test data generation using binary particle swarm optimization. Proc XXXII Natl Syst Conf NSC 2008:339–343

    Google Scholar 

  • Ahmed MA, Hermadi I (2007) GA-based multiple paths test data generator. Elsevier Comput Oper Res 35:3107–3124

    Article  Google Scholar 

  • Beizer B (1990) Software testing techniques, 2nd edn. Van Nostrand Reinhold Co., New York

    MATH  Google Scholar 

  • Ciuprina G, Ioan D, Munteanu I (2002) Use of intelligent-particle swarm optimization in electromagnetics. IEEE Trans Magn 38(2):1037–1040

    Article  Google Scholar 

  • Ghiduk AS, Harroldand MJ, Girgis MR (2007) Using genetic algorithms to aid test-data generation for data-flow coverage. In: Proceedings of IEEE 14th Asia-Pacific software engineering conference. pp 41–48

  • Girgis MR (2005) Automatic test data generation for data flow testing using a genetic algorithm. J Univ Comput Sci 11(6):898–915

    Google Scholar 

  • Goldberg DE (1989) “Genetic Algorithms in Search, Optimization and Machine Learning”, Pearson Education, Delhi, India

  • Harman M (2007) The current state and future of search based software engineering. In: Proceedings of the 29th international conference on software engineering, Minneapolis, USA

  • Harman M, McMinn P (2010) A theoretical and empirical study of search-based testing: local, global, and hybrid search. IEEE Trans Softw Eng 36(2):226–247

    Article  Google Scholar 

  • Jiang S, Shi J, Zhang Y, Han H (2015) Automatic test data generation based on reduced adaptive particle swarm optimization algorithm. Neurocomputing 158:109–116

    Article  Google Scholar 

  • Jones BF, Sthamer HH, Eyres DE (1996) Automated structural testing using genetic algorithms. Softw Eng J 11(5):299–306

    Article  Google Scholar 

  • Kennedy J, Eberhart RC (1995) Particle swam optimization. In: Proceedings of IEEE international conference on neural networks (ICNN’95), Australia, pp 1942–1948

  • Korel B (1990) Automated software test data generation. IEEE Trans Softw Eng 16(8):870–879

    Article  Google Scholar 

  • Kumar S, Yadav DK, Khan DA, Srivastava A (2015) A tool to generate all DU paths automatically. In: IEEE conference on computing for sustainable global development (INDIACom)

  • Lengauer T, Tarjan RE (1979) A fast algorithm for finding dominators in a flow graph. ACM Trans Progr Lang Syst 1(1):121–141

    Article  MATH  Google Scholar 

  • Li XD, Engelbrecht AP (2007) Particle swarm optimization: an introduction and its recent developments. In: Proceedings of the Genetic Evolutionary Computation Conference, pp 3391–3414

  • Liang JJ, Qin AK, Suganthan PN, Baskar S (2006) Comprehensive learning particle swarm optimizer for global optimization of multimodal functions. IEEE Trans Evol Comput 10(3):281–295

    Article  Google Scholar 

  • Mahajan M, Kumar S, Porwal R (2012) Applying genetic algorithm to increase the efficiency of a data flow—based test data generation approach. ACM SIGSOFT 37(5):1–5

    Article  Google Scholar 

  • Mao C (2014) Generating test data for software structural testing based on particle swarm optimization. Arab J Sci Eng 39:4593–4607

    Article  Google Scholar 

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

    Article  Google Scholar 

  • Nayak N, Mohapatra DP (2010) Automatic test data generation for data flow testing using particle swarm optimization. Springer, Heidelberg, pp 1–12

    MATH  Google Scholar 

  • Nickabadi A, Ebadzadeh MM, Safabakhsh R (2011) A novel particle swarm optimization algorithm with adaptive inertia weight. Appl Soft Comput 11:3658–3670

    Article  Google Scholar 

  • Pachauri A, Srivastava G (2013) Automated test data generation for branch testing using genetic algorithm: an improved approach using branch ordering, memory and elitism. J Syst Softw 86:1191–1208

    Article  Google Scholar 

  • Pargas RP, Harrold MJ, Peck R (1999) Test-data generation using genetic algorithms. J Softw Test Verif Reliab 9(4):263–282

    Article  Google Scholar 

  • Rapps S, Weyuker EJ (1985) Selecting software test data using data flow information. IEEE Trans Softw Eng 11(4):367–375

    Article  MATH  Google Scholar 

  • Varshney S, Mehrotra M (2013) Search based software test data generation for structural testing: a perspective. ACM SIGSOFT Softw Eng Notes 38(4):1–6

    Article  Google Scholar 

  • Varshney S, Mehrotra M (2014) Automated software test data generation for data flow dependencies using genetic algorithm. Int J Adv Res Comput Sci Softw Eng 4(2):472–479

    Google Scholar 

  • Varshney S, Mehrotra M (2015) An improved PSO-based test data generator for data flow coverage. Int J Appl Eng Res 10(55):2124–2129

    Google Scholar 

  • Vivanti M, Mis A, Gorlaand A, Fraser G (2013) Search-based data-flow test generation. In: IEEE international symposium on software reliability engineering (ISSRE), pp 370–379

  • Wegener J, Baresel A, Sthamer H (2001) Evolutionary test environment for automatic structural testing. Elsevier Inf Softw Technol 43(14):841–854

    Article  Google Scholar 

  • Windisch A, Wappler S, Wegener J (2007) Applying particle swarm optimization to software testing. In: Proceedings of the 9th annual conference on genetic and evolutionary computation (GECCO 07). pp 1121–1128

  • Zhan Z-H, Zhang J, Li Y, Chung HSH (2009) Adaptive particle swarm optimization. IEEE Trans Syst Man Cybern B Cybern 39(6):1362–1381

    Article  Google Scholar 

Download references

Acknowledgements

Funding was provided by Krishna Institute of Engineering and Technology.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Sumit Kumar.

Appendix 1: Case study on the calculation of fitness value

Appendix 1: Case study on the calculation of fitness value

Consider dpu-path# 13 (8, 11, 12) for ‘Equal roots’ condition. The two objectives to be covered by an input test case are the definition node 8 and the p-use edge (11, 12). Fitness value of the input test case is computed using Eqs. (7) and (8). The various test case scenarios are discussed below. The dominance paths of the nodes are:

$${\text{dom}}\left( 8 \right) = \left\{ {1,2,7,8} \right\}$$
$${\text{dom}}\left( {11} \right) = \left\{ {1,2,7,8,9,11} \right\}$$
$${\text{dom}}\left( {12} \right) = \left\{ {1,2,7,8,9,11,12} \right\}$$
  1. 1.

    Input test case t1 < 1, 4, 2>

Path traversed is {1, 2, 3, 5, 6, 7, 8, 9, 10, 13, 18, 19}

Dominance path of the def-node 8 is covered.

Dominance path of node 11 as well as node 12 of the p-use edgeis not covered. Branch distance for node 11 and node 12 at the critical node 9 is 0.125 (Eq. 10). Branch weight for node 11 and node 12 at the critical node 9 is 0.08958 (Table 5). Therefore wbd (x, t1) = branch distance * branch weight(wi) (Eq. 9).

$${\text{wbd }}\left( {11, \, t_{1} } \right) = {\text{wbd}}\left( {12,{\text{ t}}_{1} } \right) = 0.125*0.08958 = 0.0112.$$
$${\text{ft}}\left( {8, \, 11, \, 12,{\text{ t}}_{1} } \right) = 1/3*\left[ {\left( {1*1} \right) + \left( {\left( {5/6} \right)*0.0112} \right) + \left( {\left( {5/7} \right)*0.0112} \right)} \right] = 1/3*\left[ {1 + 0.00933 + 0.008} \right] = 1/3*1.01733 = 0.33911$$

The fitness value of test case t1 is ft (8, 11, 12, t1) = 0.33911 (Eq. 8)

  1. 2.

    Input test case t2 < 1, 2, 2>

Path traversed is {1, 2, 3, 5, 6, 7, 8, 9, 11, 13, 18, 19}

Dominance path of the def-node 8 is covered.

Dominance path of node 11 of the p-use edge is covered.

Dominance path of node 12 of the p-use edge is not covered; the critical node is node 11. Branch distance for node 12 at the critical node 11 is 0.25 (Eq. 3). Branch weight for node 12 at critical node 11 is 0.06204 (Table 5). Therefore wbd (x, t2) = branch distance * branch weight(wi) (Eq. 9).

$${\text{wbd}}\left( {12,{\text{t}}_{2} } \right) = 0.25*0.06204 = 0.01551$$
$${\text{ft}}\left( {8,11,12,{\text{t}}_{2} } \right) = 1/3*[\left( {1*1} \right) + \left( {1*1} \right) + \left( {\left( {6/7} \right)*0.01551} \right) = 1/3*2.01329 = 0.6711$$

The fitness value of test case t2 is ft (8, 11, 12, t2) = 0.6711 (Eq. 8).

  1. 3.

    Input test case t3 < 3, 6, 3>

Path traversed is {1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 18, 19}

Dominance path of the def-node 8 is covered.

Dominance path of node 11 of the p-use edge is covered.

Dominance path of node 12 of the p-use edge is covered.

Using Eq. (8), the fitness value of test case t3 is 1 (optimal test case).It can be seen that ft (8, 11, 12, t1) < ft (8, 11, 12, t2) < ft (8, 11, 12, t3). Thus, the input test cases are also ranked according to their fitness values.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Kumar, S., Yadav, D.K. & Khan, D.A. An accelerating PSO algorithm based test data generator for data-flow dependencies using dominance concepts. Int J Syst Assur Eng Manag 8 (Suppl 2), 1534–1552 (2017). https://doi.org/10.1007/s13198-017-0626-4

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s13198-017-0626-4

Keywords

Navigation