Skip to content

Commit

Permalink
fix random selection tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Durieux Pol committed Apr 5, 2024
1 parent 3f5e340 commit 06b8c50
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ MTRandomClassMutantSelectionStrategyTest >> testAround33PercentOfMutantsForEachC
MTAuxiliarClassForRandomClassMutantSelectionStrategy2.
MTAuxiliarClassForRandomClassMutantSelectionStrategy3 };
testClasses: { };
operators: MTAbstractMutantOperator contentsAll;
mutantGenerationStrategy:
(MTRandomClassMutantSelectionStrategy withSeed: seed).
operators: MTAbstractMutantOperator contentsAll.
analysis mutantGenerationStrategy mutantSelectionStrategy:
(MTRandomClassMutantSelectionStrategy withSeed: seed).

mutations := analysis generateMutations first: 100.
mutationsDic := (mutations groupedBy: #originalClass) collect: #size.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ MTRandomMethodMutantSelectionStrategyTest >> testAround25PercentOfMutantsForEach
classesToMutate:
{ MTAuxiliarClassForRandomMethodMutantSelectionStrategy };
testClasses: { };
operators: MTAbstractMutantOperator contentsAll;
mutantGenerationStrategy:
(MTRandomMethodMutantSelectionStrategy withSeed: seed).
operators: MTAbstractMutantOperator contentsAll.
analysis mutantGenerationStrategy mutantSelectionStrategy:
(MTRandomMethodMutantSelectionStrategy withSeed: seed).

mutations := analysis generateMutations first: 100.
mutationsDic := (mutations groupedBy: #originalMethod) collect: #size.
Expand Down
9 changes: 4 additions & 5 deletions src/MuTalk-Tests/MTRandomMutantSelectionStrategyTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ MTRandomMutantSelectionStrategyTest >> testAtLeastTwoDifferentMutantCollectionsA
mutationsSet := Set new.
1 to: 5 do: [ :i |
analysis := MTAnalysis new
testClasses:
{ MTAuxiliarClassForMTAnalysisTest };
classesToMutate:
{ MTAuxiliarClassForMTAnalysis };
mutantGenerationStrategy: self classToTest new.
testClasses: { MTAuxiliarClassForMTAnalysisTest };
classesToMutate: { MTAuxiliarClassForMTAnalysis }.
analysis mutantGenerationStrategy mutantSelectionStrategy:
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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ MTRandomOperatorMutantSelectionStrategyTest >> testAroundOneSeventhPercentOfMuta
classesToMutate:
{ MTAuxiliarClassForRandomOperatorMutantSelectionStrategy };
testClasses: { };
operators: MTAbstractMutantOperator contentsAll;
mutantGenerationStrategy:
(MTRandomOperatorMutantSelectionStrategy withSeed: seed).
operators: MTAbstractMutantOperator contentsAll.
analysis mutantGenerationStrategy mutantSelectionStrategy:
(MTRandomOperatorMutantSelectionStrategy withSeed: seed).

mutations := analysis generateMutations first: 210.
mutationsDic := (mutations groupedBy: #operator) collect: #size.
Expand Down

0 comments on commit 06b8c50

Please sign in to comment.