J. de Lara and A. Zisman (Eds.): FASE 2012, LNCS 7212, pp. 425–438, 2012.
© Springer-Verlag Berlin Heidelberg 2012
Reduction of Test Suites Using Mutation
Macario Polo Usaola
1
, Pedro Reales Mateo
1
, and Beatriz Pérez Lamancha
2
1
Department of Information Systems and Technologies, University of Castilla-La Mancha,
Paseo de la Universidad 4, 13071-Ciudad Real, Spain
{macario.polo,pedro.reales}@uclm.es
2
Software Testing Centre (CES), University of Republic
Lauro Müller 1989, Montevideo, Uruguay
bperez@fing.edu.uy
Abstract. This article proposes an algorithm for reducing the size of test suites,
using the mutation score as the criterion for selecting the test cases while
preserving the quality of the suite. Its utility is also checked with a set of
experiments, using benchmark programs and industrial software.
Keywords: Test suites, mutation, test suite reduction, criteria subsumption.
1 Introduction
Mutation is a testing technique, originally proposed in 1978 by DeMillo et al. [1],
which relies on the discovery of the artificial faults which are seeded in the system
under test (SUT). These faults are injected in the SUT by means of a set of mutation
operators, whose purpose is to imitate the faults that a common programmer may
commit. Thus, each mutant is a copy of the program under test, but with a small
change in its code, which is interpreted as a fault.
Mutants are usually generated by automated tools that apply a set of mutation
operators to the sentences of the original program, thus producing a high number of
mutants because, in general, each mutant contains only one fault. The fault in a
mutant is discovered when the execution of a given test case produces a different
output in the original program and in the mutant. When the fault is discovered, it is
said that the mutant has been “killed”; otherwise, the mutant is “alive”.
In order to obtain a good set of mutants, it is important that the seeded faults be
“good”, which depends on the quality of the mutation operators applied. This area has
been closely studied, with the proposal of operators for different kinds of languages
and environments, as for example in [2]. Faults introduced in the mutants must imitate
common errors by programmers since, by means of the “coupling effect”, a test suite
that detects all simple faults in a program is so sensitive that it also detects more
complex faults [3].
Figure 1 shows the source code of an original program (the SUT) and of some
mutants: three of them proceed from the substitution of an arithmetic operator,
whereas in the fourth a unary operator (++) has been added at the end of the sentence.
The bottom of the figure presents the results obtained from executing some test cases