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 条
[1]   Establishing Theoretical Minimal Sets of Mutants [J].
Ammann, Paul ;
Delamaro, Marcio E. ;
Offutt, Jeff .
2014 IEEE SEVENTH INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION (ICST), 2014, :21-30
[2]   Using mutation analysis for assessing and comparing testing coverage criteria [J].
Andrews, James H. ;
Briand, Lionel C. ;
Labiche, Yvan ;
Namin, Akbar Siami .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2006, 32 (08) :608-624
[3]  
[Anonymous], REAL WORLD MUTATION
[4]  
[Anonymous], GOOGLE STYLE GUIDES
[5]  
[Anonymous], 2015, BAZEL BUILD SYSTEM
[6]  
[Anonymous], 2014, P 23 INT S SOFTW TES, DOI 10.1145/2610384.2628053
[7]  
Bacchelli A, 2013, PROCEEDINGS OF THE 35TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2013), P712, DOI 10.1109/ICSE.2013.6606617
[8]   Clone detection using abstract syntax trees [J].
Baxter, ID ;
Yahin, A ;
Moura, L ;
Sant'Anna, M ;
Bier, L .
INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE, PROCEEDINGS, 1998, :368-377
[9]   Min-wise independent permutations [J].
Broder, AZ ;
Charikar, M ;
Frieze, AM ;
Mitzenmacher, M .
JOURNAL OF COMPUTER AND SYSTEM SCIENCES, 2000, 60 (03) :630-659
[10]   Revisiting the Relationship Between Fault Detection, Test Adequacy Criteria, and Test Set Size [J].
Chen, Yiqun T. ;
Gopinath, Rahul ;
Tadakamalla, Anita ;
Ernst, Michael D. ;
Holmes, Reid ;
Fraser, Gordon ;
Ammann, Paul ;
Just, Rene .
2020 35TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2020), 2020, :237-249