Abstract
O teste baseado em mutação tem sido aplicado em diferentes contextos nos quais tem se mostrado um dos mais eficazes em revelar defeitos. Entretanto, uma disvantagem desse critério é o alto custo computacional. Por isso diferentes estratégias têm sido propostas na literatura com o objetivo de reduzir esse custo. A utilização de tais estratégias é fundamental para permitir a aplicação do teste de mutação em aplicações reais, entretanto, elas têm sido avaliadas somente para um conjunto de programas pequenos e com poucas estruturas de dados. Para fornecer indícios sobre o efeito dessas estratégias em programas mais complexos, este trabalho apresenta resultados de um experimento conduzido com a ferramenta Proteum e com quatro estratégias: Mutação Aleatória, Mutação Seletiva, Mutação Restrita e a Estratégia Essencial. As estratégias são avaliadas segundo o escore de mutação e custo, dado pela redução no número de mutantes gerados.
Introduction
Mutation testing is widely considered one of the most effective methods for revealing software defects. By intentionally introducing small faults (mutants) into the code, developers can evaluate the strength of their test suites. However, the sheer number of mutants generated for real-world applications often leads to prohibitive computational costs and manual effort. This paper evaluates several cost-reduction strategies on complex C programs to determine if these shortcuts maintain testing efficacy.
Methodology
The study utilizes the Proteum tool to evaluate four primary cost-reduction strategies:
- Random Mutation: Randomly selecting a subset (10%, 20%, or 40%) of total mutants.
- Selective Mutation ($N$-selective): Excluding the $N$ operators that generate the highest volume of mutants.
- Constraint/Restricted Mutation: Selecting only the most representative operator from each category.
- Essential Strategy: Using a specific subset of "essential" operators known for high coverage.
These strategies were tested against the Siemens programs benchmark (e.g., totinfo, schedule, printtokens2), which average 270 lines of code and include complex structures like pointers and dynamic memory, providing a more realistic evaluation than previous studies on smaller code snippets.
Key Results and Insights
The experimental results highlight a significant trade-off between computational cost and the mutation score—a measure of test suite effectiveness.
As shown in the summary table above, the Random 10% strategy is remarkably efficient, achieving a mutation score of 0.9804 while requiring only 1,260 mutants compared to the full set of 12,735. This represents a massive 90% reduction in workload with minimal loss in quality. Conversely, Selective Mutation performed poorly on these complex programs, with scores dropping significantly (e.g., 0.7118 for $N=5$), suggesting that high-volume operators are crucial for complex logic.
The bar chart above illustrates the percentage reduction in the number of mutants across different strategies. While strategies like Random 10% and Selective $N=20$ offer the highest reductions (around 90%), their impact on the mutation score varies greatly. The Essential Strategy (Barbosa et al.) provides a balanced approach, maintaining a high score (0.9889) with a substantial reduction in mutants.
Conclusion
The findings suggest that for many practical applications, simple random sampling (Random 10%) or the Essential Strategy offers the best balance of speed and quality. While Selective Mutation might work for simpler code, it fails to capture the nuances of more complex C programs. Future work should extend these evaluations to larger industrial systems and object-oriented languages to further validate these cost-saving measures.
Summary updated