Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a matrix and heatmap from existing MTAnalysis #124

Merged
merged 3 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/MuTalk-Model/MTAnalysis.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ MTAnalysis >> logger: anObject [
logger := anObject
]

{ #category : 'as yet unclassified' }
{ #category : 'accessing' }
MTAnalysis >> methodSize [

^ (self modelClasses flatCollect: #methods) size
Expand Down
17 changes: 17 additions & 0 deletions src/MuTalk-Utilities/MTAnalysis.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Extension { #name : 'MTAnalysis' }

{ #category : '*MuTalk-Utilities' }
MTAnalysis >> generateHeatmap [

| matrix |
matrix := MTMatrix new analysis: self.
matrix generateHeatmap
]

{ #category : '*MuTalk-Utilities' }
MTAnalysis >> generateMatrix [

| matrix |
matrix := MTMatrix new analysis: self.
matrix generateMatrix
]
29 changes: 23 additions & 6 deletions src/MuTalk-Utilities/MTMatrix.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ MTMatrix >> analysis [
^ analysis
]

{ #category : 'accessing' }
MTMatrix >> analysis: anAnalysis [

analysis := anAnalysis.
testClasses := (anAnalysis testCases groupedBy: [ :testCase |
testCase testCaseClass ]) keys.
testCases := analysis testCases.
mutations := analysis mutations.
self fillMatrix
]

{ #category : 'comparing' }
MTMatrix >> booleanCollection1: collection1 equalsBooleanCollection2: collection2 [

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

self runAnalysis.
mutations do: [ :mut |
self
at: mut
put:
(testCases collect: [ :test |
(self failuresFor: mut) includes: test ]) ]
self fillMatrix
]

{ #category : 'accessing' }
Expand Down Expand Up @@ -195,6 +201,17 @@ MTMatrix >> failuresFor: aMutation andTestClass: aTestClass [
testCase testCaseClass = aTestClass ]
]

{ #category : 'building' }
MTMatrix >> fillMatrix [

mutations do: [ :mut |
self
at: mut
put:
(testCases collect: [ :test |
(self failuresFor: mut) includes: test ]) ]
]

{ #category : 'rendering' }
MTMatrix >> generateHeatmap [

Expand Down
Loading