mutation-testing

Create controlled code mutations in Pact projects to measure test effectiveness.

1|1|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/Pact-Community-Organization/github-marketplace --skill mutation-testing-pact-community-organization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mutation-testing
Source: https://github.com/Pact-Community-Organization/github-marketplace/tree/main/skills/mutation-testing
Command: npx skills add https://github.com/Pact-Community-Organization/github-marketplace --skill mutation-testing-pact-community-organization

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Mutating Pact code helps verify test quality by introducing deliberate bugs and checking whether the test suite detects them, revealing gaps in coverage and robustness.

Core Features & Use Cases

  • Arithmetic mutations: flip operators and constants to reveal sensitivity.
  • Logic mutations: swap and negate logical conditions to expose branch coverage issues.
  • Capability mutations: adjust or remove capability wrappers to test authorization logic.
  • Data access mutations: alter reads/writes and defaults to test data integrity.
  • Use Case: Validate that a Pact contract's test suite catches common mutation errors across arithmetic, logic, and IO.

Quick Start

Run a mutation session against your Pact project and run the test suite to see which mutations are killed and which survive, highlighting gaps to fix in tests.

Frequently Asked Questions about mutation-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does mutation testing measure smart contract test quality?

Mutation testing measures smart contract test quality by injecting controlled bugs into Pact code and observing whether the test suite detects them. Surviving mutations indicate inadequate coverage and robustness gaps in the test suite.

What types of mutations are applied to Pact code during testing?

Mutations applied to Pact code include arithmetic operator flips, logical condition negations, capability wrapper adjustments, and data access alterations. These deterministic mutations expose branch coverage issues and test data integrity.

How do I run a mutation testing session on my Pact project?

To run a mutation testing session on a Pact project, execute the mutation operators against your code and run the test suite. The resulting report highlights which mutations are killed and which survive to fix test gaps.

Why does my Pact test suite pass but still miss logic and capability bugs?

Your Pact test suite passes but misses bugs because standard coverage metrics do not verify test assertions. Mutation testing addresses this by deliberately swapping logical conditions and removing capability wrappers to expose untested authorization logic.

Can I use mutation testing to validate authorization logic in Pact smart contracts?

Yes, you can validate authorization logic in Pact smart contracts through capability mutations. This process adjusts or removes capability wrappers during testing to ensure your test suite actively verifies authorization rules.