feat(testing): add Stryker mutation testing for frontend and backend - #835
Merged
Smartdevs17 merged 1 commit intoJul 30, 2026
Merged
Conversation
Introduce mutation testing infrastructure with Stryker Mutator to validate test effectiveness across both frontend (React Native) and backend (Node.js/Express) modules. - Enhanced stryker.conf.json with broader mutate exclusions, dashboard reporter, concurrency, timeout, and explicit plugin declarations - Added stryker.backend.conf.json for backend mutation testing with jest.backend.config.js and backend/tsconfig.json - Added npm scripts: mutation:frontend, mutation:backend, mutation:all, mutation:score - Added mutation-testing CI jobs (mutation-frontend, mutation-backend, mutation-summary) to ci.yml with score threshold enforcement - Added scripts/check-mutation-score.js for score validation, weak test detection, and dashboard JSON generation - Added reports/mutation-dashboard/index.html — a live web dashboard for mutation scores and weak test visualization - Updated docs/mutation-testing.md with full configuration, usage, reporting, and troubleshooting documentation Closes Smartdevs17#715
|
@EmperorNexus Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds Stryker mutation testing infrastructure to validate the effectiveness of our test suite across both frontend (React Native) and backend (Node.js/Express) modules. Mutation testing injects small changes (mutants) into source code and verifies that tests detect them, surfacing weak or missing test coverage.
Related Issue
Closes #715
Changes
🧬 Mutation Testing Infrastructure
stryker.conf.json— frontend Stryker config with broader mutate exclusions (tests, mocks, fixtures, declarations), dashboard reporter, concurrency 4, 60s timeout, and explicit plugin declarationsstryker.backend.conf.json— backend Stryker config targetingbackend/**/*.tswith Jest backend config andbackend/tsconfig.jsonscripts/check-mutation-score.js— mutation score validator that reads Stryker reports, enforces break threshold (50%), flags weak tests (<60%), and generates dashboard JSONreports/mutation-dashboard/index.html— live web dashboard for visualizing mutation scores, thresholds, and weak test detection📦 Package Scripts
mutation:frontend— run Stryker on frontend sourcemutation:backend— run Stryker on backend sourcemutation:all— run both frontend and backend mutation testsmutation:score— check mutation scores from latest reports🔄 CI Integration
mutation-frontendjob — runs Stryker onsrc/, uploads HTML report as artifact, enforces score thresholdmutation-backendjob — runs Stryker onbackend/, uploads HTML report as artifact, enforces score thresholdmutation-summaryjob — downloads both reports, generates dashboard JSON, prints combined summary📚 Documentation
docs/mutation-testing.md— comprehensive guide covering configuration, running tests, reports, CI, weak test detection, best practices, and troubleshootingVerification Results
stryker.conf.jsonenhancedstryker.backend.conf.jsonaddedci.ymlscripts/check-mutation-score.jswith <60% flaggingreports/mutation-dashboard/index.htmldocs/mutation-testing.mdupdated