Skip to content

Commit

Permalink
change for retrocompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Durieux Pol committed Mar 21, 2024
1 parent 3662fdc commit 7f1df54
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ MTRandomClassMutantSelectionStrategyTest >> testAround33PercentOfMutantsForEachC
mutations := analysis generateMutations truncateTo: maximum.
mutationsDic := (mutations groupedBy: #originalClass) collect: [
:mutationList | "Here we divide the number of mutants for each class by the total of mutants to obtain a percentage, and we check if it's close to the theoretical 1/3 with a precision of 0.1, because the small number of mutants can induce a quite large gap"
mutationList size / maximum asFloat
closeTo: 1 / 3 asFloat
precision: 0.1 ].
(mutationList size / maximum asFloat
- (1 / 3 asFloat)) abs <= 0.1 ].

self assert:
(mutationsDic values fold: [ :bool1 :bool2 | bool1 and: bool2 ])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ MTRandomMethodMutantSelectionStrategyTest >> testAround25PercentOfMutantsForEach
mutations := analysis generateMutations truncateTo: maximum.
mutationsDic := (mutations groupedBy: #originalMethod) collect: [
:mutationList | "Here we divide the number of mutants for each method by the total of mutants to obtain a percentage, and we check if it's close to the theoretical 1/4 with a precision of 0.1, because the small number of mutants can induce a quite large gap"
mutationList size / maximum asFloat
closeTo: 0.25
precision: 0.1 ].
(mutationList size / maximum asFloat - 0.25) abs
<= 0.1 ].

self assert:
(mutationsDic values fold: [ :bool1 :bool2 | bool1 and: bool2 ])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ MTRandomOperatorMutantSelectionStrategyTest >> testAroundOneSeventhPercentOfMuta
for: MTRandomOperatorMutantSelectionStrategy new
andSeed: seed).

mutations := analysis generateMutations truncateTo: 210.
mutations := analysis generateMutations truncateTo: maximum.
mutationsDic := (mutations groupedBy: #operator) collect: [
:mutationList | "Here we divide the number of mutants for each operator by the total of mutants to obtain a percentage, and we check if it's close to the theoretical 1/7 with a precision of 0.1, because the small number of mutants can induce a quite large gap"
mutationList size / maximum asFloat
closeTo: 1 / 7 asFloat
precision: 0.1 ].
(mutationList size / maximum asFloat
- (1 / 7 asFloat)) abs <= 0.1 ].

self assert:
(mutationsDic values fold: [ :bool1 :bool2 | bool1 and: bool2 ])
Expand Down

0 comments on commit 7f1df54

Please sign in to comment.