Formal Analysis of Reachability, Infection and Propagation Conditions in Mutation Testing

Seyed-Hassan Mirian-Hosseinabadi
2024-10-29
Abstract:Finding test cases to kill the alive mutants in Mutation testing needs to calculate the Reachability, Infection and Propagation(RIP) conditions and full test specification. In this paper, a formal approach to calculate RIP conditions is proposed. The Dijkestra's weakest precondition predicate transformer (wp(_,_)) is used to calculate infection and propagation conditions. The rc(_) function is defined to calculate the reachability conditions generated by each statement. Four programs and their mutants are examined as running examples and as case studies to show the applicability of the method.
Software Engineering
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: in Mutation Testing, finding test cases that can kill surviving mutants requires calculating the Reachability, Infection, and Propagation (RIP for short) conditions as well as the complete test specification. However, currently, there is a lack of a formal method in the literature to calculate these RIP conditions. ### Specific Problem Description 1. **Background of Mutation Testing** - Mutation testing is a method for evaluating the quality of test cases. It detects potential errors in a program by generating and attempting to kill mutants. - When the original test cases fail to kill all mutants, testers need to analyze the RIP conditions to find new test cases to kill these surviving mutants. 2. **Limitations of Existing Methods** - Currently, although there are literatures that discuss the concept of RIP conditions and use them to automatically generate test cases or prove the correctness of programs, most of these methods are informal. - There is a lack of a unified and formal method to calculate RIP conditions, especially when dealing with complex program structures. 3. **Research Objectives** - Propose a formal method to calculate RIP conditions, thereby helping testers generate test cases that can kill mutants more effectively. - Use Dijkstra's weakest precondition predicate transformer (wp(|,|)) to calculate the infection and propagation conditions. - Define a new function `rc(||)` to calculate the reachability conditions generated by each statement. ### Main Contributions of the Paper - **Formalizing the Calculation of RIP Conditions**: By introducing formal mathematical tools (such as wp(|,|) and rc(||)), it provides a theoretical basis for the calculation of RIP conditions. - **Case Studies**: Through four specific programs and their mutants as running examples and case studies, it demonstrates the applicability and effectiveness of the proposed method. - **Algorithmic Incremental Method**: Proposes an algorithm - incremental method based on program templates for gradually calculating RIP conditions, making the method more practical and operable. In conclusion, this paper aims to fill the gap in the existing literature regarding the formal calculation of RIP conditions and provide a systematic and formalized method to improve the effectiveness and efficiency of mutation testing.