-
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 #48 from DurieuxPol/fix/4142
Refactored and renamed classes and methods for budgets
- Loading branch information
Showing
17 changed files
with
125 additions
and
139 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Class { | ||
#name : 'MTBudget', | ||
#superclass : 'Object', | ||
#instVars : [ | ||
'constraint' | ||
], | ||
#category : 'MuTalk-Model', | ||
#package : 'MuTalk-Model' | ||
} | ||
|
||
{ #category : 'instance creation' } | ||
MTBudget class >> for: aConstraint [ | ||
|
||
^ self new | ||
constraint: aConstraint; | ||
yourself | ||
] | ||
|
||
{ #category : 'accessing' } | ||
MTBudget >> constraint [ | ||
|
||
^ constraint | ||
] | ||
|
||
{ #category : 'accessing' } | ||
MTBudget >> constraint: aConstraint [ | ||
|
||
constraint := aConstraint | ||
] | ||
|
||
{ #category : 'validation' } | ||
MTBudget >> exceedBudgetOn: partialCollection considering: initialCollection [ | ||
"Returns true if partialCollection exceed the budget (the time is over, there is enough mutants, etc). Some budgets need data on initialCollection (e.g. percentage budget needs the size)" | ||
|
||
^ self subclassResponsibility | ||
] | ||
|
||
{ #category : 'accessing' } | ||
MTBudget >> start [ | ||
"Does nothing for most budgets because they don't need specific data at the start of the execution of the mutation testing analysis, but some do (time budget for example). | ||
In this case, this method should be overriden." | ||
|
||
|
||
] |
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 : 'MTFixedNumberOfMutantsBudget', | ||
#superclass : 'MTBudget', | ||
#category : 'MuTalk-Model', | ||
#package : 'MuTalk-Model' | ||
} | ||
|
||
{ #category : 'validation' } | ||
MTFixedNumberOfMutantsBudget >> exceedBudgetOn: partialCollection considering: initialCollection [ | ||
|
||
^ partialCollection size >= constraint | ||
] |
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,13 @@ | ||
Class { | ||
#name : 'MTFreeBudget', | ||
#superclass : 'MTBudget', | ||
#category : 'MuTalk-Model', | ||
#package : 'MuTalk-Model' | ||
} | ||
|
||
{ #category : 'validation' } | ||
MTFreeBudget >> exceedBudgetOn: partialCollection considering: initialCollection [ | ||
"Since this budget have no constraint, the budget is never exceeded" | ||
|
||
^ false | ||
] |
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,13 @@ | ||
Class { | ||
#name : 'MTPercentageOfMutantsBudget', | ||
#superclass : 'MTBudget', | ||
#category : 'MuTalk-Model', | ||
#package : 'MuTalk-Model' | ||
} | ||
|
||
{ #category : 'validation' } | ||
MTPercentageOfMutantsBudget >> exceedBudgetOn: partialCollection considering: initialCollection [ | ||
|
||
^ partialCollection size | ||
>= (constraint / 100 * initialCollection size) | ||
] |
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
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
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
src/MuTalk-Model/MutationTestingFixedNumberOfMutantsBudget.class.st
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
src/MuTalk-Model/MutationTestingPercentageOfMutantsBudget.class.st
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...iarClassForMutationTestingBudget.class.st → ...sources/AuxiliarClassForMTBudget.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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
Class { | ||
#name : 'AuxiliarClassForMutationTestingBudget', | ||
#name : 'AuxiliarClassForMTBudget', | ||
#superclass : 'Object', | ||
#category : 'MuTalk-TestResources', | ||
#package : 'MuTalk-TestResources' | ||
} | ||
|
||
{ #category : 'arithmetic' } | ||
AuxiliarClassForMutationTestingBudget >> nil [ | ||
AuxiliarClassForMTBudget >> nil [ | ||
|
||
^ nil | ||
] |
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
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
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
Oops, something went wrong.