Skip to content

Commit

Permalink
renamed methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Durieux Pol committed Feb 5, 2024
1 parent 150ef0a commit 5b1bf7c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ MTNonMutatedMethodsAnalysisTest >> testNonMutatedMethods [
results := (MTNonMutatedMethodsAnalysis forClasses: {
MTAuxiliarClassForMatrix.
MTAuxiliarClassForMatrixTest })
findMethodsWithoutMutation asSet.
methodsWithoutMutation asSet.

self
assert: results
Expand Down
47 changes: 24 additions & 23 deletions src/MuTalk-Utilities/MTMutantOperatorAnalysis.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,24 @@ MTMutantOperatorAnalysis >> addAllAssociationsFrom: sourceDictionary to: destina
]

{ #category : 'computing' }
MTMutantOperatorAnalysis >> findOperatorsWithoutMutantsFor: aDictionary [
MTMutantOperatorAnalysis >> operatorDictionary [
"Returns the dictionary with mutant operators as keys, and for each operator the number of mutants it produce"

| operatorsWithoutMutants |
operatorsWithoutMutants := (MTMutantOperator contentsAll collect:
#species) reject: [ :ope |
aDictionary keys includes: ope ].
| operatorDictionary operatorsWithoutMutants |
operatorDictionary := self operatorDictionaryFromAnalysis.
operatorsWithoutMutants := self operatorsWithoutMutantsFor:
operatorDictionary.

^ Dictionary new
addAll:
(operatorsWithoutMutants collect: [ :each | each -> 0 ])
asDictionary;
yourself
operatorDictionary := self
addAllAssociationsFrom:
operatorsWithoutMutants
to: operatorDictionary asDictionary.

^ operatorDictionary
]

{ #category : 'computing' }
MTMutantOperatorAnalysis >> mutantOperatorsDictionaryFromAnalysis [
MTMutantOperatorAnalysis >> operatorDictionaryFromAnalysis [

| analysis dic |
analysis := MTAnalysis new
Expand Down Expand Up @@ -66,21 +68,20 @@ MTMutantOperatorAnalysis >> operatorsProducingAtMost: aNumber [
{ #category : 'computing' }
MTMutantOperatorAnalysis >> operatorsSelectedWith: aBlock [

^ (self wholeOperatorsDictionary select: aBlock) keys asSet
^ (self operatorDictionary select: aBlock) keys asSet
]

{ #category : 'computing' }
MTMutantOperatorAnalysis >> wholeOperatorsDictionary [
MTMutantOperatorAnalysis >> operatorsWithoutMutantsFor: aDictionary [

| operatorsDictionary operatorsWithoutMutants |
operatorsDictionary := self mutantOperatorsDictionaryFromAnalysis.
operatorsWithoutMutants := self findOperatorsWithoutMutantsFor:
operatorsDictionary.

operatorsDictionary := self
addAllAssociationsFrom:
operatorsWithoutMutants
to: operatorsDictionary asDictionary.
| operatorsWithoutMutants |
operatorsWithoutMutants := (MTMutantOperator contentsAll collect:
#species) reject: [ :ope |
aDictionary keys includes: ope ].

^ operatorsDictionary
^ Dictionary new
addAll:
(operatorsWithoutMutants collect: [ :each | each -> 0 ])
asDictionary;
yourself
]
22 changes: 11 additions & 11 deletions src/MuTalk-Utilities/MTNonMutatedMethodsAnalysis.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ Class {
}

{ #category : 'computing' }
MTNonMutatedMethodsAnalysis >> findMethodsWithoutMutation [
MTNonMutatedMethodsAnalysis >> allMethods [

| allMethods allMutatedMethods |
allMethods := self getAllMethods.
allMutatedMethods := self getMutatedMethods.

^ allMethods reject: [ :method | allMutatedMethods includes: method ]
^ classes inject: OrderedCollection new into: [ :coll :class |
coll addAll: (class methods reject: #isExtension).
coll ]
]

{ #category : 'computing' }
MTNonMutatedMethodsAnalysis >> getAllMethods [
MTNonMutatedMethodsAnalysis >> methodsWithoutMutation [

^ classes inject: OrderedCollection new into: [ :coll :class |
coll addAll: (class methods reject: #isExtension).
coll ]
| allMethods allMutatedMethods |
allMethods := self allMethods.
allMutatedMethods := self mutatedMethods.

^ allMethods reject: [ :method | allMutatedMethods includes: method ]
]

{ #category : 'computing' }
MTNonMutatedMethodsAnalysis >> getMutatedMethods [
MTNonMutatedMethodsAnalysis >> mutatedMethods [

| analysis mutatedMethods |
analysis := MTAnalysis new
Expand Down

0 comments on commit 5b1bf7c

Please sign in to comment.