Skip to main content
Erschienen in: Empirical Software Engineering 3/2009

01.06.2009

On guiding the augmentation of an automated test suite via mutation analysis

verfasst von: Ben H. Smith, Laurie Williams

Erschienen in: Empirical Software Engineering | Ausgabe 3/2009

Einloggen

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

Mutation testing has traditionally been used as a defect injection technique to assess the effectiveness of a test suite as represented by a “mutation score.” Recently, mutation testing tools have become more efficient, and industrial usage of mutation analysis is experiencing growth. Mutation analysis entails adding or modifying test cases until the test suite is sufficient to detect as many mutants as possible and the mutation score is satisfactory. The augmented test suite resulting from mutation analysis may reveal latent faults and provides a stronger test suite to detect future errors which might be injected. Software engineers often look for guidance on how to augment their test suite using information provided by line and/or branch coverage tools. As the use of mutation analysis grows, software engineers will want to know how the emerging technique compares with and/or complements coverage analysis for guiding the augmentation of an automated test suite. Additionally, software engineers can benefit from an enhanced understanding of efficient mutation analysis techniques. To address these needs for additional information about mutation analysis, we conducted an empirical study of the use of mutation analysis on two open source projects. Our results indicate that a focused effort on increasing mutation score leads to a corresponding increase in line and branch coverage to the point that line coverage, branch coverage and mutation score reach a maximum but leave some types of code structures uncovered. Mutation analysis guides the creation of additional “common programmer error” tests beyond those written to increase line and branch coverage. We also found that 74% of our chosen set of mutation operators is useful, on average, for producing new tests. The remaining 26% of mutation operators did not produce new test cases because their mutants were immediately detected by the initial test suite, indirectly detected by test suites we added to detect other mutants, or were not able to be detected by any test.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

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!

Fußnoten
6
Stubborn mutants are more clearly defined as those living mutants that may or may not be equivalent to the original source code. Sometimes, a mutant remains alive and yet cannot be feasibly proven equivalent through formal analysis (Hierons et al. 1999).
 
9
LoC is every line within the Java implementation code file which is not 1) blank or 2) a comment. LoC calculated using NLOC: http://​nloc.​sourceforge.​net/​. Methods refers to public, private, protected, static methods and constructors. Fields refers to public, private, protected and static local variables (declared within the class definition).
 
13
djUnit does not calculate branch coverage in the conventional way. Consider the following example: https://static-content.springer.com/image/art%3A10.1007%2Fs10664-008-9083-7/MediaObjects/10664_2008_9083_Figc_HTML.gif The branch in the sample is line 2. Depending upon the value of (a = = 3), the code can proceed to line 3 or line 5. Therefore, there are three lines of code involved in this branch. If the test case involves (a = = 3) evaluating to false, then lines 2 and 5 are executed and line 3 is not. In this case djUnit computes the branch coverage as 2/3 because 2 of the 3 lines involved in the branch have been executed.
 
14
Unless otherwise stated, “HtmlParser” means the sum for StringBean, Attribute and Parser, and iTrust means the sum for Auth, Demographics and Transactions across teams A-D.
 
