diff --git a/src/MuTalk-Utilities-Tests/MTMutantOperatorAnalysisTest.class.st b/src/MuTalk-Utilities-Tests/MTMutantOperatorAnalysisTest.class.st index 9dc8547..6797981 100644 --- a/src/MuTalk-Utilities-Tests/MTMutantOperatorAnalysisTest.class.st +++ b/src/MuTalk-Utilities-Tests/MTMutantOperatorAnalysisTest.class.st @@ -21,7 +21,7 @@ MTMutantOperatorAnalysisTest >> setUp [ MTMutantOperatorAnalysisTest >> testGetAllOperators [ | actual expected | - actual := (operatorAnalysis operatorsProducingOverXMutants: 0) keys + actual := (operatorAnalysis operatorsProducingAtLeast: 0) keys asSet. expected := (MTMutantOperator contentsAll collect: #species) asSet. @@ -32,7 +32,7 @@ MTMutantOperatorAnalysisTest >> testGetAllOperators [ MTMutantOperatorAnalysisTest >> testOperatorsProducingOver [ | actual expected | - actual := (operatorAnalysis operatorsProducingOverXMutants: 3) keys + actual := (operatorAnalysis operatorsProducingAtLeast: 3) keys asSet. expected := Set with: MTLiteralIntegersIncreaseOperator @@ -46,7 +46,7 @@ MTMutantOperatorAnalysisTest >> testOperatorsProducingOver [ MTMutantOperatorAnalysisTest >> testOperatorsProducingUnder [ | actual expected | - actual := (operatorAnalysis operatorsProducingUnderXMutants: 2) keys + actual := (operatorAnalysis operatorsProducingAtMost: 2) keys asSet. expected := (MTMutantOperator contentsAll collect: #species) asSet reject: [ :operator | diff --git a/src/MuTalk-Utilities/MTMutantOperatorAnalysis.class.st b/src/MuTalk-Utilities/MTMutantOperatorAnalysis.class.st index 4b97d1f..0e42f68 100644 --- a/src/MuTalk-Utilities/MTMutantOperatorAnalysis.class.st +++ b/src/MuTalk-Utilities/MTMutantOperatorAnalysis.class.st @@ -21,22 +21,6 @@ MTMutantOperatorAnalysis >> addAllAssociationsFrom: sourceDictionary to: destina ^ destinationDictionary ] -{ #category : 'computing' } -MTMutantOperatorAnalysis >> allOperators [ - - | operatorsDictionary operatorsWithoutMutants | - operatorsDictionary := self getMutantOperatorsDictionary. - operatorsWithoutMutants := self findOperatorsWithoutMutantsFor: - operatorsDictionary. - - operatorsDictionary := self - addAllAssociationsFrom: - operatorsWithoutMutants - to: operatorsDictionary asDictionary. - - ^ operatorsDictionary -] - { #category : 'computing' } MTMutantOperatorAnalysis >> findOperatorsWithoutMutantsFor: aDictionary [ @@ -53,7 +37,7 @@ MTMutantOperatorAnalysis >> findOperatorsWithoutMutantsFor: aDictionary [ ] { #category : 'computing' } -MTMutantOperatorAnalysis >> getMutantOperatorsDictionary [ +MTMutantOperatorAnalysis >> mutantOperatorsDictionaryFromAnalysis [ | analysis dic | analysis := MTAnalysis new @@ -68,13 +52,13 @@ MTMutantOperatorAnalysis >> getMutantOperatorsDictionary [ ] { #category : 'computing' } -MTMutantOperatorAnalysis >> operatorsProducingOverXMutants: aNumber [ +MTMutantOperatorAnalysis >> operatorsProducingAtLeast: aNumber [ ^ self operatorsSelectedWith: [ :value | value >= aNumber ] ] { #category : 'computing' } -MTMutantOperatorAnalysis >> operatorsProducingUnderXMutants: aNumber [ +MTMutantOperatorAnalysis >> operatorsProducingAtMost: aNumber [ ^ self operatorsSelectedWith: [ :value | value <= aNumber ] ] @@ -82,5 +66,21 @@ MTMutantOperatorAnalysis >> operatorsProducingUnderXMutants: aNumber [ { #category : 'computing' } MTMutantOperatorAnalysis >> operatorsSelectedWith: aBlock [ - ^ self allOperators select: aBlock + ^ (self wholeOperatorsDictionary select: aBlock) keys asSet +] + +{ #category : 'computing' } +MTMutantOperatorAnalysis >> wholeOperatorsDictionary [ + + | operatorsDictionary operatorsWithoutMutants | + operatorsDictionary := self mutantOperatorsDictionaryFromAnalysis. + operatorsWithoutMutants := self findOperatorsWithoutMutantsFor: + operatorsDictionary. + + operatorsDictionary := self + addAllAssociationsFrom: + operatorsWithoutMutants + to: operatorsDictionary asDictionary. + + ^ operatorsDictionary ]