Practical Mutation Testing at Scale: A view from Google

被引:42
作者
Petrovic, Goran [1 ]
Ivankovic, Marko [1 ]
Fraser, Gordon [2 ]
Just, Rene [3 ]
机构
[1] Google LLC, CH-8002 Zurich, Switzerland
[2] Univ Passau, D-94032 Passau, Germany
[3] Univ Washington, Seattle, WA 98105 USA
关键词
Testing; Internet; Tools; Scalability; !text type='Python']Python[!/text; Productivity; Probabilistic logic; Mutation testing; code coverage; test efficacy; CLONE DETECTION; CODE;
D O I
10.1109/TSE.2021.3107634
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Mutation analysis assesses a test suite's adequacy by measuring its ability to detect small artificial faults, systematically seeded into the tested program. Mutation analysis is considered one of the strongest test-adequacy criteria. Mutation testing builds on top of mutation analysis and is a testing technique that uses mutants as test goals to create or improve a test suite. Mutation testing has long been considered intractable because the sheer number of mutants that can be created represents an insurmountable problem-both in terms of human and computational effort. This has hindered the adoption of mutation testing as an industry standard. For example, Google has a codebase of two billion lines of code and more than 150,000,000 tests are executed on a daily basis. The traditional approach to mutation testing does not scale to such an environment; even existing solutions to speed up mutation analysis are insufficient to make it computationally feasible at such a scale. To address these challenges, this paper presents a scalable approach to mutation testing based on the following main ideas: (1) mutation testing is done incrementally, mutating only changed code during code review, rather than the entire code base; (2) mutants are filtered, removing mutants that are likely to be irrelevant to developers, and limiting the number of mutants per line and per code review process; (3) mutants are selected based on the historical performance of mutation operators, further eliminating irrelevant mutants and improving mutant quality. This paper empirically validates the proposed approach by analyzing its effectiveness in a code-review-based setting, used by more than 24,000 developers on more than 1,000 projects. The results show that the proposed approach produces orders of magnitude fewer mutants and that context-based mutant filtering and selection improve mutant quality and actionability. Overall, the proposed approach represents a mutation testing framework that seamlessly integrates into the software development workflow and is applicable to industrial settings of any size.
引用
收藏
页码:3900 / 3912
页数:13
相关论文
共 42 条
[31]   An Industrial Application of Mutation Testing: Lessons, Challenges, and Research Directions [J].
Petrovic, Goran ;
Ivankovic, Marko ;
Kurtz, Bob ;
Ammann, Paul ;
Just, Rene .
2018 IEEE 11TH INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION WORKSHOPS (ICSTW), 2018, :47-53
[32]   Why Google Stores Billions of Lines of Code in a Single Repository [J].
Potvin, Rachel ;
Levenberg, Josh .
COMMUNICATIONS OF THE ACM, 2016, 59 (07) :78-87
[33]  
Roy Chanchal Kumar, 2007, Queen's School of Computing TR, V541, P64
[34]   Tricorder: Building a Program Analysis Ecosystem [J].
Sadowski, Caitlin ;
van Gogh, Jeffrey ;
Jaspan, Ciera ;
Soderberg, Emma ;
Winter, Collin .
2015 IEEE/ACM 37TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, VOL 1, 2015, :598-608
[35]  
Schuler D., 2011, Proceedings 2011 IEEE Fourth International Conference on Software Testing, Verification and Validation (ICST 2011), P90, DOI 10.1109/ICST.2011.32
[36]  
Schuler David, 2010, Proceedings of the Third IEEE International Conference on Software Testing, Verification and Validation (ICST 2010), P45, DOI 10.1109/ICST.2010.30
[37]   Hashing Tree-Structured Data: Methods and Applications [J].
Tatikonda, Shirish ;
Parthasarathy, Srinivasan .
26TH INTERNATIONAL CONFERENCE ON DATA ENGINEERING ICDE 2010, 2010, :429-440
[38]   What Makes Killing a Mutant Hard [J].
Visser, Willem .
2016 31ST IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE), 2016, :39-44
[39]  
Wahler V, 2004, FOURTH IEEE INTERNATIONAL WORKSHOP ON SOURCE CODE ANALYSIS AND MANIPULATION, PROCEEDINGS, P128
[40]  
WUU Y, 1991, SOFTWARE PRACT EXPER, V21, P739, DOI 10.1002/spe.4380210706