Skip to content

Commit 1908c1d

Browse files
author
Durieux Pol
committed
rename variables and refactor a bit
1 parent 9ce9387 commit 1908c1d

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/MuTalk-Utilities/MTMatrix.class.st

+13-10
Original file line numberDiff line numberDiff line change
@@ -123,28 +123,31 @@ MTMatrix >> classesToMutate: aClass [
123123
{ #category : 'computing' }
124124
MTMatrix >> dataForTests: testCollection andMutations: mutationCollection [
125125

126-
| totalNumberOfTests numberOfFailuresCollection killedCount |
127-
totalNumberOfTests := testCollection size * mutationCollection size.
126+
| totalNumberOfTestsExecuted numberOfFailuresCollection totalNumberOfFailures |
127+
totalNumberOfTestsExecuted := testCollection size
128+
* mutationCollection size.
128129
numberOfFailuresCollection := mutationCollection collect: [ :mutation |
129130
| testClass |
131+
"We know that all tests from testCollection are from the same class"
130132
testClass := testCollection atRandom
131133
testCaseClass.
132134
(self
133135
failuresFor: mutation
134136
andTestClass: testClass) size ].
135-
killedCount := numberOfFailuresCollection fold: [ :num1 :num2 |
136-
num1 + num2 ].
137-
^ (killedCount / totalNumberOfTests * 100) asInteger
137+
totalNumberOfFailures := numberOfFailuresCollection fold: [ :num1 :num2 |
138+
num1 + num2 ].
139+
^ (totalNumberOfFailures / totalNumberOfTestsExecuted * 100)
140+
asInteger
138141
]
139142

140143
{ #category : 'computing' }
141144
MTMatrix >> dataMatrixForTests: testDictionary andMutations: mutationDictionary [
142145

143-
^ (mutationDictionary collect: [ :mutationCollection |
144-
(testDictionary collect: [ :testCollection |
145-
self
146-
dataForTests: testCollection
147-
andMutations: mutationCollection ]) asArray ]) asArray
146+
^ mutationDictionary values collect: [ :mutationCollection |
147+
testDictionary values collect: [ :testCollection |
148+
self
149+
dataForTests: testCollection
150+
andMutations: mutationCollection ] ]
148151
]
149152

150153
{ #category : 'accessing' }

0 commit comments

Comments
 (0)