-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Durieux Pol
committed
Dec 4, 2023
1 parent
3f91321
commit d12fd89
Showing
4 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/MuTalk-TestResources/AuxiliarClassForMutationTestingBudget.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Class { | ||
#name : #AuxiliarClassForMutationTestingBudget, | ||
#superclass : #Object, | ||
#category : #'MuTalk-TestResources' | ||
} | ||
|
||
{ #category : #arithmetic } | ||
AuxiliarClassForMutationTestingBudget >> decrement: aNumber [ | ||
|
||
^ aNumber - 1 | ||
] | ||
|
||
{ #category : #arithmetic } | ||
AuxiliarClassForMutationTestingBudget >> increment: aNumber [ | ||
|
||
^ aNumber + 1 | ||
] |
28 changes: 28 additions & 0 deletions
28
src/MuTalk-TestResources/AuxiliarTestClassForMutationTestingBudget.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Class { | ||
#name : #AuxiliarTestClassForMutationTestingBudget, | ||
#superclass : #TestCase, | ||
#instVars : [ | ||
'object' | ||
], | ||
#category : #'MuTalk-TestResources' | ||
} | ||
|
||
{ #category : #running } | ||
AuxiliarTestClassForMutationTestingBudget >> setUp [ | ||
super setUp. | ||
|
||
object := AuxiliarClassForMutationTestingBudget new. | ||
(Duration seconds: 2) wait | ||
] | ||
|
||
{ #category : #tests } | ||
AuxiliarTestClassForMutationTestingBudget >> testDecrement [ | ||
|
||
self assert: (object decrement: 2) equals: 1 | ||
] | ||
|
||
{ #category : #tests } | ||
AuxiliarTestClassForMutationTestingBudget >> testIncrement [ | ||
|
||
self assert: (object increment: 1) equals: 2 | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Class { | ||
#name : #MutationTestingBudgetTest, | ||
#superclass : #TestCase, | ||
#category : #'MuTalk-Tests' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
Class { | ||
#name : #MutationTestingTimeBudgetTest, | ||
#superclass : #TestCase, | ||
#instVars : [ | ||
'budget', | ||
'analysis' | ||
], | ||
#category : #'MuTalk-Tests' | ||
} | ||
|
||
{ #category : #running } | ||
MutationTestingTimeBudgetTest >> setUp [ | ||
|
||
| testCases classesToMutate | | ||
super setUp. | ||
|
||
testCases := { AuxiliarTestClassForMutationTestingBudget }. | ||
classesToMutate := { AuxiliarClassForMutationTestingBudget }. | ||
|
||
budget := MutationTestingTimeBudget new. | ||
|
||
analysis := MutationTestingAnalysis | ||
testCasesFrom: testCases | ||
mutating: classesToMutate | ||
using: MutantOperator contents | ||
with: AllTestsMethodsRunningTestSelectionStrategy new | ||
with: AllMutantSelectionStrategy new | ||
budget: budget | ||
] | ||
|
||
{ #category : #tests } | ||
MutationTestingTimeBudgetTest >> test12SecShouldEvaluate2Mutants [ | ||
|
||
budget constraint: (Duration seconds: 12). | ||
analysis run. | ||
self | ||
assert: analysis generalResult numberOfEvaluatedMutants | ||
equals: 2 | ||
] | ||
|
||
{ #category : #tests } | ||
MutationTestingTimeBudgetTest >> test13SecShouldEvaluate3Mutants [ | ||
|
||
budget constraint: (Duration seconds: 13). | ||
analysis run. | ||
self | ||
assert: analysis generalResult numberOfEvaluatedMutants | ||
equals: 3 | ||
] | ||
|
||
{ #category : #tests } | ||
MutationTestingTimeBudgetTest >> test30SecShouldEvaluate4Mutants [ | ||
|
||
budget constraint: (Duration seconds: 30). | ||
analysis run. | ||
self | ||
assert: analysis generalResult numberOfEvaluatedMutants | ||
equals: 4 | ||
] |