Professional Documents
Culture Documents
I. INTRODUCTION
Software testing is an important and practical technique to
efficiently detect errors in complex software systems.
Mutation testing is concerned to be a structural testing method
that aims at assessing the adequacy and effectiveness of test
suites, along with estimating the number of faults present in
the systems under test. The essence of mutation testing arises
from the fault injection techniques in which a fault is
intentionally introduced to test the error handling of the
system that should eventually be revealed by adequate tests. In
fact, mutation was originally thought of as applying Fig. 1: Mutation Testing Approach
modification to the original program for the purpose of
generating numerous mutants, which are faulty versions; each Historically, general-purpose programming languages had
containing one change. Consequently, the mutated program been targeted by mutation testing application to measure the
code is slightly changed in comparison to the original one. adequacy of a test suite and had been widely used in
Afterwards, each mutant proposed as in [5] will be tested experimental studies. It was compared to a list of software
against a suite of test cases in order to determine the testing techniques including white-box widely used
effectiveness of these tests in detecting the injected errors.1 techniques, and mutation still remains as the most effective of
all techniques. Yet, mutation testing techniques require many
The mutation testing techniques are very crucial in evaluating, comparing, and improving the
quality of a test suite. Nonetheless, the value of mutation testing depends on the set of mutants
used in the evaluation. These mutants are formed from the original program through the use of
predefined mutation operators. In order to perform syntactic modification on the program,
mutation operator is a rule that substitutes section of the source code.
Since mutation is always based on mutation operators, researchers have designed and developed a
set of mutation operators to support various programming languages such as Java. The quality of
inheritance, polymorphism, encapsulation, and dynamic Java-Specific JTI This keyword Insertion
binding. Examples of the modification of these features, by the Features
JTD This keyword Deletion
class mutation operators, include deleting the super keyword
JSI Static modifier Insertion
for inheritance and changing a cast type for the polymorphism.
JSD Static modifier Deletion
The class level operators considered for MuJava are JID Member variable Initialization
divided in four categories [10] according to their usage in Deletion
Object Oriented Programming: encapsulation, polymorphism,
JDC Java-supported Default
inheritance, and Java specific features. These four groups are constructor Creation
based on the language features that are affected [3]. The first
three groups target features common to all OO programing EOA Reference assignment and
content Assignment
languages while the fourth category depends solely on Java. replacement
EOC Reference comparison and
Class-level operators make changes to the program
content Comparison
syntax by inserting, deleting or modifying the expressions replacement
under test. Operators have been defined for each category. In
EAM Accessor Method change
all, there are 29 class-level operators in MuJava. Table I
presents the class operators supported by java as well as their EMM Modifier Method change
description.
IPC Explicit call of a Parent's According to the number and the type of operands,
Constructor
some of the method level operators are divided into two or
Polymorphism PNC New method Call with child three operators. Because MuJava has been created for Java
class type programs, only operators used in Java are considered for the
PMD Member variable Declaration creation of this tool. Table II presents the method operators
with parent class type [16] for Java:
PPD Parameter variable
Declaration with child class
type TABLE II. CLASS-LEVEL OPERATOR IN MUJAVA
LogicalFacade
One of crucial and resource consuming steps of mutation
testing is the creation and execution of mutants. Many User 465 120
research studies have been conducted to automate this process Player
by developing mutation software tool to successfully perform
Hand
this task. As part of our research, we have used a mutation-
testing tool, MuClipse [1] as an integrated development Card
environment, Eclipse provides many project management and Coffee Maker 4 CoffeeMaker
development interfaces that greatly enhance designing and
implementing a Java project. MuClipse is an Eclipse Plug-in Inventory
316 50
that bridges between the existing MuJava API and the Eclipse InventoryException
Workbench.
Recipe
Furthermore, to investigate the presence or the TABLE VI. METHOD –LEVEL OPERATORS MUTATION
absence of each method level operator in our subject Applic Class Unit Testing
applications, Table V categorizes, for each subject ation
application, the method-level operators into six operators’
categories depending on the type of primitive operator. Name # of Killed Live Sco Mean
method muta muta re Score
Both Logical and Assignment operators exist in the s nts nts
chosen applications. Coffee Coffee Maker 8 155 162 48
Maker
Inventory 10 78 31 71 65.33
TABLE V. METHOD –LEVEL DESCRIPTION OF EMPIRICAL STUDY
SUBJECT Recipe 14 84 25 77
BlackJ Card 8 35 2 94
ack
Dealer 1 12 0 100
LogicFacade 17 58 17 77
User 5 30 0 100
CruiseControl 3 1 0 100
3) Subject Applications
SpeedControl 7 32 71 31
The method that had been conducted in this study is Elevat ArrivalSensor 3 3 4 42
or
based on the results from the metric value of mutation score ElevatorInterf 7 1 115 0
that had been presented above. The test cases have been ace
developed using unit testing, and then run on the applications ElevatorContr 10 3 7 30
chosen after these programs have been modified automatically ol
Elevator 24 45 147 76
As for the purpose of this research mutation testing
FloorControl 3 0 63 0
tool with its different techniques had been used. For each
class, all methods had been tested with a great focus on FloorInterface 5 14 66 17
complex ones. The approach started with the creation of one Floor 12 10 157 5
or more tests for each method depending on the complexity. Find Find 4 176 45 76 76
Afterwards, test cases were run on the mutated programs four
times, by modifying the mutant operators for each round. The
four techniques that had been experienced are method
operators, class operators, all operators and a random TABLE VII. CLASS –LEVEL OPERATORS MUTATION
sampling subsequently. Applic Class Unit Testing
ation
The mutation score had been calculated for each
class within the application and respectively for each Name # of Killed Live Sco Mean
method muta muta re Score
technique. In order to expedite the process of comparison of s nts nts
the techniques effectiveness between different programs, a
Coffee Coffee Maker 8 1 74 1
mean mutation score had been calculated by application. Maker
Inventory 10 31 19 62 39.6
4) Research Results Recipe 14 13 17 56
BlackJ Card 8 10 1 90
ack
Tables VI, and VII are a representation of mutation Dealer 1 1 0 100 93
score values by class and a mean score by application. In
Hand 3 5 0 100
the process of mutants ‘generation, it had been manually
LogicFacade 17 3 1 75 ElevatorContr 10
ol 3 9 25
User 5 4 0 100
ElevatorGroup 9 90 30 75
Cruise CarSimulator 11 6 10 37
Contro Elevator 24 41 548 6
l Controller 9 3 4 42
51.75 FloorControl 0 24 78 20
CruiseControl 3 1 0 100
FloorInterface 1 15 68 28
SpeedControl 7 4 10 28
Floor 0 35 176 17
Elevat ArrivalSensor 3 3 4 42
or Find Find 0 49 147 75 73
ElevatorInterf 7
ace 1 2 33
ElevatorContr 10
ol 1 4 20
TABLE IX. RANDOM SAMPLING OPERATORS MUTATION
ElevatorGroup 9 13.86
0 2 0 Applic Class Unit Testing
Elevator 24 ation
9 56 7
FloorControl 0 15 0 0 Name # of Killed Live Sco Mean
FloorInterface method muta muta re Score
1 2 33 1
s nts nts
Floor 0 19 0 0
Coffee Coffee Maker 8 178 167 67
Find Find 0 4 0 0 0 Maker
Inventory 10 138 50 78 72.3
Recipe 14 101 38 72
Table VIII shows that the all operators sampling method BlackJ Card 8 46 2 95
ack
that generates mutants using both method and class Dealer 1 13 0 100
operators. While Table IX exemplify the random
Hand 3 32 0 100 96.6
sampling for mutant generation, this task had been
performed manually by an external third party manually. LogicFacade 17 51 7 88
A total of 30 operators had been selected randomly from User 5 34 0 100
43, which represents 70% of the operators. Afterwards, Cruise CarSimulator 11 64 172 27
scores had been calculated and reflected in the table Contro
l Controller 9 68 41 68
73.75
CruiseControl 3 1 0 100