# Object-Oriented Testing Capabilities and Performance Evaluation of the C# Mutation System

Anna Derezińska, Anna Szustek

► To cite this version:

Anna Derezińska, Anna Szustek. Object-Oriented Testing Capabilities and Performance Evaluation of the C# Mutation System. 4th Central and East European Conference on Software Engineering Techniques (CEESET), Oct 2009, Krakow, Poland. pp.229-242, 10.1007/978-3-642-28038-2_18. hal-01527392

HAL Id: hal-01527392

https://inria.hal.science/hal-01527392

Submitted on 24 May 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Object-Oriented Testing Capabilities and Performance Evaluation of the C# Mutation System*

Anna Derezińska and Anna Szustek

Warsaw University of Technology,
Institute of Computer Science Nowowiejska 15/19, 00-665 Warsaw, Poland
A.Derezinska@ii.pw.edu.pl

**Abstract.** The main purpose of mutation testing approach is to check a test suite quality in terms of the adequacy to killing programs with inserted programming faults. We present advances in the C# mutation testing system that supports object-oriented mutation operators. The system enhancements related to functional requirements (mutation operators, avoiding generation of invalid and partially of equivalent mutants) and non-functional ones (speed-up using a new parser and reflection, space reduction storing mutant updates). Mutation testing of six widely used open source programs is discussed. The quality of the tests supplied with these programs was experimentally determined. Performance measures were evaluated to assess system enhancements (2-4 faster mutants creation, 10-100 times disk space reduction, tradeoff of time overhead for storing mutants of different size in a local or remote repository).

**Keywords:** mutation testing, object-oriented mutation operators, C#, system evolution

## 1 Introduction

Software testing is a critical part of software development. Mutation is the technique of generating faulty variants of a program [1]. It can be applied for assessing the fault detection ability of a test suite or comparing testing strategies. According to the experimental research [2], generated mutants can be treated as representatives of real faults. Mutation analysis can be performed "whenever we use well defined rules defined on syntactic descriptions to make systematic changes to the syntax or to objects developed from the syntax" [3].

A transformation rule that generates a *mutant* from the original program is called a *mutation operator*. So-called standard (or traditional) mutation operators introduce small, basic changes that are possible in typical expressions or assignment statements of any general purpose language [1]. Mutation operators dealing with many specific programming features, including object-oriented ones, were also developed. If for any program *P* the result of running its mutant *P'* is different from the result of running *P* for any test case of the test suite *T*, then the mutant *P'* is said to be *killed*. A mutant that cannot be killed by any possible test suite is counted as an *equivalent* one. The

<footnote>* This work was supported by the Polish Ministry of Science and Higher Education under grant 4297/B/T02/2007/33.</footnote>
adequacy level of the test set *T* can be computed in terms of the number of mutants killed by *T*.

Advanced mutation operators of C# language were adopted similarly to object-oriented operators of Java language [4,5,6,7] or developed for the specific language features and studied in experiments [8,9]. Based on the gathered experiences about evaluation and specification of object-oriented mutation operators, the first CREAM (CREATOR of Mutants) system supporting few of them for C# programs was implemented. Prior works [10,11] have presented the general architecture overview of the system and results of the first experiments. Suffered from several limitations, the system evolved to CREAM2, enhancing its mutant generation capabilities and performance issues.

The crucial problem in mutation testing approaches are considerable time and resource constraints. Due to lack of mature mutation tool support, also very little empirical evaluation has been done in the industrial development of C# programs. In this paper, we discuss advances in the CREAM2 system, including code parsing improvements, preventing generation of invalid and partially of equivalent mutants, cooperation with the distributed Tester environment [12], storing mutant's updates in the SVN repository [13]. We conducted experiments with several open source programs to evaluate and verify an extended set of mutation operators, to evaluate quality of test suites, and compare the results with the previous mutation system and standard mutations.

The remaining paper is organized as follows. In the next Section related work is discussed. Section 3 contains the outline of the improvements of the CREAM2 system. Section 4 presents an experimental study on object-oriented mutation of C# programs. We finish with assessment of performance results and conclusions.

## 2 Related Work

Mutation testing approach was developed primarily for structural languages, like Fortran with the mostly known Mothra tool [1]. Further, similar standard mutation operators were applied for other languages, as C language: Proteum [14,15], MiLu [16], and also object-oriented languages Java, C++, C#.

Standard mutations introduced into Java Byte Code are supported in different tools, like Jumble [17], MuGamma [18]. Selected traditional and some object-oriented mutations in Java were also implemented in Judy [19] and Javalanche [20] tools. Test cases considered for Java programs were commonly unit tests suitable for JUnit environment [17,19,21,22], or similar but specialized like in MuJava [23]. Several testing systems for C++ language uses standard mutation testing also in commercial products, as Insure++ from Parasoft. Simple changes to Java source code, without parser involvement, were implemented also in Jester environment [21]. The ideas of Jester system were transformed to Python and C# languages. Nester tool [24] supports the standard mutations of C# language. The improved version of Nester makes only one compilation run for all mutants. Afterwards, it is decided during test execution which mutant should run.

