Skip to content

feat(mutation): Implement AST Mutation Testing Engine to Validate Rule Precision - #628

Open
SharifIbrahimDev wants to merge 1 commit into
MDTechLabs:mainfrom
SharifIbrahimDev:feat/ast-mutation-testing-engine
Open

feat(mutation): Implement AST Mutation Testing Engine to Validate Rule Precision#628
SharifIbrahimDev wants to merge 1 commit into
MDTechLabs:mainfrom
SharifIbrahimDev:feat/ast-mutation-testing-engine

Conversation

@SharifIbrahimDev

Copy link
Copy Markdown
Contributor

Closes #607

Summary of Changes

  • Built AST mutation testing framework in tests/mutation/ast-mutator.ts to automatically inject gas anti-patterns (uint8 type sizing, uncached loop length, memory over calldata, postfix increment, redundant SLOADs).
  • Built MutationRunner (tests/mutation/mutation-runner.ts) to execute mutated code variants against the GasGuard rules engine and track mutant detection.
  • Generates structured MutationReport displaying mutant kill score percentages and survived mutant details.
  • Added unit test suite in tests/mutation/mutation.spec.ts.

Files Added

  • tests/mutation/ast-mutator.ts
  • tests/mutation/mutation-runner.ts
  • tests/mutation/index.ts
  • tests/mutation/mutation.spec.ts

Acceptance Criteria Checklist

  • Mutation framework generates valid mutated code variants automatically.
  • Reports rule detection rate ("mutant kill score") across the rule test suite.
  • All 3 unit tests passing.

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@SharifIbrahimDev 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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[INFRA] Implement AST Mutation Testing Engine to Validate Rule Precision

1 participant