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

Log refactoring and improvement #97

Merged
merged 14 commits into from
Mar 14, 2024

Conversation

DurieuxPol
Copy link
Collaborator

Fixes #85 , fixes #86

Refactored the loggers to implement a MTStreamLogger and two subclasses MTFileLogger and MTTranscriptLogger.
Added more info in log, such as the phases of the analysis, the number of mutation generated and especially the tests running.

An extract from a log example:

The analysis is starting...
Starting coverage analysis
Running test: UUIDTest>>#testBasic
Running test: UUIDTest>>#testComparison
Running test: UUIDTest>>#testNilUUID
Running test: UUIDTest>>#testString
Running test: UUIDTest>>#testString36
Running test: UUIDTest>>#testUUIDVersion1
Running test: UUIDTest>>#testUUIDVersion3
Running test: UUIDTest>>#testUUIDVersion4
Running test: UUIDTest>>#testUUIDVersion5
Starting mutation generation
Generating mutations for UUID>>#<  with operator:Remove #not
0 mutation generated
Generating mutations for UUID>>#<  with operator:Remove Exception Handler Operator
0 mutation generated
Generating mutations for UUID>>#<  with operator:Remove ^
3 mutations generated

[...]

Generating mutations for UUID class>>#fromString:  with operator:Replace sortBlock:aBlock with sortBlock:[:a :b| true]
0 mutation generated
125 total mutations generated
Starting mutation evaluation
Evaluating mutant of method UUID>>#<  with source:
< aMagnitude
	"Answer whether the receiver is less than the argument."

	uuidData size = aMagnitude uuidData size ifFalse: [
		uuidData size < aMagnitude uuidData size ].
	1 to: uuidData size do: [ :i |
		(uuidData at: i) = (aMagnitude uuidData at: i) ifFalse: [
			^ (uuidData at: i) < (aMagnitude uuidData at: i) ] ].
	^ false
Running test: UUIDTest>>#testBasic
Running test: UUIDTest>>#testComparison
Running test: UUIDTest>>#testNilUUID
Running test: UUIDTest>>#testString
Running test: UUIDTest>>#testString36
Running test: UUIDTest>>#testUUIDVersion1
Running test: UUIDTest>>#testUUIDVersion3
Running test: UUIDTest>>#testUUIDVersion4
Running test: UUIDTest>>#testUUIDVersion5
Evaluating mutant of method UUID>>#<  with source:

[...]

Evaluating mutant of method UUID class>>#fromString:  with source:
fromString: aString
	"Read a UUID from aString with my official representation, 32 lowercase hexadecimal (base 16) digits, displayed in five groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters and four hyphens)"

	| uuid |
	aString size ~= 36 ifFalse: [
		self error: 'a UUID should be 36 characters' ].
	uuid := self nilUUID.
	uuid readFrom: aString readStream.
	^ uuid
Running test: UUIDTest>>#testBasic
Running test: UUIDTest>>#testComparison
The analysis is finished

@guillep
Copy link
Contributor

guillep commented Mar 14, 2024

Oh this is super nice! I wonder if logging the mutant source code is not too hardcore, but that's very good for a first version!

I think we can move forward with this and when @Inao0 comes back we can see if this could have solved some of her issues

@guillep
Copy link
Contributor

guillep commented Mar 14, 2024

Oh here resolving the conflict requires some work...

@DurieuxPol
Copy link
Collaborator Author

I agree, logging the mutant source code is maybe a bit too much, but it was here at the beginning so I left it for now.
If it proves to be unnecessary I can remove it and instead specify the operator for example

@guillep guillep merged commit f92e599 into pharo-contributions:master Mar 14, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log the test running Need a Transcript logger
2 participants