Mutation testing of object-oriented program features (mostly inter-class relations) was exhaustively studied for Java programs [4,5,6,7,23,25,26]. Standard and object-oriented operators for Java were applied in MuJava [23] and MuCclipse [26] - an Eclipse plug-in based on MuJava. In MuJava, mutants are generated either as a parameterized
program (so-called meta-mutant) that is further recompiled and executed as a mutant
according to a given parameter, or a mutation is introduced directly in the Byte Code.

The first tool supporting selected object-oriented mutations for C# was the CREAM
system [10,11]. The Nmutator tool announced in 2002 was supposed to introduce
object-oriented mutations into C# programs, but there are no evidences that this in-
tention was fulfilled. Research in [27] mentioned object-oriented features of C# but
concentrated on other problems and does not develop any tool at this area. Besides the
CREAM system the only known system dealing with object-oriented mutation opera-
tors for C# programs is the ILMutator prototype [28]. It provides object-oriented muta-
tions into the intermediate code derived from compiled C# programs. It implements so
far six types of changes of intermediate code corresponding to object-oriented mutation
operators on the C# source code level. Further development of the tool is in progress.

There are still many challenges that need to be solved in order to effectively bring
mutation testing into industrial practice. Representativeness of mutation faults in com-
parison to real faults was studied in case of standard mutation operators and C programs
[2]. Experiments gave promising results, but analogous facts for mutation faults injected
into other languages and using more specialized operators have been not yet sufficiently
verified [22].

Generation and execution of many mutants is generally very expensive. Time and
space performance can be limited by selection of the most relevant mutation operators,
via selective mutation [29], sufficient or orthogonal operators [15,25]. Performance can
be also improved by introduction of faults into intermediate language forms like Java
Byte Code, or Intermediate Language of .NET, or usage of repositories if many mutants
of the same program are stored.

Another crucial problem is detection of equivalent mutants. In an experiment 40% of all mutations turned out to be equivalent [20]. Existence of equivalent mutants is, in general, an undecidable problem. Therefore, applied algorithms cannot properly classify all mutants in all cases. Different techniques to recognize equivalent mutants in the structural programs were proposed, like constraint based testing (CBT), program optimizing rules, genetic algorithms, program slicing. Dealing with equivalent mutants in object-oriented programs is more complicated and is still not enough tool-supported. Therefore, it is important to prevent creating equivalent mutants. Firstly, the mutation operators should be carefully selected, avoiding those that can lead to many equivalent mutants. Secondly, generation of mutants can be restricted, omitting those cases that might produce equivalent mutants, even if under such restrictions certain proper mutants will be not generated.

3 Advances in the CREAM2 System

Basic principles of the CREAM2 system are similar to those of the previous version
[10,11]. The system is aimed at object-oriented and other specialized programming
flaws. O-O mutation operators, in opposite to simple traditional ones, have to deal with
the structural program dependencies. The mutant generator uses a parser tree of the
analyzed code. According to the language grammar and the rules defined in a mutation
operator, the places in the tree are identified where the operator could be applied. If
additional correctness conditions are satisfied at any such place, the tree is modified reflecting a fault introduced by the operator (see an example below). The mutant is a program corresponding to the modified tree. Many mutants can be created from the modifications applied in different places according to the rules defined by the same mutation operator.

Based on the experiment results, the next version of the CREAM system has been developed. In the program evolution the following goals were achieved:

- extension of functionality (new mutation operators, collecting of timing features, calculation of statistics, better interface),

- enhancement of program expansibility,

- improvements of mutant generation and its speed-up by usage of a new parser library and reflection mechanism,

- decrease of memory requirements on storing mutated programs,

- correlation of mutation with the code coverage output.

About forty object-oriented and other advanced mutation operators were specified for C# programs and their usefulness evaluated in preliminary experiments [8,9]. Based on this data, in the CREAM2 system 13 object-oriented operators were implemented (Table 1).

<table><caption>**Table 1.** Selected object-oriented mutation operators.</caption><thead><tr><th>No</th><th>Operators</th></tr></thead><tbody><tr><td>1</td><td>EHR Exception handler removal</td></tr><tr><td>2</td><td>EOA Reference assignment and content assignment replacement</td></tr><tr><td>3</td><td>EOC Reference comparison and content comparison replacement</td></tr><tr><td>4</td><td>IHD Hiding variable deletion</td></tr><tr><td>5</td><td>IHI Hiding variable insertion</td></tr><tr><td>6</td><td>IOD Overriding method deletion</td></tr><tr><td>7</td><td>IOK Override keyword substitution</td></tr><tr><td>8</td><td>IOP Overridden method calling position change</td></tr><tr><td>9</td><td>IPC Explicit call of a parent's constructor deletion</td></tr><tr><td>10</td><td>ISK Base keyword deletion</td></tr><tr><td>11</td><td>JID Member variable initialization deletion</td></tr><tr><td>12</td><td>JTD This keyword deletion</td></tr><tr><td>13</td><td>PRV Reference assignment with other compatible type</td></tr></tbody></table>

Mutation operators mimic different faults introduced by developers using various of programming techniques. Correctness conditions are applied in order to assure that
a valid mutant is generated, i.e. an injected fault would not be detected by a compiler. They are also partially aimed at preventing creating too many equivalent mutants. In this case, the measured mutation score indicator is closer to the exact mutation score.

