Skip to content

Commit 634dbcb

Browse files
authored
Merge pull request #124 from DurieuxPol/fix/122
Create a matrix and heatmap from existing MTAnalysis
2 parents 4ff5604 + 47d2b8f commit 634dbcb

File tree

3 files changed

+41
-7
lines changed

3 files changed

+41
-7
lines changed

src/MuTalk-Model/MTAnalysis.class.st

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ MTAnalysis >> logger: anObject [
216216
logger := anObject
217217
]
218218

219-
{ #category : 'as yet unclassified' }
219+
{ #category : 'accessing' }
220220
MTAnalysis >> methodSize [
221221

222222
^ (self modelClasses flatCollect: #methods) size
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Extension { #name : 'MTAnalysis' }
2+
3+
{ #category : '*MuTalk-Utilities' }
4+
MTAnalysis >> generateHeatmap [
5+
6+
| matrix |
7+
matrix := MTMatrix new analysis: self.
8+
matrix generateHeatmap
9+
]
10+
11+
{ #category : '*MuTalk-Utilities' }
12+
MTAnalysis >> generateMatrix [
13+
14+
| matrix |
15+
matrix := MTMatrix new analysis: self.
16+
matrix generateMatrix
17+
]

src/MuTalk-Utilities/MTMatrix.class.st

+23-6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,17 @@ MTMatrix >> analysis [
7676
^ analysis
7777
]
7878

79+
{ #category : 'accessing' }
80+
MTMatrix >> analysis: anAnalysis [
81+
82+
analysis := anAnalysis.
83+
testClasses := (anAnalysis testCases groupedBy: [ :testCase |
84+
testCase testCaseClass ]) keys.
85+
testCases := analysis testCases.
86+
mutations := analysis mutations.
87+
self fillMatrix
88+
]
89+
7990
{ #category : 'comparing' }
8091
MTMatrix >> booleanCollection1: collection1 equalsBooleanCollection2: collection2 [
8192

@@ -100,12 +111,7 @@ MTMatrix >> booleanCollection1: collection1 includesBooleanCollection2: collecti
100111
MTMatrix >> build [
101112

102113
self runAnalysis.
103-
mutations do: [ :mut |
104-
self
105-
at: mut
106-
put:
107-
(testCases collect: [ :test |
108-
(self failuresFor: mut) includes: test ]) ]
114+
self fillMatrix
109115
]
110116

111117
{ #category : 'accessing' }
@@ -195,6 +201,17 @@ MTMatrix >> failuresFor: aMutation andTestClass: aTestClass [
195201
testCase testCaseClass = aTestClass ]
196202
]
197203

204+
{ #category : 'building' }
205+
MTMatrix >> fillMatrix [
206+
207+
mutations do: [ :mut |
208+
self
209+
at: mut
210+
put:
211+
(testCases collect: [ :test |
212+
(self failuresFor: mut) includes: test ]) ]
213+
]
214+
198215
{ #category : 'rendering' }
199216
MTMatrix >> generateHeatmap [
200217

0 commit comments

Comments
 (0)