Skip to content
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

Renamed some classes #32

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CoveragePropagationPreparationTest >> testWorking [
testCasesFrom: { MutalkCIHelperTest }
mutating: { MutalkCIHelper }
using: MutantOperator contents
with: AllTestsMethodsRunningMutantEvaluationStrategy new.
with: AllTestsMethodsRunningTestSelectionStrategy new.
analysis run.

moreInfo := CoveragePropagationPreparation new
Expand Down
2 changes: 1 addition & 1 deletion src/MuTalk-CI-Tests/MutalkCITonelJsonExporterTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ MutalkCITonelJsonExporterTest >> testWorking [
testCasesFrom: { SmallBankTest }
mutating: { SmallBank }
using: MutantOperator contents
with: AllTestsMethodsRunningMutantEvaluationStrategy new.
with: AllTestsMethodsRunningTestSelectionStrategy new.
analysis run.
moreInfo := CoveragePropagationPreparation new
mtResult: analysis;
Expand Down
4 changes: 2 additions & 2 deletions src/MuTalk-CI/MutalkCI.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ MutalkCI >> mutateAll [
runMutalkTargets: targets
tests: tests
generationStrategy:
SelectingFromCoverageMutationsGenerationStrategy new
SelectingFromCoverageMutantSelectionStrategy new
]

{ #category : #'as yet unclassified' }
Expand Down Expand Up @@ -201,7 +201,7 @@ MutalkCI >> runMutalkTargets: targets tests: tests generationStrategy: generatio
testCasesFrom: tests
mutating: targets
using: MutantOperator contents
with: SelectingFromCoverageMutantEvaluationStrategy new
with: SelectingFromCoverageTestSelectionStrategy new
with: generationStrategy.
analysis run.
coverageInfo := self prepareCoverageInfo: analysis.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : #SelectingFromAlivesMutationsGenerationStrategy,
#superclass : #MutationsGenerationStrategy,
#superclass : #MutantSelectionStrategy,
#instVars : [
'analysis'
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Class {
#name : #AllMutationsGenerationStrategy,
#superclass : #MutationsGenerationStrategy,
#category : 'MuTalk-Model-Mutations generation strategies'
#name : #AllMutantSelectionStrategy,
#superclass : #MutantSelectionStrategy,
#category : #'MuTalk-Model-Mutations generation strategies'
}

{ #category : #generating }
AllMutationsGenerationStrategy >> classesAndMetaclassesFrom: modelClasses [
AllMutantSelectionStrategy >> classesAndMetaclassesFrom: modelClasses [
^ modelClasses
inject: OrderedCollection new
into: [:classes :aClass |
Expand All @@ -15,7 +15,7 @@ AllMutationsGenerationStrategy >> classesAndMetaclassesFrom: modelClasses [
]

{ #category : #generating }
AllMutationsGenerationStrategy >> methodsToMutateFrom: aMutationTestingAnalysis [
AllMutantSelectionStrategy >> methodsToMutateFrom: aMutationTestingAnalysis [
^ (self classesAndMetaclassesFrom: aMutationTestingAnalysis modelClasses)
inject: OrderedCollection new
into: [:methods :aClass |
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Class {
#name : #AllTestsMethodsRunningTestSelectionStrategy,
#superclass : #TestSelectionStrategy,
#category : #'MuTalk-Model-Mutant evaluation strategies'
}

{ #category : #private }
AllTestsMethodsRunningTestSelectionStrategy >> testCasesToEvaluate: aMutation for: aMutantEvaluation [
^aMutantEvaluation testCases.

]
38 changes: 0 additions & 38 deletions src/MuTalk-Model/FixedRandomMutantSelection.class.st

This file was deleted.

38 changes: 38 additions & 0 deletions src/MuTalk-Model/FixedRandomMutantSelectionStrategy.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Class {
#name : #FixedRandomMutantSelectionStrategy,
#superclass : #RandomMutantSelectionStrategy,
#instVars : [
'numberOfMutants'
],
#category : #'MuTalk-Model-Mutations generation strategies'
}

{ #category : #accessing }
FixedRandomMutantSelectionStrategy >> highLimitCondition: aSize [

^ aSize <= self numberOfMutants
]

{ #category : #accessing }
FixedRandomMutantSelectionStrategy >> lowLimitCondition [

^ self numberOfMutants = 0
]

{ #category : #accessing }
FixedRandomMutantSelectionStrategy >> numberOfMutants [

^ numberOfMutants
]

{ #category : #accessing }
FixedRandomMutantSelectionStrategy >> numberOfMutants: aNumber [

numberOfMutants := aNumber
]

{ #category : #accessing }
FixedRandomMutantSelectionStrategy >> totalNumberOfMutants: aSize [

^ self numberOfMutants
]
20 changes: 20 additions & 0 deletions src/MuTalk-Model/ManualMutantSelectionStrategy.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Class {
#name : #ManualMutantSelectionStrategy,
#superclass : #MutantSelectionStrategy,
#instVars : [
'targetMethods'
],
#category : #'MuTalk-Model-Mutations generation strategies'
}

{ #category : #generating }
ManualMutantSelectionStrategy >> methodsToMutateFrom: aMutationTestingAnalysis [

^ targetMethods
]

{ #category : #accessing }
ManualMutantSelectionStrategy >> targetMethods: anObject [

targetMethods := anObject
]
20 changes: 0 additions & 20 deletions src/MuTalk-Model/ManualMutationsGenerationStrategy.class.st

This file was deleted.

15 changes: 0 additions & 15 deletions src/MuTalk-Model/MutantEvaluationStrategy.class.st

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
Class {
#name : #MutationsGenerationStrategy,
#name : #MutantSelectionStrategy,
#superclass : #Object,
#category : 'MuTalk-Model-Mutations generation strategies'
#category : #'MuTalk-Model-Mutations generation strategies'
}

{ #category : #generating }
MutationsGenerationStrategy >> methodsToMutateFrom:aMutationTestingAnalysis [
MutantSelectionStrategy >> methodsToMutateFrom:aMutationTestingAnalysis [
self subclassResponsibility.
]

{ #category : #generating }
MutationsGenerationStrategy >> mutationsFor: aMutationTestingAnalysis [
MutantSelectionStrategy >> mutationsFor: aMutationTestingAnalysis [
^ self
mutationsFor: aMutationTestingAnalysis
loggingIn: self nullLogger
]

{ #category : #generating }
MutationsGenerationStrategy >> mutationsFor: aMutationTestingAnalysis loggingIn: aLogger [
MutantSelectionStrategy >> mutationsFor: aMutationTestingAnalysis loggingIn: aLogger [
| mutations |
mutations := OrderedCollection new.
(self methodsToMutateFrom: aMutationTestingAnalysis)
Expand All @@ -32,7 +32,7 @@ MutationsGenerationStrategy >> mutationsFor: aMutationTestingAnalysis loggingIn:
]

{ #category : #generating }
MutationsGenerationStrategy >> mutationsFor: aMethod usingAll: aCollectionOfMutantOperators logginIn: aLogger [
MutantSelectionStrategy >> mutationsFor: aMethod usingAll: aCollectionOfMutantOperators logginIn: aLogger [
| parseTree |
parseTree := aMethod parseTree.
^ aCollectionOfMutantOperators
Expand All @@ -45,7 +45,7 @@ MutationsGenerationStrategy >> mutationsFor: aMethod usingAll: aCollectionOfMuta
]

{ #category : #logging }
MutationsGenerationStrategy >> nullLogger [
MutantSelectionStrategy >> nullLogger [

^ NullMutationTestingAnalysisLogger new.
]
4 changes: 2 additions & 2 deletions src/MuTalk-Model/MutationTestingAnalysis.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ MutationTestingAnalysis class >> defaultLogger [

{ #category : #defaults }
MutationTestingAnalysis class >> defaultMutantsEvaluationStrategy [
^ AllTestsMethodsRunningMutantEvaluationStrategy new
^ AllTestsMethodsRunningTestSelectionStrategy new
]

{ #category : #defaults }
MutationTestingAnalysis class >> defaultMutationsGenerationStrategy [
^ AllMutationsGenerationStrategy new.
^ AllMutantSelectionStrategy new.
]

{ #category : #'instance creation' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
Class {
#name : #PercentRandomMutantSelection,
#superclass : #RandomMutantSelection,
#name : #PercentRandomMutantSelectionStrategy,
#superclass : #RandomMutantSelectionStrategy,
#instVars : [
'percentageOfMutants'
],
#category : #'MuTalk-Model-Mutations generation strategies'
}

{ #category : #accessing }
PercentRandomMutantSelection >> highLimitCondition: size [
PercentRandomMutantSelectionStrategy >> highLimitCondition: size [

^ percentageOfMutants = 100
]

{ #category : #accessing }
PercentRandomMutantSelection >> lowLimitCondition [
PercentRandomMutantSelectionStrategy >> lowLimitCondition [

^ percentageOfMutants = 0
]

{ #category : #accessing }
PercentRandomMutantSelection >> percentageOfMutants [
PercentRandomMutantSelectionStrategy >> percentageOfMutants [

^ percentageOfMutants
]

{ #category : #accessing }
PercentRandomMutantSelection >> percentageOfMutants: aPercentage [
PercentRandomMutantSelectionStrategy >> percentageOfMutants: aPercentage [

(aPercentage < 0 or: [ aPercentage > 100 ]) ifTrue: [
Error signal: 'Percantage should be between 0 and 100' ].
percentageOfMutants := aPercentage
]

{ #category : #accessing }
PercentRandomMutantSelection >> totalNumberOfMutants: aSize [
PercentRandomMutantSelectionStrategy >> totalNumberOfMutants: aSize [

^ percentageOfMutants * aSize / 100
]
Loading
Loading