-
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.
Merge pull request #46 from DurieuxPol/fix/issues
Improvements to RandomMutantSelectionStrategyTest
- Loading branch information
Showing
5 changed files
with
81 additions
and
56 deletions.
There are no files selected for viewing
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
43 changes: 43 additions & 0 deletions
43
src/MuTalk-Tests/RandomMutantSelectionStrategyTest.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,43 @@ | ||
Class { | ||
#name : 'RandomMutantSelectionStrategyTest', | ||
#superclass : 'TestCase', | ||
#category : 'MuTalk-Tests', | ||
#package : 'MuTalk-Tests' | ||
} | ||
|
||
{ #category : 'accessing' } | ||
RandomMutantSelectionStrategyTest >> classToTest [ | ||
|
||
^ RandomMutantSelectionStrategy | ||
] | ||
|
||
{ #category : 'tests' } | ||
RandomMutantSelectionStrategyTest >> testAtLeastTwoDifferentMutantCollectionsAmongFive [ | ||
"This test is to ensure that RandomMutantSelectionStrategy doesn't always produce the same mutant collections. | ||
If it can produce at least two different collections, we assume it correctly randomize the inital mutant collection. | ||
Here, two mutant collections are differents when their mutants are not in the same order." | ||
|
||
| analysis mutationsSet | | ||
"mutationsSet is a set of mutant collections" | ||
mutationsSet := Set new. | ||
1 to: 5 do: [ :i | | ||
analysis := MutationTestingAnalysis | ||
testCasesFrom: | ||
{ AuxiliarClassForMutationTestingAnalysisTest } | ||
mutating: { AuxiliarClassForMutationTestingAnalysis } | ||
using: MutantOperator contents | ||
with: AllTestsMethodsRunningTestSelectionStrategy new | ||
with: self classToTest new. | ||
mutationsSet add: analysis generateMutations ]. | ||
|
||
"If the size of the set is at least 2, there is at least 2 different mutant collections, so at least 2 different orders of mutants." | ||
self assert: mutationsSet size >= 2 | ||
] | ||
|
||
{ #category : 'tests' } | ||
RandomMutantSelectionStrategyTest >> testDefaultMutationsGenerationStrategyIsAllMutantSelectionStrategy [ | ||
|
||
self | ||
assert: self classToTest new mutationsGenerationStrategy species | ||
equals: AllMutantSelectionStrategy new species | ||
] |
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
src/MuTalk-Tests/RandomOperatorMutantSelectionStrategyTest.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,12 @@ | ||
Class { | ||
#name : 'RandomOperatorMutantSelectionStrategyTest', | ||
#superclass : 'RandomMutantSelectionStrategyTest', | ||
#category : 'MuTalk-Tests', | ||
#package : 'MuTalk-Tests' | ||
} | ||
|
||
{ #category : 'accessing' } | ||
RandomOperatorMutantSelectionStrategyTest >> classToTest [ | ||
|
||
^ RandomOperatorMutantSelectionStrategy | ||
] |
This file was deleted.
Oops, something went wrong.