From 5b32188c99af0f9553b2775189219c2859a6559c Mon Sep 17 00:00:00 2001 From: Durieux Pol Date: Thu, 30 Nov 2023 16:08:56 +0100 Subject: [PATCH 1/3] Renamed MutantEvaluationStrategy to TestSelectionStrategy, and MutationsGenerationStrategy to MutantSelectionStrategy --- ...overagePropagationPreparationTest.class.st | 2 +- .../MutalkCITonelJsonExporterTest.class.st | 2 +- src/MuTalk-CI/MutalkCI.class.st | 4 ++-- ...AlivesMutationsGenerationStrategy.class.st | 2 +- ...st => AllMutantSelectionStrategy.class.st} | 10 +++++----- ...dsRunningMutantEvaluationStrategy.class.st | 11 ---------- ...thodsRunningTestSelectionStrategy.class.st | 11 ++++++++++ .../ManualMutantSelectionStrategy.class.st | 20 +++++++++++++++++++ ...ManualMutationsGenerationStrategy.class.st | 20 ------------------- .../MutantEvaluationStrategy.class.st | 15 -------------- ...ss.st => MutantSelectionStrategy.class.st} | 14 ++++++------- .../MutationTestingAnalysis.class.st | 4 ++-- .../RandomMutantSelection.class.st | 2 +- ...mCoverageMutantEvaluationStrategy.class.st | 10 ---------- ...omCoverageMutantSelectionStrategy.class.st | 10 ++++++++++ ...verageMutationsGenerationStrategy.class.st | 10 ---------- ...FromCoverageTestSelectionStrategy.class.st | 10 ++++++++++ ...bbornOnlyMutantSelectionStrategy.class.st} | 8 ++++---- .../TestSelectionStrategy.class.st | 15 ++++++++++++++ ...nningMutantEvaluationStrategyTest.class.st | 2 +- .../MutantEvaluationStrategyTest.class.st | 2 +- .../MutantGenerationStrategyTest.class.st | 6 +++--- .../RandomMutantSelectionTest.class.st | 2 +- 23 files changed, 96 insertions(+), 96 deletions(-) rename src/MuTalk-Model/{AllMutationsGenerationStrategy.class.st => AllMutantSelectionStrategy.class.st} (56%) delete mode 100644 src/MuTalk-Model/AllTestsMethodsRunningMutantEvaluationStrategy.class.st create mode 100644 src/MuTalk-Model/AllTestsMethodsRunningTestSelectionStrategy.class.st create mode 100644 src/MuTalk-Model/ManualMutantSelectionStrategy.class.st delete mode 100644 src/MuTalk-Model/ManualMutationsGenerationStrategy.class.st delete mode 100644 src/MuTalk-Model/MutantEvaluationStrategy.class.st rename src/MuTalk-Model/{MutationsGenerationStrategy.class.st => MutantSelectionStrategy.class.st} (67%) delete mode 100644 src/MuTalk-Model/SelectingFromCoverageMutantEvaluationStrategy.class.st create mode 100644 src/MuTalk-Model/SelectingFromCoverageMutantSelectionStrategy.class.st delete mode 100644 src/MuTalk-Model/SelectingFromCoverageMutationsGenerationStrategy.class.st create mode 100644 src/MuTalk-Model/SelectingFromCoverageTestSelectionStrategy.class.st rename src/MuTalk-Model/{StubbornOnlyMutationsGenerationStrategy.class.st => StubbornOnlyMutantSelectionStrategy.class.st} (66%) create mode 100644 src/MuTalk-Model/TestSelectionStrategy.class.st diff --git a/src/MuTalk-CI-Tests/CoveragePropagationPreparationTest.class.st b/src/MuTalk-CI-Tests/CoveragePropagationPreparationTest.class.st index b7aecf08..1f59504a 100644 --- a/src/MuTalk-CI-Tests/CoveragePropagationPreparationTest.class.st +++ b/src/MuTalk-CI-Tests/CoveragePropagationPreparationTest.class.st @@ -15,7 +15,7 @@ CoveragePropagationPreparationTest >> testWorking [ testCasesFrom: { MutalkCIHelperTest } mutating: { MutalkCIHelper } using: MutantOperator contents - with: AllTestsMethodsRunningMutantEvaluationStrategy new. + with: AllTestsMethodsRunningTestSelectionStrategy new. analysis run. moreInfo := CoveragePropagationPreparation new diff --git a/src/MuTalk-CI-Tests/MutalkCITonelJsonExporterTest.class.st b/src/MuTalk-CI-Tests/MutalkCITonelJsonExporterTest.class.st index f6974084..a3e739d0 100644 --- a/src/MuTalk-CI-Tests/MutalkCITonelJsonExporterTest.class.st +++ b/src/MuTalk-CI-Tests/MutalkCITonelJsonExporterTest.class.st @@ -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; diff --git a/src/MuTalk-CI/MutalkCI.class.st b/src/MuTalk-CI/MutalkCI.class.st index 02d65cb1..09d04b42 100644 --- a/src/MuTalk-CI/MutalkCI.class.st +++ b/src/MuTalk-CI/MutalkCI.class.st @@ -144,7 +144,7 @@ MutalkCI >> mutateAll [ runMutalkTargets: targets tests: tests generationStrategy: - SelectingFromCoverageMutationsGenerationStrategy new + SelectingFromCoverageMutantSelectionStrategy new ] { #category : #'as yet unclassified' } @@ -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. diff --git a/src/MuTalk-CI/SelectingFromAlivesMutationsGenerationStrategy.class.st b/src/MuTalk-CI/SelectingFromAlivesMutationsGenerationStrategy.class.st index 4f5b0fe4..79764720 100644 --- a/src/MuTalk-CI/SelectingFromAlivesMutationsGenerationStrategy.class.st +++ b/src/MuTalk-CI/SelectingFromAlivesMutationsGenerationStrategy.class.st @@ -1,6 +1,6 @@ Class { #name : #SelectingFromAlivesMutationsGenerationStrategy, - #superclass : #MutationsGenerationStrategy, + #superclass : #MutantSelectionStrategy, #instVars : [ 'analysis' ], diff --git a/src/MuTalk-Model/AllMutationsGenerationStrategy.class.st b/src/MuTalk-Model/AllMutantSelectionStrategy.class.st similarity index 56% rename from src/MuTalk-Model/AllMutationsGenerationStrategy.class.st rename to src/MuTalk-Model/AllMutantSelectionStrategy.class.st index 0f84af44..00729155 100644 --- a/src/MuTalk-Model/AllMutationsGenerationStrategy.class.st +++ b/src/MuTalk-Model/AllMutantSelectionStrategy.class.st @@ -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 | @@ -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 | diff --git a/src/MuTalk-Model/AllTestsMethodsRunningMutantEvaluationStrategy.class.st b/src/MuTalk-Model/AllTestsMethodsRunningMutantEvaluationStrategy.class.st deleted file mode 100644 index e22294a2..00000000 --- a/src/MuTalk-Model/AllTestsMethodsRunningMutantEvaluationStrategy.class.st +++ /dev/null @@ -1,11 +0,0 @@ -Class { - #name : #AllTestsMethodsRunningMutantEvaluationStrategy, - #superclass : #MutantEvaluationStrategy, - #category : 'MuTalk-Model-Mutant evaluation strategies' -} - -{ #category : #private } -AllTestsMethodsRunningMutantEvaluationStrategy >> testCasesToEvaluate: aMutation for: aMutantEvaluation [ - ^aMutantEvaluation testCases. - -] diff --git a/src/MuTalk-Model/AllTestsMethodsRunningTestSelectionStrategy.class.st b/src/MuTalk-Model/AllTestsMethodsRunningTestSelectionStrategy.class.st new file mode 100644 index 00000000..887c440c --- /dev/null +++ b/src/MuTalk-Model/AllTestsMethodsRunningTestSelectionStrategy.class.st @@ -0,0 +1,11 @@ +Class { + #name : #AllTestsMethodsRunningTestSelectionStrategy, + #superclass : #TestSelectionStrategy, + #category : #'MuTalk-Model-Mutant evaluation strategies' +} + +{ #category : #private } +AllTestsMethodsRunningTestSelectionStrategy >> testCasesToEvaluate: aMutation for: aMutantEvaluation [ + ^aMutantEvaluation testCases. + +] diff --git a/src/MuTalk-Model/ManualMutantSelectionStrategy.class.st b/src/MuTalk-Model/ManualMutantSelectionStrategy.class.st new file mode 100644 index 00000000..961c6f99 --- /dev/null +++ b/src/MuTalk-Model/ManualMutantSelectionStrategy.class.st @@ -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 +] diff --git a/src/MuTalk-Model/ManualMutationsGenerationStrategy.class.st b/src/MuTalk-Model/ManualMutationsGenerationStrategy.class.st deleted file mode 100644 index 94ea5bb3..00000000 --- a/src/MuTalk-Model/ManualMutationsGenerationStrategy.class.st +++ /dev/null @@ -1,20 +0,0 @@ -Class { - #name : #ManualMutationsGenerationStrategy, - #superclass : #MutationsGenerationStrategy, - #instVars : [ - 'targetMethods' - ], - #category : #'MuTalk-Model-Mutations generation strategies' -} - -{ #category : #generating } -ManualMutationsGenerationStrategy >> methodsToMutateFrom: aMutationTestingAnalysis [ - - ^ targetMethods -] - -{ #category : #accessing } -ManualMutationsGenerationStrategy >> targetMethods: anObject [ - - targetMethods := anObject -] diff --git a/src/MuTalk-Model/MutantEvaluationStrategy.class.st b/src/MuTalk-Model/MutantEvaluationStrategy.class.st deleted file mode 100644 index b0247d70..00000000 --- a/src/MuTalk-Model/MutantEvaluationStrategy.class.st +++ /dev/null @@ -1,15 +0,0 @@ -Class { - #name : #MutantEvaluationStrategy, - #superclass : #Object, - #category : 'MuTalk-Model-Mutant evaluation strategies' -} - -{ #category : #evaluating } -MutantEvaluationStrategy >> testCasesToEvaluate: aMutation for: aMutantEvaluation [ - self subclassResponsibility -] - -{ #category : #evaluating } -MutantEvaluationStrategy >> timeoutForTestsOf: aMutantEvaluation [ - ^aMutantEvaluation coverageAnalysisResult timeToRunTests * 3 -] diff --git a/src/MuTalk-Model/MutationsGenerationStrategy.class.st b/src/MuTalk-Model/MutantSelectionStrategy.class.st similarity index 67% rename from src/MuTalk-Model/MutationsGenerationStrategy.class.st rename to src/MuTalk-Model/MutantSelectionStrategy.class.st index 5d17843c..6bfdf319 100644 --- a/src/MuTalk-Model/MutationsGenerationStrategy.class.st +++ b/src/MuTalk-Model/MutantSelectionStrategy.class.st @@ -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) @@ -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 @@ -45,7 +45,7 @@ MutationsGenerationStrategy >> mutationsFor: aMethod usingAll: aCollectionOfMuta ] { #category : #logging } -MutationsGenerationStrategy >> nullLogger [ +MutantSelectionStrategy >> nullLogger [ ^ NullMutationTestingAnalysisLogger new. ] diff --git a/src/MuTalk-Model/MutationTestingAnalysis.class.st b/src/MuTalk-Model/MutationTestingAnalysis.class.st index 926f55ec..b46319a5 100644 --- a/src/MuTalk-Model/MutationTestingAnalysis.class.st +++ b/src/MuTalk-Model/MutationTestingAnalysis.class.st @@ -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' } diff --git a/src/MuTalk-Model/RandomMutantSelection.class.st b/src/MuTalk-Model/RandomMutantSelection.class.st index bff8a5e6..a8bb923b 100644 --- a/src/MuTalk-Model/RandomMutantSelection.class.st +++ b/src/MuTalk-Model/RandomMutantSelection.class.st @@ -29,7 +29,7 @@ RandomMutantSelection >> addMutantIn: newColl from: oldColl using: random and: a { #category : #'accessing-defaults' } RandomMutantSelection >> defaultMutationGenerationStrategy [ - ^ AllMutationsGenerationStrategy new + ^ AllMutantSelectionStrategy new ] { #category : #accessing } diff --git a/src/MuTalk-Model/SelectingFromCoverageMutantEvaluationStrategy.class.st b/src/MuTalk-Model/SelectingFromCoverageMutantEvaluationStrategy.class.st deleted file mode 100644 index 375a42fc..00000000 --- a/src/MuTalk-Model/SelectingFromCoverageMutantEvaluationStrategy.class.st +++ /dev/null @@ -1,10 +0,0 @@ -Class { - #name : #SelectingFromCoverageMutantEvaluationStrategy, - #superclass : #MutantEvaluationStrategy, - #category : 'MuTalk-Model-Mutant evaluation strategies' -} - -{ #category : #private } -SelectingFromCoverageMutantEvaluationStrategy >> testCasesToEvaluate: aMutation for: aMutantEvaluation [ - ^ aMutantEvaluation coverageAnalysisResult testCasesThatCovers: aMutation originalMethod -] diff --git a/src/MuTalk-Model/SelectingFromCoverageMutantSelectionStrategy.class.st b/src/MuTalk-Model/SelectingFromCoverageMutantSelectionStrategy.class.st new file mode 100644 index 00000000..e00e5b5c --- /dev/null +++ b/src/MuTalk-Model/SelectingFromCoverageMutantSelectionStrategy.class.st @@ -0,0 +1,10 @@ +Class { + #name : #SelectingFromCoverageMutantSelectionStrategy, + #superclass : #MutantSelectionStrategy, + #category : #'MuTalk-Model-Mutations generation strategies' +} + +{ #category : #generating } +SelectingFromCoverageMutantSelectionStrategy >> methodsToMutateFrom: aMutationTestingAnalysis [ + ^aMutationTestingAnalysis coverageAnalysisResult coveredMethods. +] diff --git a/src/MuTalk-Model/SelectingFromCoverageMutationsGenerationStrategy.class.st b/src/MuTalk-Model/SelectingFromCoverageMutationsGenerationStrategy.class.st deleted file mode 100644 index d61a33ac..00000000 --- a/src/MuTalk-Model/SelectingFromCoverageMutationsGenerationStrategy.class.st +++ /dev/null @@ -1,10 +0,0 @@ -Class { - #name : #SelectingFromCoverageMutationsGenerationStrategy, - #superclass : #MutationsGenerationStrategy, - #category : 'MuTalk-Model-Mutations generation strategies' -} - -{ #category : #generating } -SelectingFromCoverageMutationsGenerationStrategy >> methodsToMutateFrom: aMutationTestingAnalysis [ - ^aMutationTestingAnalysis coverageAnalysisResult coveredMethods. -] diff --git a/src/MuTalk-Model/SelectingFromCoverageTestSelectionStrategy.class.st b/src/MuTalk-Model/SelectingFromCoverageTestSelectionStrategy.class.st new file mode 100644 index 00000000..68c09205 --- /dev/null +++ b/src/MuTalk-Model/SelectingFromCoverageTestSelectionStrategy.class.st @@ -0,0 +1,10 @@ +Class { + #name : #SelectingFromCoverageTestSelectionStrategy, + #superclass : #TestSelectionStrategy, + #category : #'MuTalk-Model-Mutant evaluation strategies' +} + +{ #category : #private } +SelectingFromCoverageTestSelectionStrategy >> testCasesToEvaluate: aMutation for: aMutantEvaluation [ + ^ aMutantEvaluation coverageAnalysisResult testCasesThatCovers: aMutation originalMethod +] diff --git a/src/MuTalk-Model/StubbornOnlyMutationsGenerationStrategy.class.st b/src/MuTalk-Model/StubbornOnlyMutantSelectionStrategy.class.st similarity index 66% rename from src/MuTalk-Model/StubbornOnlyMutationsGenerationStrategy.class.st rename to src/MuTalk-Model/StubbornOnlyMutantSelectionStrategy.class.st index 361eb25c..eb286668 100644 --- a/src/MuTalk-Model/StubbornOnlyMutationsGenerationStrategy.class.st +++ b/src/MuTalk-Model/StubbornOnlyMutantSelectionStrategy.class.st @@ -1,11 +1,11 @@ Class { - #name : #StubbornOnlyMutationsGenerationStrategy, - #superclass : #SelectingFromCoverageMutationsGenerationStrategy, + #name : #StubbornOnlyMutantSelectionStrategy, + #superclass : #SelectingFromCoverageMutantSelectionStrategy, #category : #'MuTalk-Model-Mutations generation strategies' } { #category : #generating } -StubbornOnlyMutationsGenerationStrategy >> mutationsFor: aMutationTestingAnalysis loggingIn: aLogger [ +StubbornOnlyMutantSelectionStrategy >> mutationsFor: aMutationTestingAnalysis loggingIn: aLogger [ | mutations subSuite trivialAnalysis | mutations := super mutationsFor: aMutationTestingAnalysis loggingIn: aLogger. @@ -20,7 +20,7 @@ StubbornOnlyMutationsGenerationStrategy >> mutationsFor: aMutationTestingAnalysi trivialAnalysis testCases: subSuite; mutations: mutations; - mutantsEvaluationStrategy: AllTestsMethodsRunningMutantEvaluationStrategy new. + mutantsEvaluationStrategy: AllTestsMethodsRunningTestSelectionStrategy new. trivialAnalysis generateResults. 1halt. diff --git a/src/MuTalk-Model/TestSelectionStrategy.class.st b/src/MuTalk-Model/TestSelectionStrategy.class.st new file mode 100644 index 00000000..6e4e2682 --- /dev/null +++ b/src/MuTalk-Model/TestSelectionStrategy.class.st @@ -0,0 +1,15 @@ +Class { + #name : #TestSelectionStrategy, + #superclass : #Object, + #category : #'MuTalk-Model-Mutant evaluation strategies' +} + +{ #category : #evaluating } +TestSelectionStrategy >> testCasesToEvaluate: aMutation for: aMutantEvaluation [ + self subclassResponsibility +] + +{ #category : #evaluating } +TestSelectionStrategy >> timeoutForTestsOf: aMutantEvaluation [ + ^aMutantEvaluation coverageAnalysisResult timeToRunTests * 3 +] diff --git a/src/MuTalk-Tests/AllTestsMethodsRunningMutantEvaluationStrategyTest.class.st b/src/MuTalk-Tests/AllTestsMethodsRunningMutantEvaluationStrategyTest.class.st index c2ce1fea..b3efedee 100644 --- a/src/MuTalk-Tests/AllTestsMethodsRunningMutantEvaluationStrategyTest.class.st +++ b/src/MuTalk-Tests/AllTestsMethodsRunningMutantEvaluationStrategyTest.class.st @@ -31,5 +31,5 @@ AllTestsMethodsRunningMutantEvaluationStrategyTest >> assertMutantNotInCoverageO { #category : #configuring } AllTestsMethodsRunningMutantEvaluationStrategyTest >> selectionStrategy [ - ^ AllTestsMethodsRunningMutantEvaluationStrategy + ^ AllTestsMethodsRunningTestSelectionStrategy ] diff --git a/src/MuTalk-Tests/MutantEvaluationStrategyTest.class.st b/src/MuTalk-Tests/MutantEvaluationStrategyTest.class.st index 36b515b3..66c00cda 100644 --- a/src/MuTalk-Tests/MutantEvaluationStrategyTest.class.st +++ b/src/MuTalk-Tests/MutantEvaluationStrategyTest.class.st @@ -71,7 +71,7 @@ MutantEvaluationStrategyTest >> setUp [ mutating: classes using: (Set with: operator) with: evaluationStrategy - with: AllMutationsGenerationStrategy new. + with: AllMutantSelectionStrategy new. mutationTestingAnalysis generateCoverageAnalysis. ] diff --git a/src/MuTalk-Tests/MutantGenerationStrategyTest.class.st b/src/MuTalk-Tests/MutantGenerationStrategyTest.class.st index 8acb2e3b..aa893d24 100644 --- a/src/MuTalk-Tests/MutantGenerationStrategyTest.class.st +++ b/src/MuTalk-Tests/MutantGenerationStrategyTest.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'resource' ], - #category : 'MuTalk-Tests' + #category : #'MuTalk-Tests' } { #category : #testing } @@ -16,8 +16,8 @@ MutantGenerationStrategyTest >> testSelectingFromCoverageMutationsGenerationShou for: (MutationTestingAnalysis testCasesReferencesFrom: AuxiliarTestClassForTestingStrategies) mutating: classes using: (Set with: operator) - with: AllTestsMethodsRunningMutantEvaluationStrategy new - with: SelectingFromCoverageMutationsGenerationStrategy new. + with: AllTestsMethodsRunningTestSelectionStrategy new + with: SelectingFromCoverageMutantSelectionStrategy new. mutationTestingAnalysis run. self assert: ((mutationTestingAnalysis mutations collect: [ :each | each originalMethod selector ]) includes: #method1). self deny: ((mutationTestingAnalysis mutations collect: [ :each | each originalMethod selector ]) includes: #aNotCoveredMethod) diff --git a/src/MuTalk-Tests/RandomMutantSelectionTest.class.st b/src/MuTalk-Tests/RandomMutantSelectionTest.class.st index e63b5399..1e1a8f79 100644 --- a/src/MuTalk-Tests/RandomMutantSelectionTest.class.st +++ b/src/MuTalk-Tests/RandomMutantSelectionTest.class.st @@ -9,5 +9,5 @@ RandomMutantSelectionTest >> testDefaultMutationsGenerationStrategy [ self assert: RandomMutantSelection new mutationsGenerationStrategy species - equals: AllMutationsGenerationStrategy new species + equals: AllMutantSelectionStrategy new species ] From 62c22c304b872a60064609b3026f60b55c2d7179 Mon Sep 17 00:00:00 2001 From: Durieux Pol Date: Thu, 30 Nov 2023 16:09:20 +0100 Subject: [PATCH 2/3] Protocol name fix --- ...SelectingFromCoverageMutantEvaluationStrategyTest.class.st | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MuTalk-Tests/SelectingFromCoverageMutantEvaluationStrategyTest.class.st b/src/MuTalk-Tests/SelectingFromCoverageMutantEvaluationStrategyTest.class.st index 633eb2f1..fe6ecfbe 100644 --- a/src/MuTalk-Tests/SelectingFromCoverageMutantEvaluationStrategyTest.class.st +++ b/src/MuTalk-Tests/SelectingFromCoverageMutantEvaluationStrategyTest.class.st @@ -24,7 +24,7 @@ SelectingFromCoverageMutantEvaluationStrategyTest >> assertMutantNotInCoverageOf self deny: ((testCases collect: [ :each | each selector ]) includes: #testMethodThatCoverMethod2) ] -{ #category : #building } +{ #category : #configuring } SelectingFromCoverageMutantEvaluationStrategyTest >> selectionStrategy [ - ^ SelectingFromCoverageMutantEvaluationStrategy + ^ SelectingFromCoverageTestSelectionStrategy ] From d3d675476c6cd4ad623f595ff9e452ef7e50a875 Mon Sep 17 00:00:00 2001 From: Durieux Pol Date: Thu, 30 Nov 2023 16:17:24 +0100 Subject: [PATCH 3/3] Renamed RandomMutantSelection to RandomMutantSelectionStrategy --- .../FixedRandomMutantSelection.class.st | 38 ---------------- ...ixedRandomMutantSelectionStrategy.class.st | 38 ++++++++++++++++ ...entRandomMutantSelectionStrategy.class.st} | 14 +++--- ...=> RandomMutantSelectionStrategy.class.st} | 32 +++++++------- ...mOperatorMutantSelectionStrategy.class.st} | 44 +++++++++---------- .../FixedRandomMutantSelectionTest.class.st | 10 ++--- .../PercentRandomMutantSelectionTest.class.st | 12 ++--- .../RandomMutantSelectionTest.class.st | 2 +- ...RandomOperatorMutantSelectionTest.class.st | 22 +++++----- 9 files changed, 106 insertions(+), 106 deletions(-) delete mode 100644 src/MuTalk-Model/FixedRandomMutantSelection.class.st create mode 100644 src/MuTalk-Model/FixedRandomMutantSelectionStrategy.class.st rename src/MuTalk-Model/{PercentRandomMutantSelection.class.st => PercentRandomMutantSelectionStrategy.class.st} (55%) rename src/MuTalk-Model/{RandomMutantSelection.class.st => RandomMutantSelectionStrategy.class.st} (65%) rename src/MuTalk-Model/{RandomOperatorMutantSelection.class.st => RandomOperatorMutantSelectionStrategy.class.st} (60%) diff --git a/src/MuTalk-Model/FixedRandomMutantSelection.class.st b/src/MuTalk-Model/FixedRandomMutantSelection.class.st deleted file mode 100644 index 0f1202e4..00000000 --- a/src/MuTalk-Model/FixedRandomMutantSelection.class.st +++ /dev/null @@ -1,38 +0,0 @@ -Class { - #name : #FixedRandomMutantSelection, - #superclass : #RandomMutantSelection, - #instVars : [ - 'numberOfMutants' - ], - #category : #'MuTalk-Model-Mutations generation strategies' -} - -{ #category : #accessing } -FixedRandomMutantSelection >> highLimitCondition: aSize [ - - ^ aSize <= self numberOfMutants -] - -{ #category : #accessing } -FixedRandomMutantSelection >> lowLimitCondition [ - - ^ self numberOfMutants = 0 -] - -{ #category : #accessing } -FixedRandomMutantSelection >> numberOfMutants [ - - ^ numberOfMutants -] - -{ #category : #accessing } -FixedRandomMutantSelection >> numberOfMutants: aNumber [ - - numberOfMutants := aNumber -] - -{ #category : #accessing } -FixedRandomMutantSelection >> totalNumberOfMutants: aSize [ - - ^ self numberOfMutants -] diff --git a/src/MuTalk-Model/FixedRandomMutantSelectionStrategy.class.st b/src/MuTalk-Model/FixedRandomMutantSelectionStrategy.class.st new file mode 100644 index 00000000..840edb5e --- /dev/null +++ b/src/MuTalk-Model/FixedRandomMutantSelectionStrategy.class.st @@ -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 +] diff --git a/src/MuTalk-Model/PercentRandomMutantSelection.class.st b/src/MuTalk-Model/PercentRandomMutantSelectionStrategy.class.st similarity index 55% rename from src/MuTalk-Model/PercentRandomMutantSelection.class.st rename to src/MuTalk-Model/PercentRandomMutantSelectionStrategy.class.st index d4659fc3..c1d7c885 100644 --- a/src/MuTalk-Model/PercentRandomMutantSelection.class.st +++ b/src/MuTalk-Model/PercentRandomMutantSelectionStrategy.class.st @@ -1,6 +1,6 @@ Class { - #name : #PercentRandomMutantSelection, - #superclass : #RandomMutantSelection, + #name : #PercentRandomMutantSelectionStrategy, + #superclass : #RandomMutantSelectionStrategy, #instVars : [ 'percentageOfMutants' ], @@ -8,25 +8,25 @@ Class { } { #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' ]. @@ -34,7 +34,7 @@ PercentRandomMutantSelection >> percentageOfMutants: aPercentage [ ] { #category : #accessing } -PercentRandomMutantSelection >> totalNumberOfMutants: aSize [ +PercentRandomMutantSelectionStrategy >> totalNumberOfMutants: aSize [ ^ percentageOfMutants * aSize / 100 ] diff --git a/src/MuTalk-Model/RandomMutantSelection.class.st b/src/MuTalk-Model/RandomMutantSelectionStrategy.class.st similarity index 65% rename from src/MuTalk-Model/RandomMutantSelection.class.st rename to src/MuTalk-Model/RandomMutantSelectionStrategy.class.st index a8bb923b..0638347c 100644 --- a/src/MuTalk-Model/RandomMutantSelection.class.st +++ b/src/MuTalk-Model/RandomMutantSelectionStrategy.class.st @@ -1,5 +1,5 @@ Class { - #name : #RandomMutantSelection, + #name : #RandomMutantSelectionStrategy, #superclass : #Object, #instVars : [ 'mutationsGenerationStrategy' @@ -8,13 +8,13 @@ Class { } { #category : #'instance creation' } -RandomMutantSelection class >> using: aMutationsGenerationStrategy [ +RandomMutantSelectionStrategy class >> using: aMutationsGenerationStrategy [ ^ self new mutationsGenerationStrategy: aMutationsGenerationStrategy ] { #category : #adding } -RandomMutantSelection >> addMutantIn: newColl from: oldColl using: random and: aNumber [ +RandomMutantSelectionStrategy >> addMutantIn: newColl from: oldColl using: random and: aNumber [ | index | index := random nextIntegerBetween: 1 and: aNumber. @@ -27,38 +27,38 @@ RandomMutantSelection >> addMutantIn: newColl from: oldColl using: random and: a ] { #category : #'accessing-defaults' } -RandomMutantSelection >> defaultMutationGenerationStrategy [ +RandomMutantSelectionStrategy >> defaultMutationGenerationStrategy [ ^ AllMutantSelectionStrategy new ] { #category : #accessing } -RandomMutantSelection >> highLimitCondition: aSize [ +RandomMutantSelectionStrategy >> highLimitCondition: aSize [ ^ self subclassResponsibility ] { #category : #initialization } -RandomMutantSelection >> initialize [ +RandomMutantSelectionStrategy >> initialize [ super initialize. mutationsGenerationStrategy := self defaultMutationGenerationStrategy ] { #category : #accessing } -RandomMutantSelection >> lowLimitCondition [ +RandomMutantSelectionStrategy >> lowLimitCondition [ ^ self subclassResponsibility ] { #category : #generating } -RandomMutantSelection >> methodsToMutateFrom: aMutationTestingAnalysis [ +RandomMutantSelectionStrategy >> methodsToMutateFrom: aMutationTestingAnalysis [ ^ mutationsGenerationStrategy methodsToMutateFrom: aMutationTestingAnalysis ] { #category : #generating } -RandomMutantSelection >> mutationsFor: aMutationTestingAnalysis [ +RandomMutantSelectionStrategy >> mutationsFor: aMutationTestingAnalysis [ ^ self mutationsFor: aMutationTestingAnalysis @@ -66,7 +66,7 @@ RandomMutantSelection >> mutationsFor: aMutationTestingAnalysis [ ] { #category : #generating } -RandomMutantSelection >> mutationsFor: aMutationTestingAnalysis loggingIn: aLogger [ +RandomMutantSelectionStrategy >> mutationsFor: aMutationTestingAnalysis loggingIn: aLogger [ | mutations | mutations := mutationsGenerationStrategy mutationsFor: @@ -75,7 +75,7 @@ RandomMutantSelection >> mutationsFor: aMutationTestingAnalysis loggingIn: aLogg ] { #category : #generating } -RandomMutantSelection >> mutationsFor: aMethod usingAll: aCollectionOfMutantOperators logginIn: aLogger [ +RandomMutantSelectionStrategy >> mutationsFor: aMethod usingAll: aCollectionOfMutantOperators logginIn: aLogger [ ^ mutationsGenerationStrategy mutationsFor: aMethod @@ -84,25 +84,25 @@ RandomMutantSelection >> mutationsFor: aMethod usingAll: aCollectionOfMutantOper ] { #category : #accessing } -RandomMutantSelection >> mutationsGenerationStrategy [ +RandomMutantSelectionStrategy >> mutationsGenerationStrategy [ ^ mutationsGenerationStrategy ] { #category : #accessing } -RandomMutantSelection >> mutationsGenerationStrategy: aMutationsGenerationStrategy [ +RandomMutantSelectionStrategy >> mutationsGenerationStrategy: aMutationsGenerationStrategy [ mutationsGenerationStrategy := aMutationsGenerationStrategy ] { #category : #logging } -RandomMutantSelection >> nullLogger [ +RandomMutantSelectionStrategy >> nullLogger [ ^ mutationsGenerationStrategy nullLogger ] { #category : #generating } -RandomMutantSelection >> selectMutantsFrom: aCollection [ +RandomMutantSelectionStrategy >> selectMutantsFrom: aCollection [ | size newColl random | size := aCollection size. @@ -122,7 +122,7 @@ RandomMutantSelection >> selectMutantsFrom: aCollection [ ] { #category : #accessing } -RandomMutantSelection >> totalNumberOfMutants: aSize [ +RandomMutantSelectionStrategy >> totalNumberOfMutants: aSize [ ^ self subclassResponsibility ] diff --git a/src/MuTalk-Model/RandomOperatorMutantSelection.class.st b/src/MuTalk-Model/RandomOperatorMutantSelectionStrategy.class.st similarity index 60% rename from src/MuTalk-Model/RandomOperatorMutantSelection.class.st rename to src/MuTalk-Model/RandomOperatorMutantSelectionStrategy.class.st index 6303b94f..b506a0e5 100644 --- a/src/MuTalk-Model/RandomOperatorMutantSelection.class.st +++ b/src/MuTalk-Model/RandomOperatorMutantSelectionStrategy.class.st @@ -1,5 +1,5 @@ Class { - #name : #RandomOperatorMutantSelection, + #name : #RandomOperatorMutantSelectionStrategy, #superclass : #Object, #instVars : [ 'randomMutantSelection' @@ -8,63 +8,63 @@ Class { } { #category : #intialization } -RandomOperatorMutantSelection class >> fixed: aNumber [ +RandomOperatorMutantSelectionStrategy class >> fixed: aNumber [ ^ self new randomMutantSelection: - (FixedRandomMutantSelection new numberOfMutants: aNumber) + (FixedRandomMutantSelectionStrategy new numberOfMutants: aNumber) ] { #category : #intialization } -RandomOperatorMutantSelection class >> percent: aPercentage [ +RandomOperatorMutantSelectionStrategy class >> percent: aPercentage [ ^ self new randomMutantSelection: - (PercentRandomMutantSelection new percentageOfMutants: aPercentage) + (PercentRandomMutantSelectionStrategy new percentageOfMutants: aPercentage) ] { #category : #adding } -RandomOperatorMutantSelection >> addMutantIn: newColl from: oldColl using: random and: aNumber [ +RandomOperatorMutantSelectionStrategy >> addMutantIn: newColl from: oldColl using: random and: aNumber [ randomMutantSelection addMutantIn: newColl from: oldColl using: random and: aNumber ] { #category : #'accessing-defaults' } -RandomOperatorMutantSelection >> defaultMutationGenerationStrategy [ +RandomOperatorMutantSelectionStrategy >> defaultMutationGenerationStrategy [ ^ randomMutantSelection defaultMutationGenerationStrategy ] { #category : #accessing } -RandomOperatorMutantSelection >> highLimitCondition: aSize [ +RandomOperatorMutantSelectionStrategy >> highLimitCondition: aSize [ ^ randomMutantSelection highLimitCondition: aSize ] { #category : #initialization } -RandomOperatorMutantSelection >> initialize [ +RandomOperatorMutantSelectionStrategy >> initialize [ randomMutantSelection initialize ] { #category : #accessing } -RandomOperatorMutantSelection >> lowLimitCondition [ +RandomOperatorMutantSelectionStrategy >> lowLimitCondition [ ^ randomMutantSelection lowLimitCondition ] { #category : #generating } -RandomOperatorMutantSelection >> methodsToMutateFrom: aMutationTestingAnalysis [ +RandomOperatorMutantSelectionStrategy >> methodsToMutateFrom: aMutationTestingAnalysis [ ^ randomMutantSelection methodsToMutateFrom: aMutationTestingAnalysis ] { #category : #generating } -RandomOperatorMutantSelection >> mutationsFor: aMutationTestingAnalysis [ +RandomOperatorMutantSelectionStrategy >> mutationsFor: aMutationTestingAnalysis [ ^ randomMutantSelection mutationsFor: aMutationTestingAnalysis ] { #category : #generating } -RandomOperatorMutantSelection >> mutationsFor: aMutationTestingAnalysis loggingIn: aLogger [ +RandomOperatorMutantSelectionStrategy >> mutationsFor: aMutationTestingAnalysis loggingIn: aLogger [ ^ randomMutantSelection mutationsFor: aMutationTestingAnalysis @@ -72,7 +72,7 @@ RandomOperatorMutantSelection >> mutationsFor: aMutationTestingAnalysis loggingI ] { #category : #generating } -RandomOperatorMutantSelection >> mutationsFor: aMethod usingAll: aCollectionOfMutantOperators logginIn: aLogger [ +RandomOperatorMutantSelectionStrategy >> mutationsFor: aMethod usingAll: aCollectionOfMutantOperators logginIn: aLogger [ ^ randomMutantSelection mutationsFor: aMethod @@ -81,38 +81,38 @@ RandomOperatorMutantSelection >> mutationsFor: aMethod usingAll: aCollectionOfMu ] { #category : #accessing } -RandomOperatorMutantSelection >> mutationsGenerationStrategy [ +RandomOperatorMutantSelectionStrategy >> mutationsGenerationStrategy [ - ^ randomMutantSelection mutationGenerationStrategy + ^ randomMutantSelection mutationsGenerationStrategy ] { #category : #accessing } -RandomOperatorMutantSelection >> mutationsGenerationStrategy: aMutationsGenerationStrategy [ +RandomOperatorMutantSelectionStrategy >> mutationsGenerationStrategy: aMutationsGenerationStrategy [ ^ randomMutantSelection mutationsGenerationStrategy: aMutationsGenerationStrategy ] { #category : #logging } -RandomOperatorMutantSelection >> nullLogger [ +RandomOperatorMutantSelectionStrategy >> nullLogger [ ^ randomMutantSelection nullLogger ] { #category : #accessing } -RandomOperatorMutantSelection >> randomMutantSelection [ +RandomOperatorMutantSelectionStrategy >> randomMutantSelection [ ^ randomMutantSelection ] { #category : #accessing } -RandomOperatorMutantSelection >> randomMutantSelection: anObject [ +RandomOperatorMutantSelectionStrategy >> randomMutantSelection: anObject [ randomMutantSelection := anObject ] { #category : #generating } -RandomOperatorMutantSelection >> selectMutantsFrom: aCollection [ +RandomOperatorMutantSelectionStrategy >> selectMutantsFrom: aCollection [ | size newColl random dict operators operator | newColl := aCollection copyEmpty. @@ -143,7 +143,7 @@ RandomOperatorMutantSelection >> selectMutantsFrom: aCollection [ ] { #category : #accessing } -RandomOperatorMutantSelection >> totalNumberOfMutants: aSize [ +RandomOperatorMutantSelectionStrategy >> totalNumberOfMutants: aSize [ ^ randomMutantSelection totalNumberOfMutants: aSize ] diff --git a/src/MuTalk-Tests/FixedRandomMutantSelectionTest.class.st b/src/MuTalk-Tests/FixedRandomMutantSelectionTest.class.st index 9e09140f..4f740cef 100644 --- a/src/MuTalk-Tests/FixedRandomMutantSelectionTest.class.st +++ b/src/MuTalk-Tests/FixedRandomMutantSelectionTest.class.st @@ -9,7 +9,7 @@ FixedRandomMutantSelectionTest >> testSelectMutantsFrom [ | select coll | coll := (1 to: 10) asOrderedCollection. - select := FixedRandomMutantSelection new numberOfMutants: 5. + select := FixedRandomMutantSelectionStrategy new numberOfMutants: 5. self assert: (select selectMutantsFrom: coll) size equals: 5 ] @@ -18,7 +18,7 @@ FixedRandomMutantSelectionTest >> testSelectMutantsFrom2 [ | select coll | coll := (1 to: 10) asOrderedCollection. - select := FixedRandomMutantSelection new numberOfMutants: 0. + select := FixedRandomMutantSelectionStrategy new numberOfMutants: 0. self assert: (select selectMutantsFrom: coll) equals: { } asOrderedCollection @@ -29,7 +29,7 @@ FixedRandomMutantSelectionTest >> testSelectMutantsFrom3 [ | select coll | coll := (1 to: 10) asOrderedCollection. - select := FixedRandomMutantSelection new numberOfMutants: 10. + select := FixedRandomMutantSelectionStrategy new numberOfMutants: 10. self assert: (select selectMutantsFrom: coll) equals: coll ] @@ -38,7 +38,7 @@ FixedRandomMutantSelectionTest >> testSelectMutantsFrom4 [ | select coll | coll := (1 to: 10) asOrderedCollection. - select := FixedRandomMutantSelection new numberOfMutants: 20. + select := FixedRandomMutantSelectionStrategy new numberOfMutants: 20. self assert: (select selectMutantsFrom: coll) equals: coll ] @@ -47,7 +47,7 @@ FixedRandomMutantSelectionTest >> testSelectMutantsFromDistinctElements [ | select coll newColl | coll := (1 to: 10) asOrderedCollection. - select := FixedRandomMutantSelection new numberOfMutants: 9. + select := FixedRandomMutantSelectionStrategy new numberOfMutants: 9. newColl := select selectMutantsFrom: coll. self assert: newColl copyWithoutDuplicates asBag diff --git a/src/MuTalk-Tests/PercentRandomMutantSelectionTest.class.st b/src/MuTalk-Tests/PercentRandomMutantSelectionTest.class.st index b365a627..eb63f397 100644 --- a/src/MuTalk-Tests/PercentRandomMutantSelectionTest.class.st +++ b/src/MuTalk-Tests/PercentRandomMutantSelectionTest.class.st @@ -9,7 +9,7 @@ PercentRandomMutantSelectionTest >> testSelectMutantsFrom [ | select coll | coll := (1 to: 10) asOrderedCollection. - select := PercentRandomMutantSelection new percentageOfMutants: 50. + select := PercentRandomMutantSelectionStrategy new percentageOfMutants: 50. self assert: (select selectMutantsFrom: coll) size equals: 5 ] @@ -18,7 +18,7 @@ PercentRandomMutantSelectionTest >> testSelectMutantsFrom2 [ | select coll | coll := (1 to: 10) asOrderedCollection. - select := PercentRandomMutantSelection new percentageOfMutants: 0. + select := PercentRandomMutantSelectionStrategy new percentageOfMutants: 0. self assert: (select selectMutantsFrom: coll) equals: { } asOrderedCollection @@ -29,7 +29,7 @@ PercentRandomMutantSelectionTest >> testSelectMutantsFrom3 [ | select coll | coll := (1 to: 10) asOrderedCollection. - select := PercentRandomMutantSelection new percentageOfMutants: 100. + select := PercentRandomMutantSelectionStrategy new percentageOfMutants: 100. self assert: (select selectMutantsFrom: coll) equals: coll ] @@ -38,7 +38,7 @@ PercentRandomMutantSelectionTest >> testSelectMutantsFrom4 [ | select coll | coll := (1 to: 10) asOrderedCollection. - select := PercentRandomMutantSelection new. + select := PercentRandomMutantSelectionStrategy new. self should: [ select percentageOfMutants: -50 ] raise: Error ] @@ -47,7 +47,7 @@ PercentRandomMutantSelectionTest >> testSelectMutantsFrom5 [ | select coll | coll := (1 to: 10) asOrderedCollection. - select := PercentRandomMutantSelection new. + select := PercentRandomMutantSelectionStrategy new. self should: [ select percentageOfMutants: 150 ] raise: Error ] @@ -56,7 +56,7 @@ PercentRandomMutantSelectionTest >> testSelectMutantsFromDistinctElements [ | select coll newColl | coll := (1 to: 10) asOrderedCollection. - select := PercentRandomMutantSelection new percentageOfMutants: 90. + select := PercentRandomMutantSelectionStrategy new percentageOfMutants: 90. newColl := select selectMutantsFrom: coll. self assert: newColl copyWithoutDuplicates asBag diff --git a/src/MuTalk-Tests/RandomMutantSelectionTest.class.st b/src/MuTalk-Tests/RandomMutantSelectionTest.class.st index 1e1a8f79..c58419e3 100644 --- a/src/MuTalk-Tests/RandomMutantSelectionTest.class.st +++ b/src/MuTalk-Tests/RandomMutantSelectionTest.class.st @@ -8,6 +8,6 @@ Class { RandomMutantSelectionTest >> testDefaultMutationsGenerationStrategy [ self - assert: RandomMutantSelection new mutationsGenerationStrategy species + assert: RandomMutantSelectionStrategy new mutationsGenerationStrategy species equals: AllMutantSelectionStrategy new species ] diff --git a/src/MuTalk-Tests/RandomOperatorMutantSelectionTest.class.st b/src/MuTalk-Tests/RandomOperatorMutantSelectionTest.class.st index bb76d729..fe08c37d 100644 --- a/src/MuTalk-Tests/RandomOperatorMutantSelectionTest.class.st +++ b/src/MuTalk-Tests/RandomOperatorMutantSelectionTest.class.st @@ -53,7 +53,7 @@ RandomOperatorMutantSelectionTest >> setUp [ RandomOperatorMutantSelectionTest >> testFixedSelectMutantsFrom [ | select newColl | - select := RandomOperatorMutantSelection fixed: 3. + select := RandomOperatorMutantSelectionStrategy fixed: 3. newColl := select selectMutantsFrom: coll. self assert: newColl size equals: 3 ] @@ -62,7 +62,7 @@ RandomOperatorMutantSelectionTest >> testFixedSelectMutantsFrom [ RandomOperatorMutantSelectionTest >> testFixedSelectMutantsFrom2 [ | select newColl | - select := RandomOperatorMutantSelection fixed: 0. + select := RandomOperatorMutantSelectionStrategy fixed: 0. newColl := select selectMutantsFrom: coll. self assert: newColl equals: { } asOrderedCollection ] @@ -71,7 +71,7 @@ RandomOperatorMutantSelectionTest >> testFixedSelectMutantsFrom2 [ RandomOperatorMutantSelectionTest >> testFixedSelectMutantsFrom3 [ | select newColl | - select := RandomOperatorMutantSelection fixed: 6. + select := RandomOperatorMutantSelectionStrategy fixed: 6. newColl := select selectMutantsFrom: coll. self assert: newColl equals: coll ] @@ -80,7 +80,7 @@ RandomOperatorMutantSelectionTest >> testFixedSelectMutantsFrom3 [ RandomOperatorMutantSelectionTest >> testFixedSelectMutantsFrom4 [ | select newColl | - select := RandomOperatorMutantSelection fixed: 10. + select := RandomOperatorMutantSelectionStrategy fixed: 10. newColl := select selectMutantsFrom: coll. self assert: newColl equals: coll ] @@ -89,7 +89,7 @@ RandomOperatorMutantSelectionTest >> testFixedSelectMutantsFrom4 [ RandomOperatorMutantSelectionTest >> testFixedSelectMutantsFromDistinctElements [ | select newColl | - select := RandomOperatorMutantSelection fixed: 5. + select := RandomOperatorMutantSelectionStrategy fixed: 5. newColl := select selectMutantsFrom: coll. self assert: newColl copyWithoutDuplicates asBag @@ -100,7 +100,7 @@ RandomOperatorMutantSelectionTest >> testFixedSelectMutantsFromDistinctElements RandomOperatorMutantSelectionTest >> testPercentSelectMutantsFrom [ | select newColl | - select := RandomOperatorMutantSelection percent: 50. + select := RandomOperatorMutantSelectionStrategy percent: 50. newColl := select selectMutantsFrom: coll. self assert: newColl size equals: 3 ] @@ -109,7 +109,7 @@ RandomOperatorMutantSelectionTest >> testPercentSelectMutantsFrom [ RandomOperatorMutantSelectionTest >> testPercentSelectMutantsFrom2 [ | select newColl | - select := RandomOperatorMutantSelection percent: 0. + select := RandomOperatorMutantSelectionStrategy percent: 0. newColl := select selectMutantsFrom: coll. self assert: newColl equals: { } asOrderedCollection ] @@ -118,7 +118,7 @@ RandomOperatorMutantSelectionTest >> testPercentSelectMutantsFrom2 [ RandomOperatorMutantSelectionTest >> testPercentSelectMutantsFrom3 [ | select newColl | - select := RandomOperatorMutantSelection percent: 100. + select := RandomOperatorMutantSelectionStrategy percent: 100. newColl := select selectMutantsFrom: coll. self assert: newColl equals: coll ] @@ -127,7 +127,7 @@ RandomOperatorMutantSelectionTest >> testPercentSelectMutantsFrom3 [ RandomOperatorMutantSelectionTest >> testPercentSelectMutantsFrom4 [ self - should: [ RandomOperatorMutantSelection percent: -50 ] + should: [ RandomOperatorMutantSelectionStrategy percent: -50 ] raise: Error ] @@ -135,7 +135,7 @@ RandomOperatorMutantSelectionTest >> testPercentSelectMutantsFrom4 [ RandomOperatorMutantSelectionTest >> testPercentSelectMutantsFrom5 [ self - should: [ RandomOperatorMutantSelection percent: 150 ] + should: [ RandomOperatorMutantSelectionStrategy percent: 150 ] raise: Error ] @@ -143,7 +143,7 @@ RandomOperatorMutantSelectionTest >> testPercentSelectMutantsFrom5 [ RandomOperatorMutantSelectionTest >> testPercentSelectMutantsFromDistinctElements [ | select newColl | - select := RandomOperatorMutantSelection percent: 90. + select := RandomOperatorMutantSelectionStrategy percent: 90. newColl := select selectMutantsFrom: coll. self assert: newColl copyWithoutDuplicates asBag