Literatur
Zurück zum Zitat Alexander RT, Bieman JM, Ghosh S, Bixia J (2002) Mutation of Java objects. 13th International Symposium on Software Reliability Engineering, Fort Collins, CO USA, pp 341–351 Alexander RT, Bieman JM, Ghosh S, Bixia J (2002) Mutation of Java objects. 13th International Symposium on Software Reliability Engineering, Fort Collins, CO USA, pp 341–351
Zurück zum Zitat Andrews JH, Briand LC, Labiche Y (2005) Is mutation an appropriate tool for testing experiments? 27th International Conference on Software Engineering, St. Louis, MO, USA, pp 402–411 Andrews JH, Briand LC, Labiche Y (2005) Is mutation an appropriate tool for testing experiments? 27th International Conference on Software Engineering, St. Louis, MO, USA, pp 402–411
Zurück zum Zitat Andrews JH, Briand LC, Labiche Y, Namin AS (2006) Using mutation analysis for assessing and comparing testing coverage criteria. Software Engineering. IEEE Trans 32(8):608–624 Andrews JH, Briand LC, Labiche Y, Namin AS (2006) Using mutation analysis for assessing and comparing testing coverage criteria. Software Engineering. IEEE Trans 32(8):608–624
Zurück zum Zitat DeMillo RA, Guindi DS, McCracken WM, Offutt AJ, King KN (1988) An extended overview of the Mothra software testing environment. Proceedings of the Second Workshop on Software Testing, Verification, and Analysis, Banff, Alta., Canada, pp 142–151 DeMillo RA, Guindi DS, McCracken WM, Offutt AJ, King KN (1988) An extended overview of the Mothra software testing environment. Proceedings of the Second Workshop on Software Testing, Verification, and Analysis, Banff, Alta., Canada, pp 142–151
Zurück zum Zitat Gamma E, Helm R, Johnson R, Vlissides J (1995) Design patterns: elements of reusable object-oriented software. Addison-Wesley Longman, Boston, MA, USA Gamma E, Helm R, Johnson R, Vlissides J (1995) Design patterns: elements of reusable object-oriented software. Addison-Wesley Longman, Boston, MA, USA
Zurück zum Zitat Hierons RM, Harman M, Danicic S (1999) Using program slicing to assist in the detection of equivalent mutants. Softw Test Verif Reliab 9(4):233–262CrossRef Hierons RM, Harman M, Danicic S (1999) Using program slicing to assist in the detection of equivalent mutants. Softw Test Verif Reliab 9(4):233–262CrossRef
Zurück zum Zitat Hovemeyer D, Pugh W (2004) Finding bugs is easy. ACM SIGPLAN Not 39(12):92–106CrossRef Hovemeyer D, Pugh W (2004) Finding bugs is easy. ACM SIGPLAN Not 39(12):92–106CrossRef
Zurück zum Zitat IEEE (1990) IEEE Standard 610.12–1990, IEEE Standard Glossary of Software Engineering Terminology IEEE (1990) IEEE Standard 610.12–1990, IEEE Standard Glossary of Software Engineering Terminology
Zurück zum Zitat Irvine SA, Pavlinic T, Trigg L, Cleary JG, Inglis S, Utting M (2007) Jumble Java byte code to measure the effectiveness of unit tests. Testing: Academic and Industrial Conference Practice and Research Techniques-MUTATION, 2007. TAICPART-MUTATION 2007, pp 169–175 Irvine SA, Pavlinic T, Trigg L, Cleary JG, Inglis S, Utting M (2007) Jumble Java byte code to measure the effectiveness of unit tests. Testing: Academic and Industrial Conference Practice and Research Techniques-MUTATION, 2007. TAICPART-MUTATION 2007, pp 169–175
Zurück zum Zitat Kaner C (1996) Software negligence and testing coverage. Proceedings of STAR, Orlando, FL, pp 1–13 Kaner C (1996) Software negligence and testing coverage. Proceedings of STAR, Orlando, FL, pp 1–13
Zurück zum Zitat Krishnamurthy S, Mathur A (1996) On predicting reliability of modules using code coverage. Proceedings of the 1996 conference of the Centre for Advanced Studies on Collaborative research, Toronto, Ontario, Canada, pp 1–12 Krishnamurthy S, Mathur A (1996) On predicting reliability of modules using code coverage. Proceedings of the 1996 conference of the Centre for Advanced Studies on Collaborative research, Toronto, Ontario, Canada, pp 1–12
Zurück zum Zitat Ma YS, Harrold MJ, Kwon YR (2006) Evaluation of mutation testing for object-oriented programs. 28th International Conference on Software Engineering, Shanghai, China, pp 869–872 Ma YS, Harrold MJ, Kwon YR (2006) Evaluation of mutation testing for object-oriented programs. 28th International Conference on Software Engineering, Shanghai, China, pp 869–872
Zurück zum Zitat Murnane T, Reed K, Assoc T, Carlton V (2001) On the effectiveness of mutation analysis as a black box testing technique. Software Engineering Conference, Canberra, ACT, Australia, pp 12–20 Murnane T, Reed K, Assoc T, Carlton V (2001) On the effectiveness of mutation analysis as a black box testing technique. Software Engineering Conference, Canberra, ACT, Australia, pp 12–20
Zurück zum Zitat Namin AS, Andrews JH (2006) Finding sufficient mutation operators via variable reduction. Mutation Analysis, 2006. Second Workshop on, pp 5–5 Namin AS, Andrews JH (2006) Finding sufficient mutation operators via variable reduction. Mutation Analysis, 2006. Second Workshop on, pp 5–5
Zurück zum Zitat Offutt J, Lee A, Rothermel G, Untch RH, Zapf C (1996a) An experimental determination of sufficient mutant operators. ACM Trans Softw Eng Methodol 5(2):99–118CrossRef Offutt J, Lee A, Rothermel G, Untch RH, Zapf C (1996a) An experimental determination of sufficient mutant operators. ACM Trans Softw Eng Methodol 5(2):99–118CrossRef
Zurück zum Zitat Offutt J, Pan J, Tewary K, Zhang T (1996b) An experimental evaluation of data flow and mutation testing. Softw Pract Exp 26(2):165–176CrossRef Offutt J, Pan J, Tewary K, Zhang T (1996b) An experimental evaluation of data flow and mutation testing. Softw Pract Exp 26(2):165–176CrossRef
Zurück zum Zitat Offutt J, Ma YS, Kwon YR (2004) An experimental mutation system for Java. ACM SIGSOFT Softw Eng Notes 29(5):1–4 Offutt J, Ma YS, Kwon YR (2004) An experimental mutation system for Java. ACM SIGSOFT Softw Eng Notes 29(5):1–4
Zurück zum Zitat Offutt J, Ma YS, Kwon YR (2006) The class-level mutants of MuJava. International Workshop on Automation of Software Testing, Shanghai, China, pp 78–84 Offutt J, Ma YS, Kwon YR (2006) The class-level mutants of MuJava. International Workshop on Automation of Software Testing, Shanghai, China, pp 78–84
Zurück zum Zitat Smith BH, Williams L (2007) An empirical evaluation of the MuJava mutation operators. Testing: Academic and Industrial Conference Practice and Research Techniques-MUTATION, 2007, Windsor, UK, pp 193–202 Smith BH, Williams L (2007) An empirical evaluation of the MuJava mutation operators. Testing: Academic and Industrial Conference Practice and Research Techniques-MUTATION, 2007, Windsor, UK, pp 193–202
Zurück zum Zitat Voas J, Miller KW (1995) Using fault-injection to assess software engineering standards. Second IEEE International Software Engineering Standards Symposium ‘Experience and Practice’, Montreal, Que., Canada, pp 318–336 Voas J, Miller KW (1995) Using fault-injection to assess software engineering standards. Second IEEE International Software Engineering Standards Symposium ‘Experience and Practice’, Montreal, Que., Canada, pp 318–336
Zurück zum Zitat Zhu H, Hall PAV, May JHR (1997) Software unit test coverage and adequacy. ACM Comput Surv 29(4):366–427CrossRef Zhu H, Hall PAV, May JHR (1997) Software unit test coverage and adequacy. ACM Comput Surv 29(4):366–427CrossRef
Metadaten
Titel
On guiding the augmentation of an automated test suite via mutation analysis
verfasst von
Ben H. Smith
Laurie Williams
Publikationsdatum
01.06.2009
Verlag
Springer US
Erschienen in
Empirical Software Engineering / Ausgabe 3/2009
Print ISSN: 1382-3256
Elektronische ISSN: 1573-7616
DOI
https://doi.org/10.1007/s10664-008-9083-7

Weitere Artikel der Ausgabe 3/2009

Empirical Software Engineering 3/2009 Zur Ausgabe