-
Notifications
You must be signed in to change notification settings - Fork 187
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
Add coverage analysis to offer improved performance #388
Comments
From dupdop: Some update: I have namedpipes running smoothly and stable, after a few fights. Code available here: |
I have a branch ready, just waiting to finish with my current PR. |
@dupdob Yes I've seen it. The named pipe seems like a good way to implement this. Step 3 can be achieved with the vstest integration. To achieve step 4 I was thinking we could create a named pipe from the mutated assembly to a vstest data collector (out of proc as well) and then a named pipe from the data collector to stryker. The datacollector can execute for every single test being run and while in the middle we can receive which mutants have been hit for that testrun from the mutated assembly. Then we can send that information including the test that was run to stryker through the other named pipe. And then we can use vstest to run only those unit tests that are relevant to the mutant. |
@Mobrockers
The biggest disappointment for me was the fast that vstest provided little more than a facade against dotnet test... I have various leads and ideas on how to fix those issues, but the fact is it turned more difficult than anticipated...
|
OK, went through the code, AreTestCaseLevelEventsRequired does not serve the purpose I hoped fore (sequential notification) |
How do you mean? Dotnet test internally uses vstest, not the other way around |
I hope using a datacollector can specifically help really much with this problem because of: Example: I understand that it's only an MVP of course, so I get that you're not immediately going for a double named pipe with all it's added complexity. |
You are right in that vstest is internally a big can of worms :) It also internally spawns new processes for dotnet.exe, testhost.exe, and sometimes datacollector.exe and other collectors depending on configurations 💃 |
Quick summary regarding various steps:
@Mobrockers : I missed your comment regarding DataCollector, will dig into this, indeed it looks what I need to address the issues I face with step 2! |
I just had an idea I find interesting: I am fascinated by the mutant->tests mapping information and I had a hunch there was value in those. And I may has just found it.
I am not sure I am clear enough and that it makes sense to you, but I add it as an idea to be considered at a later time. |
Perfectly clear to me, sounds awesome!
…On Sat, Mar 16, 2019, 15:57 Cyrille DUPUYDAUBY ***@***.***> wrote:
I just had an idea I find interesting: I am fascinated by the
*mutant->tests* mapping information and I had a hunch there was value in
those. And I may has just found it.
We could use coverage information in reports to provide hints. E.G:
- if a mutant is not covered, suggestion should be around adding a
test or refactoring code
- otherwise, suggestion could be to consider reviewing some of the
tests that cover the survivor.
- and we could even cross information for survivors to identify quick
win, i.e. need to improve a single test to kill 5-6 mutants.
I am not sure I am clear enough and that it make sense to you, but I add
it as an idea to be considered at a later time.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#388 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADbenDI0H1QABU89DV3UtwYEsHgj4UFIks5vXQZ1gaJpZM4bd_Np>
.
|
Monday update: I had the opportunity to explore and I made a cool discovery: I can use VsTest data collection architecture to forward coverage results to Stryker, which should help avoid the 'double pipe' strategy proposed by @Mobrockers. |
Quick update: the vstest runner now uses environment variables to transfer coverage data between test assembly and host. It means we no longer have to run tests in isolation to capture coverage. |
Cool! Sounds awesome. Keep up the good work! |
Sounds good! |
I made a run with NFluent, time is 55 minutes versus 135 minutes without optimisation. |
Monday morning status update: still working on this. As environment variables do not seem target to me (performance and available space concerns), I have migrated back to pipes, but this is a constant struggle to make them work properly. Tests deadlock without identifiable cause, debugging is difficult and I can't find a way to log from the InProcDataCollector |
Can you not log to file? |
Thanks for the suggestion
The problem is that you have to coordinate the the consumption of the data:
the mutated assembly side (mutantcontrol side) has no clue when tests start and stop, while the collector side knows but has no direct access to coverage data.
I need to capture covered mutants and reset the list between tests
The pipe is relatively good for that, as it allows synchronous request reply pattern.
I can use a file, but it will be slower than environment variables., hence it is my fallback strategy for now.
Envoyé de mon iPhone
… Le 1 avr. 2019 à 17:48, Rouke Broersma ***@***.***> a écrit :
Can you not log to file?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sorry for the confusion, I meant in relation to this part
You could debug-log to file from the datacollector no? |
Good news, finally spotted the deadlock issue: a bug in my pipe reading class when receiving an empty message. I can keep on improving my code. |
Awesome :)
…On Mon, Apr 1, 2019, 22:25 Cyrille DUPUYDAUBY ***@***.***> wrote:
Good news, finally spotted the deadlock issue: a bug in my pipe reading
class when receiving an empty message. I can keep on improving my code.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#388 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADbenGY2ojb80pfhgr75p5TAsuP0wOaHks5vcmtDgaJpZM4bd_Np>
.
|
Deadlock is gone, but I still have what looks like race conditions when capturing coverage. |
I think setting the option mentioned in that nunit issue in the runsettings
by default might be an acceptable workaround assuming it fixes the issue.
It should not interfere with other testrunners.
…On Tue, Apr 2, 2019, 22:33 Cyrille DUPUYDAUBY ***@***.***> wrote:
Deadlock is gone, but I still have what looks like race conditions when
capturing coverage.
I think it may relates to this issue
<nunit/nunit3-vs-adapter#560> with Nunit.
If I can confirm this is related to NUnit, I will probably add an option
to workaround it until it is fixed on NUnitAdapter side
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#388 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADbenKIFw8R4jZUQ03XjLIzm57jtHhv5ks5vc76vgaJpZM4bd_Np>
.
|
I used it. (Kinda) Interestingly it triggered new deadlock issues. I guess I still have bugs. No worries, I love brainteasers and I am happy to find bugs BEFORE opening a PR. Note that sequential execution slows test execution. |
see #506 |
Implemented by #506 |
This issue follows from #183
Generate mutant coverage (which mutants is actually executed by any test). This could provide useful metrics as of now.
Offer to skip test runs for non covered mutants (hence assumed as survivors)
==> Improve performance for projects with low test coverage.
Identify tests that do not cover any mutant, offer to skip them from each run.
==> Could improve performance for projects with many tests
Optimise executed tests according to mutant coverage (i.e. run only the tests that cover the 'current' mutant)
==> Should dramatically improve performance
Step 1 requires to able to access coverage results from Stryker
Step 2 looks simple
Step 3 requires to control which tests are run
Step 4 require analysis of coverage data to build strategy
The text was updated successfully, but these errors were encountered: