You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+11-89
Original file line number
Diff line number
Diff line change
@@ -27,25 +27,28 @@ Metacello new
27
27
load.
28
28
```
29
29
30
-
## Analysis
30
+
## Quick start
31
31
32
32
```smalltalk
33
-
| analysis alive testClasses classesToMutate |
34
-
testClasses := { UUIDPrimitivesTest }.
35
-
classesToMutate := { UUID . UUIDGenerator }.
33
+
"Put here the classes you want to mutate"
34
+
classesToMutate := { }.
35
+
"Put here the test classes associated with"
36
+
testClasses := { }.
36
37
37
38
analysis := MTAnalysis new
38
39
classesToMutate: classesToMutate;
39
40
testClasses: testClasses.
40
41
41
42
analysis run.
42
43
43
-
"To retrieve the alive mutations"
44
-
alive := analysis generalResult aliveMutants.
45
-
46
44
"To inspect the results"
47
45
analysis generalResult inspect.
48
46
```
47
+
48
+
## Wiki
49
+
50
+
You can find a wiki [here](https://github.com/pharo-contributions/mutalk/wiki) with a lot of information about MuTalk and how it works. It is higly recommended to read it.
51
+
49
52
---
50
53
51
54
Original repository: http://www.squeaksource.com/MutationTesting
@@ -62,85 +65,4 @@ During the 70s, mutation testing emerged as a technique to assess the fault-find
62
65
63
66
However, so far it is a “brute force” technique that takes too long to provide useful results. This characteristic has forbidden its widespread and practical use regardless the existence of new techniques, such as schema-based mutation and selective mutation. Additionally, there are no mutation testing tools (to our knowledge) that work on meta-circular and dynamic environments, such as Smalltalk, so compile and link time are the current technique's bottleneck.
64
67
65
-
This Smalltalk-based tool was developed at the University of Buenos Aires (Argentina) in the context of the final thesis work. The tool uses Smalltalk's dynamic and meta-programming facilities to notably reduce the time to get valuable output and help to understand and implement new tests due to its integration with the rest of the environment.
66
-
67
-
## Wiki
68
-
69
-
You can find a wiki [here](https://github.com/pharo-contributions/mutalk/wiki).
70
-
71
-
## FAQ
72
-
73
-
> How can I run a mutation testing analysis on my packages?
74
-
75
-
Currently you need to write a script in the playground (shortcut: CTRL + O + W) like the one above.
76
-
77
-
In the future we plan to improve the UI to allow MuTalk to be used:
78
-
* in the Mutation Testing Runner
79
-
* within the Class Browser
80
-
81
-
> What is the difference between each running mode?
82
-
83
-
We have four modes to run an analysis:
84
-
* Mutate All, Run All: it means mutating all your code and then running all tests.
* Mutate All, run Covering: it means mutating all your code but, for each mutated method, running tests that cover it. The result should be, in general, the same than running Mutate All, Run All, but taking less time.
* Mutate Covered, Run Covering: it means mutating covered code and, for each mutated method, running tests that cover it. The result must be, in general, the same than running Mutate Covered, run All, but taking less time.
You can change the mutant selection strategy as we presented above, but there are more. You can manually give the methods to be mutated with `MTManualMutatedMethodSelectionStrategy`, or directly give the mutations with `MTManualMutationSelectionStrategy`.
109
-
You can also randomize the mutations order with `MTRandomMutantSelectionStrategy`. This strategy relies on another mutant selection strategy (by default it is the all mutant one) to generate the mutations, then it shuffles the collection of mutations. Another option is to use `MTRandomOperatorMutantSelectionStrategy`, which randomly selects a mutant operator then randomly selects a mutation from this operator.
110
-
111
-
Theses random strategies are especially useful when paired with budgets, in particular the ones on number of mutants. Budgets are meant to impose a limitation on the analysis.
112
-
There are 4 types:
113
-
* No budget: the analysis will run until finished or until it encounters a bug.
114
-
* ```smalltalk
115
-
analysis budget: MTFreeBudget new.
116
-
```
117
-
* Budget on a fixed number of mutants: the analysis will stop when the given number of mutants have been evaluated.
* Budget on a percentage of mutants: the analysis will stop when the given percentage of mutants have been evaluated. If the percentage gives a non exact number of mutants (for instance 7.6 mutants), it stops at the rounded up number (here it would be 8 mutants).
* Budget on time: the analysis will run until the given time as passed. If a mutant is being evaluated when the time is up, the analysis continues until this evaluation is finished.
126
-
* ```smalltalk
127
-
analysis budget: (MTTimeBudget for: 10 seconds).
128
-
```
129
-
130
-
When evaluating a mutant the analysis installs the mutation, runs all tests, and at the first failing test it ends the evaluation, uninstalls the mutation and moves on to the next mutant. However in some cases you need the analysis to run all tests and do not stop at the first failing test.
131
-
You can do that in MuTalk with this option:
132
-
```smalltalk
133
-
analysis doNotStopOnErrorOrFail.
134
-
```
135
-
136
-
> What is the default mode to run mutation testing?
137
-
138
-
The default parameters are: mutate all, run all, no budget and stop at first fail.
139
-
140
-
> Does MuTalk replace coverage analysis?
141
-
142
-
No, it doesn't. It complements coverage. We should first try to write all the tests to achieve a high coverage score on the code we want to mutate. We can then run mutation testing in Mutate Covered, Run Covering mode.
143
-
144
-
> My image is freezing when running a mutation testing analysis, what can I do?
145
-
146
-
You can can open the Mutation Testing Runner and then Activate Logging to File. It will generate a file called MutationTestingLog.txt which lets you know which mutant is causing your image to freeze. You can install the mutation by hand, and then debug running your tests. You will probably need to exclude a class or an operator from the analysis.
68
+
This Smalltalk-based tool was developed at the University of Buenos Aires (Argentina) in the context of the final thesis work. The tool uses Smalltalk's dynamic and meta-programming facilities to notably reduce the time to get valuable output and help to understand and implement new tests due to its integration with the rest of the environment.
0 commit comments