Skip to main content
Top
Published in: Empirical Software Engineering 6/2021

01-11-2021

A pragmatic approach for hyper-parameter tuning in search-based test case generation

Authors: Shayan Zamani, Hadi Hemmati

Published in: Empirical Software Engineering | Issue 6/2021

Log in

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Search-based test case generation, which is the application of meta-heuristic search for generating test cases, has been studied a lot in the literature, lately. Since, in theory, the performance of meta-heuristic search methods is highly dependent on their hyper-parameters, there is a need to study hyper-parameter tuning in this domain. In this paper, we propose a new metric (“Tuning Gain”), which estimates how cost-effective tuning a particular class is. We then predict “Tuning Gain” using static features of source code classes. Finally, we prioritize classes for tuning, based on the estimated “Tuning Gains” and spend the tuning budget only on the highly-ranked classes. To evaluate our approach, we exhaustively analyze 1,200 hyper-parameter configurations of a well-known search-based test generation tool (EvoSuite) for 250 classes of 19 projects from benchmarks such as SF110 and SBST2018 tool competition. We used a tuning approach called Meta-GA and compared the tuning results with and without the proposed class prioritization. The results show that for a low tuning budget, prioritizing classes outperforms the alternatives in terms of extra covered branches (10 times more than a traditional global tuning). In addition, we report the impact of different features of our approach such as search space size, tuning budgets, tuning algorithms, and the number of classes to tune, on the final results.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Literature
go back to reference Harman M, Jones BF (2001) Search-based software engineering. Inf Softw Technol 43(14):833–839CrossRef Harman M, Jones BF (2001) Search-based software engineering. Inf Softw Technol 43(14):833–839CrossRef
go back to reference McMinn P (2004) Search-based software test data generation: a survey: research articles. Softw Test Verif Reliab 14(2):105–156CrossRef McMinn P (2004) Search-based software test data generation: a survey: research articles. Softw Test Verif Reliab 14(2):105–156CrossRef
go back to reference Fraser G, Arcuri A (2011) EvoSuite: automatic test suite generation for object-oriented software. In: Proceedings of the 19th ACM SIGSOFT symposium and the 13th european conference on foundations of software engineering. ACM Fraser G, Arcuri A (2011) EvoSuite: automatic test suite generation for object-oriented software. In: Proceedings of the 19th ACM SIGSOFT symposium and the 13th european conference on foundations of software engineering. ACM
go back to reference Freisleben B, Härtfelder M (1993) Optimization of genetic algorithms by genetic algorithms. In: Artificial neural nets and genetic algorithms. Springer, Vienna, pp 392–399 Freisleben B, Härtfelder M (1993) Optimization of genetic algorithms by genetic algorithms. In: Artificial neural nets and genetic algorithms. Springer, Vienna, pp 392–399
go back to reference Arcuri A, Fraser G (2013) Parameter tuning or default values? An empirical investigation in search-based software engineering. Empir Softw Eng 18 (3):594–623CrossRef Arcuri A, Fraser G (2013) Parameter tuning or default values? An empirical investigation in search-based software engineering. Empir Softw Eng 18 (3):594–623CrossRef
go back to reference Fraser G, Rojas JM (2018) Software testing. In: Cha S, Taylor RN, Kang KC (eds) Handbook of software engineering. Springer International Publishing Fraser G, Rojas JM (2018) Software testing. In: Cha S, Taylor RN, Kang KC (eds) Handbook of software engineering. Springer International Publishing
go back to reference Grefenstette J (1986) Optimization of control parameters for genetic algorithms. IEEE Trans Syst Man Cybern 16(1):22–128CrossRef Grefenstette J (1986) Optimization of control parameters for genetic algorithms. IEEE Trans Syst Man Cybern 16(1):22–128CrossRef
go back to reference Burke EK, Hyde MR, Kendall G, Ochoa G, Ozcan E, Woodward JR (2009) Exploring hyper-heuristic methodologies with genetic programming. In: Computational intelligence: collaboration, fusion and emergence. Springer, Berlin, pp 177–201 Burke EK, Hyde MR, Kendall G, Ochoa G, Ozcan E, Woodward JR (2009) Exploring hyper-heuristic methodologies with genetic programming. In: Computational intelligence: collaboration, fusion and emergence. Springer, Berlin, pp 177–201
go back to reference Crawford B, Soto R, Monfroy E, Palma W, Castro C, Paredes F (2013) Parameter tuning of a choice-function based hyperheuristic using particle swarm optimization, vol 40, pp 1690–1695 Crawford B, Soto R, Monfroy E, Palma W, Castro C, Paredes F (2013) Parameter tuning of a choice-function based hyperheuristic using particle swarm optimization, vol 40, pp 1690–1695
go back to reference Craenen BGW, Eiben AE (2001) Stepwise adaption of weights with refinement and decay on constraint satisfaction problems. In: Proceedings of the 3rd annual conference on genetic and evolutionary computation. Morgan Kaufmann Publishers Inc., pp 291–298 Craenen BGW, Eiben AE (2001) Stepwise adaption of weights with refinement and decay on constraint satisfaction problems. In: Proceedings of the 3rd annual conference on genetic and evolutionary computation. Morgan Kaufmann Publishers Inc., pp 291–298
go back to reference Feldt R, Nordin P (2000) Using factorial experiments to evaluate the effect of genetic programming parameters. In: Proceedings of the European conference on genetic programming. Springer, pp 271–282 Feldt R, Nordin P (2000) Using factorial experiments to evaluate the effect of genetic programming parameters. In: Proceedings of the European conference on genetic programming. Springer, pp 271–282
go back to reference Grano G, Titov TV, Panichella S, Gall HC (2019) Branch coverage prediction in automated testing. J Softw Evol Process 31(9):e2158CrossRef Grano G, Titov TV, Panichella S, Gall HC (2019) Branch coverage prediction in automated testing. J Softw Evol Process 31(9):e2158CrossRef
go back to reference Xu X, Zhu Z, Jiao L (2017) An adaptive fitness function based on branch hardness for search based testing. In: Proceedings of the genetic and evolutionary computation Conference. GECCO ’17. ACM, Berlin, pp 1335–1342 Xu X, Zhu Z, Jiao L (2017) An adaptive fitness function based on branch hardness for search based testing. In: Proceedings of the genetic and evolutionary computation Conference. GECCO ’17. ACM, Berlin, pp 1335–1342
go back to reference Ferrer J, Chicano F, Alba E (2013) Estimating software testing complexity. Inf Softw Technol 55(12):2125–2139CrossRef Ferrer J, Chicano F, Alba E (2013) Estimating software testing complexity. Inf Softw Technol 55(12):2125–2139CrossRef
go back to reference Zamani S, Hemmati H (2019) Revisiting hyper-parameter tuning for search-based test data generation. In: Nejati Shiva, Gay Gregory (eds) Search-based software engineering. Springer International Publishing, Cham, pp 137–152 Zamani S, Hemmati H (2019) Revisiting hyper-parameter tuning for search-based test data generation. In: Nejati Shiva, Gay Gregory (eds) Search-based software engineering. Springer International Publishing, Cham, pp 137–152
go back to reference Harman M (2007) The current state and future of search based software engineering. In: Future of software engineering (FOSE ’07), pp 342–357 Harman M (2007) The current state and future of search based software engineering. In: Future of software engineering (FOSE ’07), pp 342–357
go back to reference Sakti A, Pesant G, Guéhéneuc Y-G (2014) Instance generator and problem representation to improve object oriented code coverage, vol 41, pp 294–313 Sakti A, Pesant G, Guéhéneuc Y-G (2014) Instance generator and problem representation to improve object oriented code coverage, vol 41, pp 294–313
go back to reference Oster N, Saglietti F (2006) Automatic test data generation by multi-objective optimisation conference=Proceedings of the 25th international conference on computer, safety, reliability, and security. SAFECOMP’06. https://doi.org/10.1007/1187556732. Springer, Gdansk, pp 426–438 Oster N, Saglietti F (2006) Automatic test data generation by multi-objective optimisation conference=Proceedings of the 25th international conference on computer, safety, reliability, and security. SAFECOMP’06. https://​doi.​org/​10.​1007/​1187556732. Springer, Gdansk, pp 426–438
go back to reference Eiben ÁE, Hinterding R, Michalewicz Z (1999) Parameter control in evolutionary algorithms, vol 3, pp 124–141 Eiben ÁE, Hinterding R, Michalewicz Z (1999) Parameter control in evolutionary algorithms, vol 3, pp 124–141
go back to reference Bergstra J, Bardenet R, Bengio Y, Kégl B (2011). In: Proceedings of the 24th international conference on neural information processing systems. NIPS’11. Curran Associates Inc., Granada, pp 2546–2554 Bergstra J, Bardenet R, Bengio Y, Kégl B (2011). In: Proceedings of the 24th international conference on neural information processing systems. NIPS’11. Curran Associates Inc., Granada, pp 2546–2554
go back to reference Tantithamthavorn C, McIntosh S, Hassan AE, Matsumoto K (2016) Automated parameter optimization of classification techniques for defect prediction models. In: Proceedings of the 38th international conference on software engineering, pp 321–332 Tantithamthavorn C, McIntosh S, Hassan AE, Matsumoto K (2016) Automated parameter optimization of classification techniques for defect prediction models. In: Proceedings of the 38th international conference on software engineering, pp 321–332
go back to reference Bergstra J, Bengio Y (2012) Random search for hyper parameter optimization. J Mach Learn Res 13(null):281–305MathSciNetMATH Bergstra J, Bengio Y (2012) Random search for hyper parameter optimization. J Mach Learn Res 13(null):281–305MathSciNetMATH
go back to reference Goldberg DE (2006) Genetic algorithms. Pearson Education India, Bengaluru Goldberg DE (2006) Genetic algorithms. Pearson Education India, Bengaluru
go back to reference Kirkpatrick S, Daniel Gelatt C, Vecchi MP (1983) Optimization by simulated annealing, vol 220, pp 671–680 Kirkpatrick S, Daniel Gelatt C, Vecchi MP (1983) Optimization by simulated annealing, vol 220, pp 671–680
go back to reference Pelikan M, Goldberg DE, Cantú-Paz E et al (1999) BOA: The Bayesian optimization algorithm. In: Proceedings of the genetic and evolutionary computation conference GECCO-99. volume= 1,. Citeseer, pp 525–532 Pelikan M, Goldberg DE, Cantú-Paz E et al (1999) BOA: The Bayesian optimization algorithm. In: Proceedings of the genetic and evolutionary computation conference GECCO-99. volume= 1,. Citeseer, pp 525–532
go back to reference van Stein B, Wang H, Bäck T. (2019) Automatic configuration of deep neural networks with parallel efficient global optimization. In: 2019 international joint conference on neural networks (IJCNN). IEEE, pp 1–7 van Stein B, Wang H, Bäck T. (2019) Automatic configuration of deep neural networks with parallel efficient global optimization. In: 2019 international joint conference on neural networks (IJCNN). IEEE, pp 1–7
go back to reference Agrawal A, Menzies T (2018) Is “better data” better than “better data miners”? on the benefits of tuning SMOTE for defect prediction. In: Proceedings of the 40th international conference on software engineering. ICSE ’18. Association for Computing Machinery, Gothenburg. https://doi.org/10.1145/3180155.3180197, pp 1050–1061 Agrawal A, Menzies T (2018) Is “better data” better than “better data miners”? on the benefits of tuning SMOTE for defect prediction. In: Proceedings of the 40th international conference on software engineering. ICSE ’18. Association for Computing Machinery, Gothenburg. https://​doi.​org/​10.​1145/​3180155.​3180197, pp 1050–1061
go back to reference Agrawal A, Fu W, Menzies T (2018) What is wrong with topic modeling? And how to fix it using search-based software engineering. https://www.sciencedirect.com/science/article/pii/S0950584917300861, vol 98, pp 74–88, DOI https://doi.org/10.1016/j.infsof.2018.02.005 Agrawal A, Fu W, Menzies T (2018) What is wrong with topic modeling? And how to fix it using search-based software engineering. https://​www.​sciencedirect.​com/​science/​article/​pii/​S095058491730086​1, vol 98, pp 74–88, DOI https://​doi.​org/​10.​1016/​j.​infsof.​2018.​02.​005
go back to reference Chen D, Fu W, Krishna R, Menzies T (2018) Applications of psychological science for actionable analytics. In: Proceedings of the 2018 26th ACM joint meeting on european software engineering conference and symposium on the foundations of software engineering. ESEC/FSE 2018. Association for Computing Machinery, Lake Buena Vista. https://doi.org/10.1145/3236024.3236050, pp 456–467 Chen D, Fu W, Krishna R, Menzies T (2018) Applications of psychological science for actionable analytics. In: Proceedings of the 2018 26th ACM joint meeting on european software engineering conference and symposium on the foundations of software engineering. ESEC/FSE 2018. Association for Computing Machinery, Lake Buena Vista. https://​doi.​org/​10.​1145/​3236024.​3236050, pp 456–467
go back to reference Birattari M (2009) Tuning metaheuristics: a machine learning perspective, 1st edn. Springer Publishing Company, Incorporated, Berlin. 2nd printingCrossRef Birattari M (2009) Tuning metaheuristics: a machine learning perspective, 1st edn. Springer Publishing Company, Incorporated, Berlin. 2nd printingCrossRef
go back to reference Myers RH, Montgomery DC (1995) Response surface methodology: process and product in optimization using designed experiments, 1st edn. Wiley, HobokenMATH Myers RH, Montgomery DC (1995) Response surface methodology: process and product in optimization using designed experiments, 1st edn. Wiley, HobokenMATH
go back to reference Sayyad AS, Goseva-Popstojanova K, Menzies T, Ammar H (2013) On parameter tuning in search based software engineering: a replicated empirical study. In: Proceedings of workshop on replication in empirical software engineering. IEEE Computer Society Sayyad AS, Goseva-Popstojanova K, Menzies T, Ammar H (2013) On parameter tuning in search based software engineering: a replicated empirical study. In: Proceedings of workshop on replication in empirical software engineering. IEEE Computer Society
go back to reference Kotelyanskii A, Kapfhammer GM (2014) Parameter tuning for search-based test-data generation revisited: support for previous results. In: Proceedings of the 2014 14th international conference on quality software. IEEE Computer Society, pp 79–84 Kotelyanskii A, Kapfhammer GM (2014) Parameter tuning for search-based test-data generation revisited: support for previous results. In: Proceedings of the 2014 14th international conference on quality software. IEEE Computer Society, pp 79–84
go back to reference Song L, Minku LL, Yao X (2013) The impact of parameter tuning on software effort estimation using learning machines. In: Proceedings of the 9th international conference on predictive models in software engineering. ACM, pp 9:1–9:10 Song L, Minku LL, Yao X (2013) The impact of parameter tuning on software effort estimation using learning machines. In: Proceedings of the 9th international conference on predictive models in software engineering. ACM, pp 9:1–9:10
go back to reference Fu W, Menzies T, Shen X (2016) Tuning for software analytics: Is it really necessary?. Inf Softw Technol 76:135–146CrossRef Fu W, Menzies T, Shen X (2016) Tuning for software analytics: Is it really necessary?. Inf Softw Technol 76:135–146CrossRef
go back to reference Wang T, Harman M, Jia Y, Krinke J (2013) Searching for better configurations: a rigorous approach to clone evaluation. In: Proceedings of the 2013 9th joint meeting on foundations of software engineering. ACM, pp 455–465 Wang T, Harman M, Jia Y, Krinke J (2013) Searching for better configurations: a rigorous approach to clone evaluation. In: Proceedings of the 2013 9th joint meeting on foundations of software engineering. ACM, pp 455–465
go back to reference Panichella A, Dit B, Oliveto R, Di Penta M, Poshynanyk D, De Lucia A (2013) How to effectively use topic models for software engineering tasks? an approach based on genetic algorithms. In: 2013 35th international conference on software engineering (ICSE). IEEE, pp 522–531 Panichella A, Dit B, Oliveto R, Di Penta M, Poshynanyk D, De Lucia A (2013) How to effectively use topic models for software engineering tasks? an approach based on genetic algorithms. In: 2013 35th international conference on software engineering (ICSE). IEEE, pp 522–531
go back to reference Zhang Y, Harman M, Ochoa G, Ruhe G, Brinkkemper S (2018) An empirical study of meta and hyper-heuristic search for multi-objective release planning. ACM Trans Softw Eng Methodol 27(1), DOI https://doi.org/10.1145/3196831, (to appear in print) Zhang Y, Harman M, Ochoa G, Ruhe G, Brinkkemper S (2018) An empirical study of meta and hyper-heuristic search for multi-objective release planning. ACM Trans Softw Eng Methodol 27(1), DOI https://​doi.​org/​10.​1145/​3196831, (to appear in print)
go back to reference Smit SK, Eiben AE (2009) Comparing parameter tuning methods for evolutionary algorithms Smit SK, Eiben AE (2009) Comparing parameter tuning methods for evolutionary algorithms
go back to reference McCabe TJ (1976) A complexity measure, vol 2, pp 308–320 McCabe TJ (1976) A complexity measure, vol 2, pp 308–320
go back to reference Fraser G, Arcuri A (2014) A large-scale evaluation of automated unit test generation using EvoSuite. ACM Trans Softw Eng Methodol 24(2):8:1–8:42CrossRef Fraser G, Arcuri A (2014) A large-scale evaluation of automated unit test generation using EvoSuite. ACM Trans Softw Eng Methodol 24(2):8:1–8:42CrossRef
go back to reference Panichella A, Kifetew F, Tonella P (2017) Automated test case generation as a many-objective optimisation problem with dynamic selection of the targets. IEEE Trans Softw Eng 44(2):122–158CrossRef Panichella A, Kifetew F, Tonella P (2017) Automated test case generation as a many-objective optimisation problem with dynamic selection of the targets. IEEE Trans Softw Eng 44(2):122–158CrossRef
go back to reference Rueda Molina U, Kifetew F, Panichella A (2018) Java unit testing tool competition - sixth round. In: 2018 IEEE/ACM 11th international workshop on search-based software testing (SBST), pp 22–29 Rueda Molina U, Kifetew F, Panichella A (2018) Java unit testing tool competition - sixth round. In: 2018 IEEE/ACM 11th international workshop on search-based software testing (SBST), pp 22–29
go back to reference Fraser G, Arcuri A (2013) Whole test suite generation, vol 39, pp 276–291 Fraser G, Arcuri A (2013) Whole test suite generation, vol 39, pp 276–291
go back to reference Guyon I, Elisseeff A (2006) An introduction to feature extraction. In: Guyon by Isabelle, Nikravesh Masoud, Gunn Steve, Zadeh LA (eds) Feature extraction: foundations and applications. Springer, Berlin, pp 1–25 Guyon I, Elisseeff A (2006) An introduction to feature extraction. In: Guyon by Isabelle, Nikravesh Masoud, Gunn Steve, Zadeh LA (eds) Feature extraction: foundations and applications. Springer, Berlin, pp 1–25
go back to reference Paterson D, Turner J, White T, Fraser G (2015) Parameter control in search-based generation of unit test suites. In: Barros M, Labiche Y (eds) Search-based software engineering. Springer International Publishing, Cham, pp 141–156. Title Suppressed Due to Excessive Length 43 Paterson D, Turner J, White T, Fraser G (2015) Parameter control in search-based generation of unit test suites. In: Barros M, Labiche Y (eds) Search-based software engineering. Springer International Publishing, Cham, pp 141–156. Title Suppressed Due to Excessive Length 43
go back to reference Price K, Storn RM, Lampinen JA (2006) Differential evolution: a practical approach to global optimization. Springer Science and Business Media, BerlinMATH Price K, Storn RM, Lampinen JA (2006) Differential evolution: a practical approach to global optimization. Springer Science and Business Media, BerlinMATH
go back to reference Vassilev VK, Fogarty TC, Miller JF (2003) Smoothness, ruggedness and neutrality of fitness landscapes: from theory to application. In: Ghosh A, Tsutsui S (eds) Advances in evolutionary computing: theory and applications. Springer, Berlin, pp 3–44. https://doi.org/10.1007/978-3-642-18965-41 Vassilev VK, Fogarty TC, Miller JF (2003) Smoothness, ruggedness and neutrality of fitness landscapes: from theory to application. In: Ghosh A, Tsutsui S (eds) Advances in evolutionary computing: theory and applications. Springer, Berlin, pp 3–44. https://​doi.​org/​10.​1007/​978-3-642-18965-41
go back to reference Pedregosa F, Varoquaux G, Gramfort A, Michel V, Thirion B, Grisel O, Blondel M, Prettenhofer P, Weiss R, Dubourg V, Vanderplas J, Passos A, Cournapeau D, Brucher M, Perrot M, Duchesnay E (2011) Scikit-learn: Machine Learning in Python. J Mach Learn Res 12:2825–2830MathSciNetMATH Pedregosa F, Varoquaux G, Gramfort A, Michel V, Thirion B, Grisel O, Blondel M, Prettenhofer P, Weiss R, Dubourg V, Vanderplas J, Passos A, Cournapeau D, Brucher M, Perrot M, Duchesnay E (2011) Scikit-learn: Machine Learning in Python. J Mach Learn Res 12:2825–2830MathSciNetMATH
Metadata
Title
A pragmatic approach for hyper-parameter tuning in search-based test case generation
Authors
Shayan Zamani
Hadi Hemmati
Publication date
01-11-2021
Publisher
Springer US
Published in
Empirical Software Engineering / Issue 6/2021
Print ISSN: 1382-3256
Electronic ISSN: 1573-7616
DOI
https://doi.org/10.1007/s10664-021-10024-2

Other articles of this Issue 6/2021

Empirical Software Engineering 6/2021 Go to the issue

Premium Partner