-
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
Refactoring and tests for other utilities #73
Refactoring and tests for other utilities #73
Conversation
Pull Request Test Coverage Report for Build 7782239506Warning: This coverage report may be inaccurate.We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
💛 - Coveralls |
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!!
I like the changes.
I propose some renames and little API changes, what do you think about them?
MTMutantOperatorAnalysisTest >> testGetAllOperators [ | ||
|
||
| actual expected | | ||
actual := (operatorAnalysis operatorsProducingOverXMutants: 0) keys |
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.
the name of this method is strange :)
operatorsProducingOverXMutants:
Does it mean they produce more than 0 mutants?
Alsy, why is it answering a dictionary? I see all your tests do keys asSet
, keys asSet
, keys asSet
. This means that probably we want a method returning the set of keys directly and hide the fact that internally it's a dictionary right? :D
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.
Actually, Over 0
means > 0
or >= 0
? Maybe a little rename could clarify "At least" vs "More than"
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 think it can be useful to return a dictionary, to actually see how many mutants are produced by each operator.
But yes I think I could add a bit more methods, like the whole dictionary, the set of mutants producing at least a certain number of mutants, the 10 most producing operators, things like that.
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.
Actually there is already a method returning the whole dictionary, forgot about it ahah
|
||
| actual expected | | ||
actual := (operatorAnalysis operatorsProducingUnderXMutants: 2) keys | ||
asSet. |
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.
Here it's the same but the other way around.
- the
keys asSet
looks like the same smell (but duplicated code?) - under is < x or <= x ? :D
^ self | ||
forPackages: aCollectionOfPackages | ||
andTestPackages: | ||
(aCollectionOfPackages collect: [ :package | package , '-Tests' ]) |
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 like this. This forces a convention!!!
|
||
| analysis dic classesToMutate | | ||
classesToMutate := aName asPackage definedClasses. | ||
MTMutantOperatorAnalysis >> getMutantOperatorsDictionary [ |
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.
remember that in Pharo code we don't use the get/set
prefixes in methods as a convention.
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.
Indeed, I will change that.
@@ -76,23 +68,19 @@ MTMutantOperatorAnalysis >> getMutantOperatorsDictionaryFor: aName [ | |||
] | |||
|
|||
{ #category : 'computing' } | |||
MTMutantOperatorAnalysis >> operatorsProducingOver: aNumber mutantsFor: aCollectionOfPackages [ | |||
MTMutantOperatorAnalysis >> operatorsProducingOverXMutants: aNumber [ |
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.
Removing this extra parameter all over the code is indeed an improvement :)
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 Pol!
Refactored
MTMutantOperatorAnalysis
andMTMissingMutantOperatorAnalaysis
(renamed asMTNonMutatedMethodsAnalysis
) to support better APIs.Also added tests for them.