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

[rfc draft wip...] start mutation testing using Stryker [...] #6681

Closed
wants to merge 9 commits into from

Conversation

brodycj
Copy link
Contributor

@brodycj brodycj commented Oct 17, 2019

as documented in: https://stryker-mutator.io/stryker/quickstart

with mutate entry added to stryker.conf.js to check JavaScript in src/cli

with a quick report here now outdated: https://chrisbrody.com/prettier-cli-mutation-report/index.html

report generated by the following command: npx stryker run

A TODO item is to add stryker run to scripts in package.json.

I am trying to use Stryker as much as I can in the various projects that I maintain and contribute to.

I had to use a Vultr server with 16 virtual CPUs (64 GB RAM) to get reasonable performance. Others may have better luck with more powerful workstations.

If I would try Stryker with all JavaScript files in src, or even all JavaScript in src/language-js, it would crash on me. This seems to be discussed in stryker-mutator/stryker-js#1230 & stryker-mutator/stryker-js#1284, other results in https://www.google.com/search?q=stryker+out+of+memory.

I hope this is helpful, will understand if not.

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory)
  • (If the change is user-facing) I’ve added my changes to the CHANGELOG.unreleased.md file following the template.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@brodycj
Copy link
Contributor Author

brodycj commented Oct 18, 2019

Using node --max-old-space-size=40000 seems to solve the problem running on all sources ref: stryker-mutator/stryker-js#1284 (comment)

Closing for now, will open a fresh new PR once I get a better handle on this.

@brodycj brodycj closed this Oct 18, 2019
@brodycj brodycj reopened this Nov 5, 2019
@brodycj brodycj changed the title [rfc] start mutation testing using Stryker - CLI only for now [wip rfc draft] start mutation testing using Stryker - CLI only for now Nov 5, 2019
@brodycj brodycj force-pushed the start-mutation-testing branch from ff97a3b to 966b482 Compare November 7, 2019 03:38
@brodycj brodycj changed the title [wip rfc draft] start mutation testing using Stryker - CLI only for now [rfc ...] start mutation testing using Stryker [...] Nov 12, 2019
Christopher J. Brody added 8 commits November 13, 2019 00:55
as described in: https://stryker-mutator.io/stryker/quickstart

$ npx stryker init
? Are you using one of these frameworks? Then select a preset configuration. None/other
? Which test runner do you want to use? If your test runner isn't listed here, you can choose "command" (it uses your `npm test` command, but will come with a big performance penalty) command
? What kind of code do you want to mutate? javascript
? [optional] What kind transformations should be applied to your code?
? Which reporter(s) do you want to use? html, clear-text, progress
? Which package manager do you want to use? yarn
Writing & formatting stryker.conf.js...
Installing NPM dependencies...

and add the following line to the beginning of stryker.conf.js
(with another blank line)
to make lint (eslint) happy:

"use strict";
with --no-cache

in order to avoid any potential surprises from Jest caching
@brodycj brodycj changed the title [rfc ...] start mutation testing using Stryker [...] [rfc draft wip...] start mutation testing using Stryker [...] Nov 13, 2019
@brodycj
Copy link
Contributor Author

brodycj commented Nov 13, 2019

I tried starting Stryker mutation testing on the following sets of source files on a virtual server with 40 CPUs:

  • src/common/*.js
  • src/language-js/*.js
  • src/utils/*.js

with the following command:

nohup yarn stryker | tee stryker-language-js-processing-output.txt &

After about 14.5 hours I found the following information at the end of stryker-language-js-processing-output.txt:

Mutation testing 20% (ETC 54h, 17m, 0s) 3219/15438 tested (660 survived, 302 timed out)
Mutation testing 20% (ETC 54h, 17m, 38s) 3219/15438 tested (660 survived, 302 timed out)
Mutation testing 20% (ETC 54h, 18m, 16s) 3219/15438 tested (660 survived, 302 timed out)
Mutation testing 20% (ETC 54h, 18m, 54s) 3219/15438 tested (660 survived, 302 timed out)
Mutation testing 20% (ETC 54h, 19m, 32s) 3219/15438 tested (660 survived, 302 timed out)
Killed
error Command failed with exit code 137.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

At this point I will probably have to run Stryker on one src subdirectory at a time.

My apologies to the community for all of the noise here. I will likely continue working in a PR on my own fork for now.

@brodycj brodycj closed this Nov 13, 2019
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Feb 12, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Feb 12, 2020
@brodycj brodycj deleted the start-mutation-testing branch August 18, 2020 17:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant