Skip to content

Commit

Permalink
Merge pull request #47 from DurieuxPol/fix/38
Browse files Browse the repository at this point in the history
Added test for not exact percentage mutant selection
  • Loading branch information
guillep authored Dec 15, 2023
2 parents af6ffb1 + 9b20a74 commit df45cc4
Showing 1 changed file with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,42 @@ MutationTestingPercentageOfMutantsBudgetTest >> testEvaluateAllMutantsWithMoreTh
]

{ #category : 'tests' }
MutationTestingPercentageOfMutantsBudgetTest >> testEvaluateTheCorrectPercentageOfMutants [
MutationTestingPercentageOfMutantsBudgetTest >> testEvaluateZeroPercentOfMutantsWithNegativePercentConstraint [

self runAnalysisFor: 20.
self runAnalysisFor: -10.
self
assert:
analysis generalResult numberOfEvaluatedMutants / numberOfMutations * 100
equals: 20
equals: 0
]

{ #category : 'tests' }
MutationTestingPercentageOfMutantsBudgetTest >> testEvaluateZeroPercentOfMutantsWithNegativePercentConstraint [
MutationTestingPercentageOfMutantsBudgetTest >> testEvaluateZeroPercentOfMutantsWithZeroPercentConstraint [

self runAnalysisFor: -10.
self runAnalysisFor: 0.
self
assert:
analysis generalResult numberOfEvaluatedMutants / numberOfMutations * 100
equals: 0
]

{ #category : 'tests' }
MutationTestingPercentageOfMutantsBudgetTest >> testEvaluateZeroPercentOfMutantsWithZeroPercentConstraint [
MutationTestingPercentageOfMutantsBudgetTest >> testExactPercentageOfMutants [

self runAnalysisFor: 0.
self runAnalysisFor: 20.
self
assert:
analysis generalResult numberOfEvaluatedMutants / numberOfMutations * 100
equals: 0
equals: 20
]

{ #category : 'tests' }
MutationTestingPercentageOfMutantsBudgetTest >> testNonExactPercentageOfMutants [

self runAnalysisFor: 21.
self assert:
analysis generalResult numberOfEvaluatedMutants / numberOfMutations * 100 >= 21.
self
assert: analysis generalResult numberOfEvaluatedMutants
equals: 6
]

0 comments on commit df45cc4

Please sign in to comment.