counterexample-to-test-generator

Converts model checker counterexample traces into executable test cases.

142|14|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill counterexample-to-test-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: counterexample-to-test-generator
Source: https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/counterexample-to-test-generator
Command: npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill counterexample-to-test-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill bridges the gap between formal verification and software testing by automatically converting counterexample traces from model checkers into executable test cases. This ensures that critical bugs found during verification are reliably reproduced and can be fixed.

Core Features & Use Cases

  • Automated Test Generation: Creates runnable tests from abstract counterexample traces.
  • Trace-to-Test Mapping: Links specific test code lines back to counterexample steps for clarity.
  • Model Checker Agnostic: Supports outputs from various tools like SPIN, CBMC, NuSMV, TLA+, and JPF.
  • Use Case: After using a model checker like SPIN to find a deadlock in your concurrent system, use this Skill to generate a C test case that specifically triggers that deadlock, allowing developers to debug and fix it efficiently.

Quick Start

Use the counterexample-to-test-generator skill to create an executable test case from the provided SPIN counterexample trace file.

Frequently Asked Questions about counterexample-to-test-generator

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

FAQPage Schema
How do I generate executable test cases from model checking counterexample traces?

To generate executable test cases from counterexample traces, you translate abstract counterexample states and transitions into concrete test inputs, execution steps, and assertions that reproduce property violations. This creates runnable regression tests from verification failures.

Can I convert SPIN counterexample traces into executable regression tests?

Yes, you can convert SPIN counterexample traces into executable regression tests. The generation process supports outputs from SPIN and other model checkers, linking specific test code lines back to counterexample steps for clarity during debugging.

Does counterexample to test generation work with NuSMV, CBMC, TLA+, and Java PathFinder outputs?

Counterexample to test generation is model checker agnostic and works with outputs from NuSMV, CBMC, TLA+, and Java PathFinder. It translates these abstract verification failures into executable test suites regardless of the specific verification tool used.

What is the best way to reproduce a deadlock found by a model checker in a C test case?

The best way to reproduce a deadlock found by a model checker is to generate a C test case that specifically triggers that deadlock. This bridges formal verification and software testing by converting abstract counterexample traces into concrete, reproducible tests.

How do counterexample traces map to concrete test inputs and assertions?

Counterexample traces map to concrete test inputs by linking specific test code lines directly back to counterexample steps. This trace-to-test mapping ensures that abstract state transitions are translated into executable assertions reproducing the property violation.

Why do I need to convert formal verification failures into executable test suites?

You need to convert formal verification failures into executable test suites to ensure that critical bugs found during model checking are reliably reproduced. This allows developers to validate bug fixes efficiently within standard regression testing workflows.