For example, the EOA operator simulates a fault that a copy of an object is assigned instead of a desired object.

```java
public class Car : ICloneable{
    public object Clone() {...}
    ...
    Car s1 = new Car();
    Car s2;
    Original code:
        s2 = s1;
        Mutated code:
            s2 = s1.clone() as Car;
```

In case of EOA operator, only code extracts of the following syntax were mutated:

```
<Expression> = <Identifier>
<Variable>   = <Identifier>
```

If the right side of the assignment were equal to a different expression than an identifier of a variable, as for example result of a method call or a complex expression, the EOA operator would be not applied to this statement. In this way we prevent generating a code that might be not correctly compiled.

Expansibility mechanism of the system was improved. CREAM2 can be extended with new mutation operators implemented in appropriate add-ins without modification of other code. The same technique can be used for substitution of an existing operator with its better version. This feature was verified by users developing traditional mutation operators, applied in further experiments:

- AOR - Arithmetic Operator Replacement (binary: +, -, *, /, %, unary: +, -, and pre/post: v++, ++v, v-, -v)

- COR - Conditional Operator Replacement (binary: &&, ||, &, |, ^, and unary: !)

- LOR - Logical Operator Replacement (binary: &, |, ^, and unary: ~)

- ROR - Relational Operator Replacement (>, >=, <, <=, ==, !=)

- ASR - Assignment Operator Replacement (short-cut: =, +=, -=, *=, /=)

In the previous system, a class hierarchy was created and used to examine inheritance dependencies between classes, identification of member types, etc. Such information was helpful during identification of possible mutation places in the parser tree. The approach had some limitations, as classes from external libraries could not be taken into account in the considered class hierarchy. Lack of access to embedded types and library classes impeded implementation of more sophisticated object-oriented operators, like IHI or EOA. For example, the IHI operator requires information about members inherited from the base class. If the base class belonged to a library, information was inaccessible. The problem was solved in CREAM2 by usage of reflection mechanism for creation and inspection of the type hierarchy. More advanced mechanisms of type checking minimized the possibility of creation of invalid mutants.
In CREAM2, instead of C# parser `kscparse` used previously, a new parser from the `NRefactory` library [30] was applied. Therefore those files that include C# 2.0 constructions could be also mutated. The new parser enables faster movement on a parser tree and its modification. In result, a number of ill-defined mutants decreased and mutants could be created more effectively.

Experiments performed with the previous system were limited by requirements on disk space for storing code of many mutants. A mutated project differs only in few code lines from the original one. Solving this problem, we applied the SVN (Subversion) server [13] managing program versions. An original project is stored as the first version in a repository and each mutant is one of next versions. Therefore, only differences between a mutant and its origin are stored.

The program repository was also used as a buffer for simple integration of the mutant generator with other testing tools. CREAM2 cooperated with Tester - a distributed environment integrating software testing tools [12]. It can organize a hybrid testing process consisting of steps performed by differed testing tools and statistic evaluation of various test results. One of integrated tools was the IBM Rational PureCoverage tool. Code coverage results of a mutated program can be read by CREAM2. Taking into account coverage data can be used as a primarily condition for assessing test suites. It bounds a number of not killed mutants that have to be classified of being equivalent or not, because mutations introduced to areas not covered by tests are often not killed by these tests [9].

New versions of C# language (2.0 and 3.0) provide new programming constructions, e.g. generic types, nullable types, extensions to static types, properties, indexers, covariance, delegates etc., that were considered for new advanced mutation operators. A set of such operators were proposed and examined in preliminary experiments. The results were not very promising, because the new features concentrate mainly on simplification of code writing and either their misuse was easily detected by a compiler or many equivalent mutants were generated. Therefore these new operators were not included to the current CREAM2 version.

# 4 Experiments on Operators Evaluation and Tests Qualification

Capabilities of the CREAM2 system were verified in experiments performed on a set of widely used, open-source programs, which are distributed together with their unit test suits. The basic complexity measures of the programs and their tests are summarized in Table 2.

The experiments were performed according to the following scenario:

1. An original project with its unit test suite was added to the local or remote project repository.

2. The project was run against its tests. Code coverage of the program was evaluated. Program test results (an oracle) and coverage results were stored in the test results data base of the Tester system [12].

3. CREAM2 generated set of mutants of the project according to selected mutation operators and coverage data. Updates of compiled valid mutants were stored in the project repository.
<table><caption>**Table 2.** Complexity measures of mutated programs.</caption><thead><tr><th rowspan="2">No</th><th rowspan="2">Programs</th><th colspan="2">Number of</th><th colspan="2">Source code [LOC]</th><th rowspan="2">Project total [MB]</th></tr><tr><th>Classes</th><th>Tests</th><th>pure</th><th>with tests</th></tr></thead><tbody><tr><td>1</td><td>Adapdev.NET</td><td>252</td><td>14</td><td>68158</td><td>68315</td><td>23.0</td></tr><tr><td>2</td><td>Castle.Core</td><td>57</td><td>165</td><td>6190</td><td>8737</td><td>1.5</td></tr><tr><td>3</td><td>Castle.DynamicProxy</td><td>73</td><td>78</td><td>6933</td><td>10594</td><td>2.0</td></tr><tr><td>4</td><td>CruiseControl.NET</td><td>352</td><td>1279</td><td>31344</td><td>62412</td><td>32.0</td></tr><tr><td>5</td><td>NCover</td><td>38</td><td>72</td><td>4347</td><td>7403</td><td>18.4</td></tr><tr><td>6</td><td>NHibernate.IEsiCollections</td><td>8</td><td>153</td><td>21047</td><td>22293</td><td>0.4</td></tr></tbody></table>

4. Mutants were tested with their test suites using NUnit [31]. Generated results were compared against the given oracle, in order to decide whether a mutant was killed or not, and stored in the data base.

5. Mutation results were evaluated using stored data.

Number of mutants created by CREAM2 for different object-oriented operators are shown in Table 3. The first column identifies programs described in Table 2. Results for the IHD operator are omitted, because no mutants were generated. Usage of the repository for storing mutants allow to significantly raise limits on number of performed mutants. Therefore all possible mutants could be created, as for example above seven thousand mutants of *Adapdev.NET* (number 1).

<table><caption>**Table 3.** Number of mutants in programs per operators.</caption><thead><tr><th rowspan="2">No</th><th colspan="10">Operators</th><th rowspan="2">Sum</th></tr><tr><th>EHR</th><th>EOA</th><th>EOC</th><th>IHI</th><th>IOD</th><th>IOK</th><th>IOP</th><th>IPC</th><th>ISK</th><th>JID</th><th>JTD</th><th>PRV</th></tr></thead><tbody><tr><td>1</td><td>89</td><td>123</td><td>1839</td><td>2</td><td>88</td><td>52</td><td>50</td><td>23</td><td>94</td><td>738</td><td>2365</td><td>1963</td><td>7425</td></tr><tr><td>2</td><td>0</td><td>5</td><td>74</td><td>0</td><td>10</td><td>10</td><td>0</td><td>13</td><td>2</td><td>22</td><td>42</td><td>51</td><td>229</td></tr><tr><td>3</td><td>0</td><td>9</td><td>41</td><td>0</td><td>9</td><td>9</td><td>1</td><td>4</td><td>4</td><td>38</td><td>5</td><td>49</td><td>169</td></tr><tr><td>4</td><td>7</td><td>49</td><td>398</td><td>12</td><td>65</td><td>53</td><td>10</td><td>22</td><td>26</td><td>443</td><td>964</td><td>470</td><td>2519</td></tr><tr><td>5</td><td>0</td><td>17</td><td>61</td><td>0</td><td>3</td><td>3</td><td>1</td><td>1</td><td>6</td><td>55</td><td>77</td><td>31</td><td>255</td></tr><tr><td>6</td><td>0</td><td>0</td><td>28</td><td>0</td><td>2</td><td>2</td><td>0</td><td>0</td><td>0</td><td>4</td><td>45</td><td>2</td><td>83</td></tr><tr><td>Sum</td><td>96</td><td>203</td><td>2441</td><td>14</td><td>177</td><td>129</td><td>62</td><td>63</td><td>132</td><td>1300</td><td>3498</td><td>2566</td><td>10680</td></tr></tbody></table>
In Table 4 and 5 mutation results of the programs and the object-oriented mutation operators are presented. Numbers of mutants killed by the unit tests were in many cases not very high. Mutation score was calculated as a ratio of the number of mutants killed over the total number of generated valid mutants. Precisely, it is the lower bound on mutation score, called in [19] as mutation score indicator. The exact mutation score should be calculated over the number of all non-equivalent mutants. In the CREAM2 mutant generator much effort was spent to create only valid mutants and if possible avoid equivalent mutants. However, equivalent mutants can be also created. In simple cases they could be eliminated by hand. But, for the most discussed programs, when the numbers of not killed mutants were higher (like for the PRV operator), it was impossible to identify precisely all equivalent mutants.

Mutation results of all programs except *NCover* were low (16-37%) and showed a poor quality of the considered test suites. But, tests of *NCover* (no 5) killed all mutants of six operators and the most of mutants for the rest of them, giving a total mutation score equal to 97.6%. It is characteristic that in general a test suite good at killing mutants is dealing quite well with mutants generated by the given different mutation operators.

<table><caption>**Table 4.** Number of killed mutants.</caption><thead><tr><th rowspan="2">No</th><th colspan="10">Operators</th><th rowspan="2">Sum</th></tr><tr><th>EHR</th><th>EOA</th><th>EOC</th><th>IHI</th><th>IOD</th><th>IOK</th><th>IOP</th><th>IPC</th><th>ISK</th><th>JID</th><th>JTD</th><th>PRV</th></tr></thead><tbody><tr><td>1</td><td>29</td><td>40</td><td>539</td><td>2</td><td>15</td><td>14</td><td>18</td><td>10</td><td>47</td><td>291</td><td>690</td><td>384</td><td>2079</td></tr><tr><td>2</td><td>-</td><td>0</td><td>9</td><td>-</td><td>0</td><td>0</td><td>-</td><td>3</td><td>0</td><td>7</td><td>4</td><td>14</td><td>37</td></tr><tr><td>3</td><td>-</td><td>0</td><td>9</td><td>-</td><td>4</td><td>4</td><td>0</td><td>1</td><td>0</td><td>33</td><td>3</td><td>34</td><td>88</td></tr><tr><td>4</td><td>2</td><td>47</td><td>19</td><td>1</td><td>4</td><td>3</td><td>0</td><td>2</td><td>0</td><td>29</td><td>212</td><td>260</td><td>532</td></tr><tr><td>5</td><td>-</td><td>17</td><td>60</td><td>-</td><td>3</td><td>3</td><td>1</td><td>1</td><td>5</td><td>54</td><td>74</td><td>31</td><td>249</td></tr><tr><td>6</td><td>-</td><td>-</td><td>24</td><td>-</td><td>0</td><td>0</td><td>-</td><td>-</td><td>-</td><td>1</td><td>5</td><td>1</td><td>31</td></tr></tbody></table>

The ability of tests to kill mutants generated by different mutation operators was compared. It was measured, how many tests of the suite killed a mutant (Table 6). In case of two biggest programs (1 and 4) any mutation was killed usually by one test. Test cases of these programs were diverse and devoted to disjoint subjects. In the remaining programs a test was killed on average by about ten to several dozen of tests. It points out the existence of many redundant test cases as far as the given programming flaws are concerned. On the other hand, there are many mutants not killed by the tests from these test suites. For program number 5, having the best mutation score, the numbers of tests killing mutants are except the JID operator on a moderate level of about few tests. High mutation results for different mutation operators were obtained by a limited number of tests, but effective and focused on different subjects. We can observe that a number of tests killing mutants was in general a feature of a test suite. There was no
<table><caption>**Table 5.** Mutation score in [%].</caption><thead><tr><th rowspan="2">No</th><th colspan="10">Operators</th><th rowspan="2">Sum</th></tr><tr><th>EHR</th><th>EOA</th><th>EOC</th><th>IHI</th><th>IOD</th><th>IOK</th><th>IOP</th><th>IPC</th><th>ISK</th><th>JID</th><th>JTD</th><th>PRV</th></tr></thead><tbody><tr><td>1</td><td>32.6</td><td>32.8</td><td>29.3</td><td>100</td><td>17.1</td><td>26.9</td><td>36</td><td>43.5</td><td>50.0</td><td>39.4</td><td>29.2</td><td>19.6</td><td>28.0</td></tr><tr><td>2</td><td>-</td><td>0</td><td>12.1</td><td>-</td><td>0</td><td>0</td><td>-</td><td>23.1</td><td>0</td><td>31.8</td><td>9.5</td><td>31.8</td><td>16.7</td></tr><tr><td>3</td><td>-</td><td>0</td><td>21.9</td><td>-</td><td>44.4</td><td>44.4</td><td>0</td><td>25.0</td><td>0</td><td>86.8</td><td>60.0</td><td>73.9</td><td>37.6</td></tr><tr><td>4</td><td>25.0</td><td>4.2</td><td>19.0</td><td>7.14</td><td>6.1</td><td>5.6</td><td>0</td><td>9.1</td><td>0</td><td>6.6</td><td>21.9</td><td>55.7</td><td>21.4</td></tr><tr><td>5</td><td>-</td><td>100</td><td>98.3</td><td>-</td><td>100</td><td>100</td><td>100</td><td>100</td><td>83.3</td><td>98.2</td><td>96.1</td><td>100</td><td>97.6</td></tr><tr><td>6</td><td>-</td><td>-</td><td>85.7</td><td>-</td><td>0</td><td>0</td><td>-</td><td>-</td><td>-</td><td>25.0</td><td>11.1</td><td>50</td><td>37.3</td></tr></tbody></table>

significant dependency between this measure and the kind of the operator. The averaged percentage of tests that killed a mutant are given in the last column.

<table><caption>**Table 6.** Number of tests killing mutants.</caption><thead><tr><th rowspan="2">No</th><th colspan="10">Operators</th><th rowspan="2">Avg.</th><th rowspan="2">Avg.</th></tr><tr><th>EHR</th><th>EOA</th><th>EOC</th><th>IHI</th><th>IOD</th><th>IOK</th><th>IOP</th><th>IPC</th><th>ISK</th><th>JID</th><th>JTD</th><th>PRV</th><th>[%]</th></tr></thead><tbody><tr><td>1</td><td>1</td><td>1</td><td>1.1</td><td>28.6</td><td>1</td><td>1.1</td><td>1.1</td><td>1.1</td><td>1.1</td><td>1.1</td><td>1.1</td><td>7.9</td><td>1.1</td><td>7.6</td></tr><tr><td>2</td><td>-</td><td>0</td><td>5.2</td><td>-</td><td>0</td><td>0</td><td>-</td><td>5</td><td>0</td><td>15</td><td>20.8</td><td>31.8</td><td>10.8</td><td>6.5</td></tr><tr><td>3</td><td>-</td><td>0</td><td>25.8</td><td>-</td><td>40</td><td>40</td><td>0</td><td>40</td><td>0</td><td>40</td><td>12.3</td><td>40</td><td>37.6</td><td>48.2</td></tr><tr><td>4</td><td>1</td><td>1</td><td>0.8</td><td>1</td><td>1</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1.0</td><td>1.0</td><td>1.1</td><td>1.1</td><td>0.1</td></tr><tr><td>5</td><td>-</td><td>1.5</td><td>2.1</td><td>-</td><td>1.4</td><td>1.4</td><td>1.4</td><td>1.4</td><td>1.9</td><td>71</td><td>5.3</td><td>8.4</td><td>13.2</td><td>18.4</td></tr><tr><td>6</td><td>-</td><td>-</td><td>3.5</td><td>-</td><td>0</td><td>0</td><td>-</td><td>-</td><td>-</td><td>73</td><td>73</td><td>15</td><td>17.3</td><td>11.3</td></tr></tbody></table>

Mutation results of the object-oriented operators were compared with results of standard operators. Five standard mutation operators (see Sec. 3) were applied for two programs *Adapdev.NET* and *NCover* and a subset of all possible mutants were generated. No mutants were created for the ASR operator because no short-cuts (like +=) were used in these programs. Mutation score was calculated for given numbers of mutants (Fig. 7). All mutants were killed by the test suites in almost all cases. Good results of the test suite were expected for *NCover* as the tests were also good at detecting various flaws injected by the object-oriented operators. However, good results (99%) were obtained also for *Adapdev.NET*, while mutation score for the object-oriented operators was about 28%. In general, simple faults simulated by standard operators are more eas-
<table><caption>**Table 7.** Mutation results for standard mutation operators.</caption><thead><tr><th rowspan="2">No</th><th rowspan="2">Programs</th><th colspan="5">Number of mutants</th><th colspan="5">Mutation score [%]</th></tr><tr><th>AOR</th><th>COR</th><th>LOR</th><th>ROR</th><th>Sum</th><th>AOR</th><th>COR</th><th>LOR</th><th>ROR</th><th>Sum</th></tr></thead><tbody><tr><td>1</td><td>Adapdev.NET</td><td>60</td><td>46</td><td>40</td><td>40</td><td>186</td><td>100</td><td>98</td><td>100</td><td>100</td><td>99</td></tr><tr><td>5</td><td>NCover</td><td>40</td><td>8</td><td>0</td><td>80</td><td>128</td><td>100</td><td>100</td><td>-</td><td>100</td><td>100</td></tr></tbody></table>

ily to detect by tests. It is not sufficient to have test suites adequate to standard mutations in order to detect faults misusing object-oriented rules.

The experiment results have to be considered in the context of possible threats to validity. A big number of mutants helped to cope with threats to the statistical conclusions validity. However, for some mutation operators, e.g. IHI, these numbers were quite small, because such operator deals with less frequent programming constructions. Mono-operation bias is a threat as the experiment was conducted on a single development project. Therefore several, different programs were used in the experiments. The selected programs and their test suites are commonly used and neither prepared nor adapted for the experiments. It reduces threats to external validity concerning possibility of results generalization.

# 5 Performance Evaluation

In experiments we measured the impact of the applied technology on the system performance. Time and storage constraints were compared for different solutions and to the previous version of the mutation system.

One of improvements of the CREAM2 system was substitution of the parser module. Usage of a new parser speeded up the generation of mutants, as routines manipulating on parser trees were more effective. Average time of creation of mutants' source code was about 2-4 times shorter than in the previous system.

Repository for storing mutants was applied in order to reduce disk storage requirements. However, storing mutants in the repository takes more time than direct storing of whole mutants. Repository can be saved locally on the same computer as the mutants generation system, or on another remote computer. In dependence on the program characteristics, time of generation of mutants for a local repository was longer about 61-121% than the time of direct storing whole mutants in the same computer. While using a remote repository, the corresponding time was longer of about 39-91%. The average times of generating and storing a mutant in different locations for selected programs are given in Table 8. The time of generation to a repository depends on a program size. For bigger programs (like programs no 1, 4 and 5 - Table 2), time of using a remote repository was shorter than using a local one. The repository server had to analyze many files in order to identify and store the update. Concurrent work of the server and the generator was beneficial and exceeded the transmission overhead. For medium-size programs (as 2 and 3), times of using both kinds of repository were comparable. In
<table><caption>**Table 8.** Average time of generating and storing a mutant in [s].</caption><thead><tr><th>No</th><th>Programs</th><th>On local disk</th><th>In local repository</th><th>In remote repository</th></tr></thead><tbody><tr><td>1</td><td>Adapdev.NET</td><td>27.98</td><td>61.9</td><td>47.71</td></tr><tr><td>2</td><td>Castle.Core</td><td>3.20</td><td>6.24</td><td>6.09</td></tr><tr><td>3</td><td>Castle.DynamicProxy</td><td>3.77</td><td>6.22</td><td>6.04</td></tr><tr><td>4</td><td>CruiseControl.NET</td><td>32.98</td><td>33.64</td><td>25.13</td></tr><tr><td>5</td><td>NCover</td><td>14.47</td><td>26.19</td><td>20.08</td></tr><tr><td>6</td><td>NHibernate.IEsiCollections</td><td>2.80</td><td>5.59</td><td>9.30</td></tr></tbody></table>

case of the smallest program (number 6) usage of the local repository took less time, because the server of the repository had smaller requirements on processor time and the transmission overhead was noticeable.

It should be noted that, although discrepancies of average times are not very high, difference of times required for processing many mutants can be substantial. For example, generation and execution of all mutants of *Adapdev.NET* took 29 hours more using the local repository than the remote one.

The main goal of application of the SVN repository was decreasing memory requirements on storing mutants. Mutated programs are very similar to each other. In a repository only the updates to the original programs have to be stored. An empty repository needs about 80 kB and this is a small overhead in comparison to program sizes. Amounts of disk memory are compared in Table 9. Numbers in the last column refer to the repository including given numbers of mutated programs. The previous column shows how many disk space would be necessary to store the same mutated projects directly, without using the repository. The results showed that required memory was reduced in size from 10 to 100 times according to different programs and numbers of mutants.

# 6 Conclusions and Future Work

This paper reports on experiments on the object-oriented mutation testing of C# programs performed by the CREAM2 tool and its evolution to the current version. Application of advanced mutation operators implies more computational effort than the standard operators. But, according to experiments, test cases adequate to standard mutations are not enough capable to expose additional faults dealing with object-oriented constructions. Therefore, automated usage of advanced mutants for test qualification would be profitable.

Performed experiments showed that the new version of the CREAM2 system can generate object-oriented mutants more precisely than the previous one. The problem of big amounts of disk space was solved by usage of SVN repository for storing mutants.
<table><caption>**Table 9.** Comparison of memory requirements.</caption><thead><tr><th>No</th><th>Programs</th><th>Number of mutants</th><th>Disk storage</th><th>Repository storage</th></tr></thead><tbody><tr><td>1</td><td>Adapdev.NET</td><td>7425</td><td>167 GB</td><td>3 GB</td></tr><tr><td>2</td><td>Castle.Core</td><td>229</td><td>204 MB</td><td>34 MB</td></tr><tr><td>3</td><td>Castle.DynamicProxy</td><td>169</td><td>481 MB</td><td>31 MB</td></tr><tr><td>4</td><td>CruiseControl.NET</td><td>2519</td><td>79 GB</td><td>1 GB</td></tr><tr><td>5</td><td>NCover</td><td>255</td><td>5000 MB</td><td>90 MB</td></tr><tr><td>6</td><td>NHibernate.IEsiCollections</td><td>83</td><td>71 MB</td><td>6 MB</td></tr><tr><td></td><td>Sum</td><td>10680</td><td>252 GB</td><td>4 GB</td></tr></tbody></table>

It gave storage reduction of about 10 to 100 times. A bottleneck of experiments remains time requirements. However, using improved organization and automation of the whole testing process, all implemented object-oriented mutants of the given programs, i.e. above ten thousand of mutants, were generated, tested and analyzed. The long execution time could be tolerable when the whole process can be realized without user supervision. Essential reduction of time requirements can be obtained by elimination of mutants compilation. It is straightforward for standard mutation operators, but not for the advanced ones. First experiments with the prototype ILMutator system [28] gave promising results. It inserts mutations that simulate objects-oriented mutations of C# language direct into the Intermediate Language of .NET.

The most crucial problem of the mutation testing automation is still exclusion of equivalent mutants. Although the accurate recognition of all equivalent mutants would be in general impossible, but acceptable results could be obtained by limitation of their number to small amounts that can be neglected. There are two complementary approaches: preventing of equivalent mutant generation and detection of equivalent mutant in a set of non killed mutants. We concentrated so far on the first approach, while identification of equivalent mutants for advanced mutants of C# needs future work.

Another important issue concerning testing automation is execution of test runs and concluding on the killing of mutants. In the reported experiments, NUnit was used to run mutants with unit tests and to generate tests results compared to an oracle. In general, different test cases and test environments can be applied together with mutation testing. In the future, capture and replay environments with testing scripts including verification points and other verification mechanisms can be combined with the mutant generation system.

## Acknowledgments

The authors would like to thank Krzysztof Sarba, for his help in performing experiments.
References

1. Voas, J.M., McGraw, G.: Software Fault Injection, Inoculating Programs Against Errors. John Wiley & Sons Inc. (1998)

2. Andrews, J. H., Briand, C., Labiche, Y., Namin, A.S.; Using Mutation Analysis for Assessing and Comparing Testing Coverage Criteria. IEEE Transactions on Software Engineering 342(8), 608-624 (2006)

3. Offut, J.: A Mutation Carol Past, Present and Future. Proc. of the 4th International Workshop on Mutation Analysis, Mutation'09, Denver, Colorado (2009)

4. Chevalley, P.: Applying Mutation Analysis for Object-oriented Programs Using a Reflective Approach. In: Proc. of the 8th Asia-Pacific Software Engineering Conference, ASPEC, 267-270 (2001)

5. Chevalley, P., Thevenod-Fosse P.: A Mutation Analysis Tool for Java Programs. Journal on Software Tools for Techn. Transfer (STTT) 5(1), 90-103 (2003)

6. Kim, S., Clark, J., McDermid J.A.: Class Mutation: Mutation Testing for Object-oriented Programs. In: Proc. of Conference on Object-Oriented Software Systems, Erfurt, Germany (2000)

7. Ma, Y-S., Kwon, Y-R., Offutt, J.: Inter-class Mutation Operators for Java, Proc. of International Symposium on Software Reliability Engineering, ISSRE'02, IEEE Computer Soc. (2002)

8. Derezińska, A.: Advanced Mutation Operators Applicable in C# programs. In: K. Sacha (ed.) Software Engineering Techniques: Design for Quality, IFIP, vol. 227, pp. 283-288. Springer, Boston (2006)

9. Derezińska, A.: Quality Assessment of Mutation Operators Dedicated for C# Programs. In: Proc. of the 6th International Conference on Quality Software, QSIC'06, pp. 227-234. IEEE Computer Soc. Press, California (2006)

10. Derezińska, A., Szustek, A.: CREAM - a System for Object-oriented Mutation of C# Programs. In: Szczepański, S., Kłosowski, M., Felendzer, Z. (eds.) Annals Gdansk University of Technology Faculty of ETI, No 5, Information Technologies, vol.13, pp. 389-406. Gdańsk (2007)

11. Derezińska, A., Szustek, A.: Tool-supported Mutation Approach for Verification of C# programs. In: W. Zamojski, J. Mazurkiewicz, J. Sugier, T. Walkowiak (eds.) Proc. of International Conference on Dependability of Computer Systems, DepCoS-RELCOMEX 2008, pp. 261-268. IEEE Comp. Soc. USA (2008)

12. Derezińska, A., Sarba, K.: Distributed Environment Integrating Tools for Software Testing, In: T. Sobh (Ed.) Advances in Computer and Information Sciences and Engineering, Springer (2009) (to appear)

13. Subversion svn, http://subversion.tigris.org

14. Delmaro, M., Maldonado, J.: Proteum - a Tool for the Assessment of Test Adequacy for C Programs. In: Proc. of Conference on Performability in Computing Sys., PCS96, pp. 79-95 (1996)

15. Namin, S., Andrews, J.H.: On Sufficiency of Mutants. In: Proc. of the 29th International Conference on Software Engineering, ICSE'07 (2007)

16. Jia, Y., Harman, M.: MiLu: a Customizable, Runtime-Optimized Higher Order Mutation Testing Tool for the Full C Language. TAIC-Part (2008)

17. Irvine, S.A. et al.: Jumble Java Byte Code to Measure the Effectiveness of Unit Tests, Mutation'07 at TAIC.Part'07, 3th Inter. Workshop on Mutation Analysis, pp. 169-175. Cumberland Lodge, Windsor UK (2007)

18. Kim, S.-W., Harrold, M.J. Kwon, Y.-R.: MuGamma: Mutation Analysis of Deployed Software to Increase Confidence and Assist Evolution. In: Proc. of the 2nd Workshop on Mutation Analysis, Mutation 2006, Releigh, North Carolina, Nov. (2006)
19. Madeyski, L.: On the Effects of Pair Programming on Thoroughness and Fault-finding Effectiveness of Unit Tests. In: Münch, J., Abrahamsson, P.J. (eds.) Profes 2007. LNCS, vol. 4589, pp. 207–221. Springer, Heidelberg (2007)

20. Grün, B.J.M, Schuler, D., Zeller, A.: The Impact of Equivalent Mutants. In Proc. of the 4th International Workshop on Mutation Analysis, Mutation’09, Denver, Colorado (2009)

21. Moore, I.: Jester a JUnit Test Tester. eXtreme Programming and Flexible Process in Software Engineering – XP2000 (2000)

22. Do, H., Rothermel, G.: A Controlled Experiment Assessing Test Case Prioritization Techniques via Mutation Faults. In: Proc. of the 21st IEEE International Confe on Software Maintenance, ICSM’05, IEEE Comp. Soc. (2005) 411–420

23. Ma, Y-S., Offutt, J., Kwon, Y-R.: MuJava: an Automated Class Mutation System, Software Testing, Verification and Reliability 15(2) (2005)

24. Nester, http://nester.sourceforge.net/

25. Lee, H.-J., Ma, Y.-S., Kwon, Y.-R.: Empirical Evaluation of Orthogonality of Class Mutation Operators. In: 11th Asia-Pacific Software Engineering Conference, IEEE Computer Society (2004)

26. Smith, B.H., Williams, L.: A Empirical Evaluation of the MuJava Mutation Operators. Mutation’07 at TAIC.Part’07, 3th International Workshop on Mutation Analysis, pp. 193–202. Cumberland Lodge, Windsor UK (2007)

27. Baudry, B., Fleurey, F., Jezequel, J.-M., Traon, Y.L.: From Genetic to Bacteriological Algorithms for Mutation-based Testing. Software Testing, Verification and Reliability 15(2), 73-96 (2005)

28. Kowalski, K.: Implementing Object Mutations into Intermediate Code for C# programs, Bach. Thesis, Inst. of Comp. Science, Warsaw Univ. of Technology (2008) (in polish)

29. Offut, J., Rothermel, G., Zapf, C.: An Experimental Evaluation of Selective Mutation. In: Proc. of the 15th International Conference on Software Engineering, pp. 100-107 (1993)

30. NRefactory, http://codeconverter.sharpdeveloper.net/Convert.aspx

31. NUnit, http://www.nunit.org