-
Notifications
You must be signed in to change notification settings - Fork 14
Improvements to RandomMutantSelectionStrategyTest #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
00a42d2
Added = method for method mutations, and used it in compareMutationsO…
f56478f
changed tests
3d12b55
add hash method and update comments
3039baa
update methods, add comments, rename classes
6717812
protocol fix
9f63a6c
add comments
80fee12
add condition in =
1a7eae5
using a set of mutant collections
ccc79a7
add template method
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.