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
[RFC] Improve CLI report #222
Comments
As mentioned in slack, i'm a fan of making And if we are generating an extensive CLI report, i'd like to use some kind of verbosity flag |
What would you use the |
Completeness is one thing. It also helps to see what mutations would be created on not yet tested code. |
First of all, thanks as always for your ideas guys 👍 I would like to move each point to a separate issue because it's too hard to follow the discussion, too many things are being discussed. Here are my 2 cents:
Could you please clarify what does user want to debug here? I agree that currently it's not clear how long does it take to run initial tests suite with this progress bar
But I'm not sure we need to display the whole PHPUnit's output as it can be too long (imagine 2000 tests, or imagine I would propose here something like progress bar with percentage:
Again, we can use Verbosity level to display percentage by default, or full output with more verbose level.
This is what I've been dreaming about last days ;) Just one minor suggestion, instead of
display
as I think time - is what bothers people a lot with MT, not the memory usage.
Nice one. One addition from me here is to display all registered loggers, not just
Last two points (about killed/escaped/timeouts and different kinds of MSI) are much more complicated.
Yes, we are wasting time parsing them, but I can't say this is useless metric. Let me past a quote from our docs:
I like this example, because it shows that the test coverage metric (65%) of a particular project does not cover all branches/edge cases. Mutation testing shows here that there is a room for improvements. On the other side, when you have 5% of Test Coverage, you can have 100% of Covered Code MSI. Personally, I like this mutation score much more than just MSI, because it doesn't force you to write tests for everything, but only force you to write maybe few, but good tests. What I don't quite understand is Mutation Code Coverage. |
I think we can skip the why for now as it should be answered in the documentation rather than here I think. What I'm missing from the initial test run here is:
I actually totally agree with this. However I think there is some confusion here. So imagine you have the following files with their respective coverage:
So the total code coverage is 66%. Right now (or at least from my understanding) Infection takes those 3 files as an input. For the sake of the example let's say 2 mutants are generated for the first two and 1 for the last, the result would be:
My point here is that mutating a file that is not covered is useless (at least right now). The reasoning being that the code coverage tells you what is not tested. If it is not tested, it cannot be killed, so not point measuring. So in the case above you would instead have:
And I would actually argue that I didn't encounter this notion of "not covered" mutant. So to me the MSI is In other words, I think we agree on the purpose: MSI is more accurate than code coverage. In the example above it shows that even though the code coverage is of 66%, actually only 50% of it is actually tested (and maybe that's what the CCMSI should be instead: If you disagree I think we should go ahead and discuss about this in another issue :) So unless anyone has a different opinion, I think there's a couple of things we can already implement. The remaining points to discuss are:
which I think would be best discussed in dedicated issue. |
Mutating a file that is not covered isn't as useless as it seems. Think of it as a measure of potential defects. Every "not covered" mutant is a potential problem lurking out where, a problem for which one should write a test. (So far all not covered mutant I found were harmless, but that's different question.) |
@sanmai I don't really see the point still tbh. You don't need mutation testing for that: path code coverage is enough and besides being cheaper (it's way faster to get), it is mandatory for Infection right now |
Well, with what I agree with you is that actually mutating a non-covered file is really pointless. It's uncovered so by definition no tests will show a thing. Only counting possible mutations should be enough. Am I still not any closer to your thinking? |
Yes, except I'm not sure I really see the benefit of that :) It does have a cool factor as you can see that there would be X more mutants generated if you covered those files, but let's keep in mind that this is quite expansive: we are parsing each of those files with PHP-Parser. So I don't find that the performance tradeoff we are doing here is worth the little (IMO) value this information provides |
After playing a bit for a demo I found a few things that were either bugging me or that I think are a bit confusing.
This discussion was on Slack initially but I think putting it here is more appropriate. So right now here's the current CLI report:
Current report
So here's the list of my nitpicks from a potential a first-time user:
killed
andescaped
: what isnot covered by tests
,not detected
,errors
andtime outs
?Mutation Score
, why do I have 3 of them?Also although I think it would be cool at some point to be able to say "execute all the tests" or specific tests for non-covered mutants, I think it's too early for this extension point and for now way too expansive. As such I would just suggest to drop the notion of "not covered" and completely ignore non-covered code for now.
But because complaining is easy, here's a suggestion for improvements:
Suggested report
WDYT?
The text was updated successfully, but these errors were encountered: