-
Notifications
You must be signed in to change notification settings - Fork 14
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
Subclass replacement operator #75
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments!
ifFalse: [ | ||
self | ||
timesToApplyIn: aCompiledMethod | ||
with: aParseTree ]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh we are going to simplify this in our next pair programming session! ;)
shouldReplace := referencedClass isClass and: [ | ||
referencedClass subclasses notEmpty ]. | ||
shouldReplace ifTrue: [ classesToReplace add: referencedClass ]. | ||
shouldReplace ] ] ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want that we discuss how to fix this. I know you just followed how others were done, but I don't like blocks used like this!
It even seems like the CI is ok now |
Oh Nice! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more comments, be careful not duplicating code if not needed!
@@ -19,12 +19,14 @@ MTMethodMutationTest >> testAccessing [ | |||
operator := MTReplacePlusWithMinusMutantOperator new. | |||
modifiedSource := operator | |||
modifiedSourceFor: compiledMethod | |||
number: 1. | |||
number: 1 | |||
newExpression: operator newExpression. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could have a method
MTOperator >> modifiedSourceFor: aMethod number: aNumber
self modifiedSourceFor: aMethod number: aNumber newExpression: self newExpression
to avoid duplication right?
added new abstract superclass for mutantOperator and BlockBasedOperator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @DurieuxPol !
Let's discuss about that empty method later!
] | ||
|
||
{ #category : 'instance creation' } | ||
MTSubclassReplacementOperator >> newNodeFrom: anOldNode [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this method empty now?
Added a new operator,
MTSubclassReplacementOperator
, which replaces a class referenced by a reference for each of its subclasses, thus creating a mutant for each one.It's worth noting that only direct subclasses are considered, not all subclasses.