stryker-mutator / stryker-js

Mutation testing for JavaScript and friends
https://stryker-mutator.io
Apache License 2.0
2.55k stars 242 forks source link

Stryker Run From Source IDE Integration #4779

Open jaspervdveen opened 3 months ago

jaspervdveen commented 3 months ago

Is your feature request related to a problem? Please describe. While developing, each time you need to run Stryker, you are forced to switch back and forth between your IDE and the command line. After running the tests, you must then sift through the console output or browser reports to identify the specific mutations that need attention.

This back-and-forth process not only interrupts your concentration but also consumes valuable time. Besides that, testing specific mutants or subsets of mutants via glob patterns can be time-consuming. As a result, improving your test results can lead to a prolonged and sometimes frustrating cycle of testing and adjustment.

Describe the solution you'd like It would help if developers can seamlessly test a small set of mutations within their IDE and receive immediate feedback on their status. This integration would not only streamline the testing process but also keep developers engaged and focused within their coding environment.

Describe alternatives you've considered I am aware of existing (VS Code) IDE extensions which can run Stryker tests against a specific folder, file or selected block of code (line range) from the context menu. However, these extensions still require mapping your code to the results in the browser report.

Additional context As an intern at Info Support, I am working on a project with a goal to improve the feedback cycle by seamlessly integrating Stryker in IDES. My focus will be on integrating StrykerJS in VS Code in the coming months. So, if you have any cool ideas or suggestions on how we can make Stryker integration in VS Code even better, please don't hesitate to reach out. I'll keep you updated on the progress of this project and any developments regarding Stryker integration in VS Code.

nicojs commented 3 months ago

Hi @jaspervdveen , welcome!

This feature would be very cool indeed! I would love it if this tool could support multiple flavors of Stryker. To do that, I would suggest aligning on the JSON output; that way, the tool could work for any project creating a valid mutation-testing-elements report json. You could try to pick up this JSON file after a run, interpret the result and show it right in your IDE/code editor.

If in-IDE/code-editor feedback on mutation testing progress could be handled the same way as real-time reporting in mutation-testing-elements, we could enable it from any Stryker flavor easily (we don't support real-time reporting yet, but it is on the backlog).

jaspervdveen commented 3 months ago

Thank you for your ideas! My plan is to align on the JSON output, as well as supporting real-time reporting so mutation results are updated real-time in the Test Explorer during a test run.

Initially, I'll prioritize support for StrykerJS, but I'll keep other Stryker flavors in mind to facilitate their integration in subsequent phases.