# Model-Based Test Suite Generation Using Mutation Analysis for Fault Localization
## 2 Mutation-Based Fault Localization  
Fault localization is a technique for automating the process of searching for the locations of faults to reduce the cost of debugging. Initially, fault-localization techniques consisted of program logging, assertions, breakpoints, and profiling [16]. However, these methods were not effective in the case of large-scale software. To overcome this problem, slice-based, spectrum-based (coverage-based), statistics-based, and program state-based methods were studied as advanced fault-localization techniques, of which the spectrum-based technique was the most frequently studied [16]. This technique uses test execution results and coverage information to calculate suspiciousness. The tarantula suspiciousness metric is a typical method for calculating suspiciousness and is defined in Equation (1) [20]. \[\tau(s)=\frac{\frac{F(s)}{TotalFail}}{\frac{P(s)}{TotalPass}+\frac{F(s)}{TotalFail}}, \tag{1}\]  
where \(\tau(s)\) is the tarantula suspiciousness metric of structural element \(s\). _TotalPass_ is the number of tests that passed; the number of tests that covers structural element \(s\) is \(P(s)\). _TotalFail_ is the number of tests that failed; the number of tests that covers the structural element \(s\) is \(F(s)\). \(\tau(s)\) has a maximum value of one and a minimum value of 0. As \(\tau(s)\) approaches 1, the suspiciousness of a fault becomes higher. Testing techniques based on mutation analysis are called mutation-testing techniques. Mutation testing is a fault-injection testing technique that improves the quality of test cases using versions of a program in which artificial changes are introduced to the target program. These versions are called mutants. The artificial changes in the mutant represent mistakes that could have been made by the programmer during coding, and are implemented to intentionally include simple syntax changes in the original program. For example, the syntax of the original program \(p\), _iff(a & b)_ can be changed to _iff(a \(\|b\))_ to generate a mutant program \(p^{\prime}\). In addition to such replacements, syntax can also be inserted or deleted. Typical mutations are classified using formalized mutation operators [21; 22]. In mutation testing, test cases are executed on various mutants, and a mutant is \"killed\" when it produces different results that differ from those of the original program. As more mutants are killed by the test cases, the quality improves. The most typical problem with mutation testing is the high computational cost incurred when creating a very large number of mutations in a test set. Therefore, many studies focused on new technologies to reduce this computational cost [14], and on incorporating search-based techniques to efficiently improve test cases [15]. Here, we execute test suites on mutants and run a genetic algorithm based on the results to improve the quality of these suites. Figure 1 is an example of our search-based mutation testing used in this paper. Test suites that kill many mutants have high-quality values, and later receive many opportunities to pass their traits to their offspring when crossovers and mutations (genetic operations) are executed. During this process, low-quality chromosomes (test suites) die out. [PERSON] et al. [23] proposed a fault-localization approach (Metallaxis-FL) based on mutation analysis, which improved the effectiveness of coverage-based fault localization. This method takes advantage of the characteristics of mutation analysis, i.e., that mutants located in the same program statements frequently exhibit similar behavior. Metallaxis-FL executes test cases on mutants and finds mutants whose test results exhibit similar behavior. The position of the mutant is estimated to be the location of the fault. Metallaxis-FL improves the effectiveness of mutation analysis-based fault localization, and also applies mutant sampling to cost reduction.