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

Question about filtering uncovered lines/files #3019

Closed
bgoscinski opened this issue Jul 23, 2021 · 4 comments
Closed

Question about filtering uncovered lines/files #3019

bgoscinski opened this issue Jul 23, 2021 · 4 comments
Labels
⁉ Question Further information is requested

Comments

@bgoscinski
Copy link

First of all thank you for creating StrykerJS! It's amazing how smoothly I could integrate it with my current codebase! ❤

Question

I have a codebase with very low code coverage but want to ensure that the tests me and my teammates create are effective. Right now when I run Stryker the report looks like this:
image

As you can see the number of not covered mutants is very high. What I'm interested in is filtering them out so that I can see only the files that have > 0% test coverage. Is it possible?

Also is it possible to skip generating mutants for not covered lines/files in the first place? I'm using jest.enableFindRelatedTests so I guess Stryker doesn't try to execute tests for uncovered mutants but I don't know how expensive (in terms of computation) it is to generate them. Could skipping it improve performance? Keep in mind that I'm completely new to mutation testing so this idea might be completely stupid and I'm just not seeing that yet :D

Stryker environment

$ npm ls | grep stryker
├── @stryker-mutator/[email protected]
├── @stryker-mutator/[email protected]

Additional context

@bgoscinski bgoscinski added the ⁉ Question Further information is requested label Jul 23, 2021
@nicojs
Copy link
Member

nicojs commented Jul 23, 2021

Hi @bgoscinski 👋

Mutant generation is very cheap compared to running tests. You can see it for yourself. When Stryker logs "Instrumented xxx source file(s) with xxx mutants" it is done with mutant generation and mutant placing.

Stryker doesn't try to execute tests for uncovered mutants but I don't know how expensive (in terms of computation) it is to generate them

So, not expensive at all. In fact, Stryker needs to first instrument your code (generate and place mutants) and do a full test run without a mutant active (dry run) to determine exactly which mutant is covered and which isn't. Stryker doesnt use jests code coverage for that, it brings its own (mutant) coverage. Not covered mutants won't cause extra tests runs.

@bgoscinski
Copy link
Author

Thanks @nicojs! Good to know :)

How about filtering out not covered mutants from the report? I may not see something obvious but at least for now, for my usecase they seem to be just noise

@nicojs
Copy link
Member

nicojs commented Jul 23, 2021

That sounds like a fair request. I assume you mean from the HTML report? Please file an issue at mutation-testing-elements. That is where the HTML report lives (shared between all Stryker versions and even other mutation testing frameworks).

BTW you might be interested in our proposal for incremental support #2753 , please upvote so we know where to spend our time on next 😉

@bgoscinski
Copy link
Author

Thanks again for super fast reply! :)

--incremental looks super neat! Instant upvote 😃

I assume you mean from the HTML report? Please file an issue at mutation-testing-elements. That is where the HTML report lives (shared between all Stryker versions and even other mutation testing frameworks).

Cool. On it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⁉ Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants