Install any skill in seconds. Free to start, no credit card required.
Get Started Free →nwave-ai/nw-tdd-cross-language
Port the state-delta + property-based testing paradigm to languages other than Python. DIY recipes per language; canonical Python ref shipped in nwave_ai.state_delta.
Passed 19 of 22 test cases with the skill, and 10 of 22 without it.
and 11 more in the full report
9 fixed10 passed either way3 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 9 test cases the skill fixed. Same model, same prompt, with and without the skill.
We are converting our CLI installer test suite from Python to Rust using proptest. We want to implement the state-delta paradigm in Rust to verify file system changes, environment variables, and config files across property runs. Can you provide a guide and code blueprint showing how to adapt the state assertion function, predicate factories, multi-violation tracking, and integrate it with proptest?
| Checked | Without skill | With skill |
|---|---|---|
| Recommends a lightweight shim (~70-150 LOC) rather than an over-engineered test framework. | Missed | Passed |
| Accepts before, after, universe, expected, and strict parameters in the state assertion signature. | Missed | Passed |
| Collects all violations before throwing or returning an assertion failure. | Passed | Passed |
The instructions your model reads when the skill loads.
The state-delta + property-based testing paradigm (see nw-tdd-methodology::Paradigm Mandate) is shipped natively in Python via nwave_ai.state_delta. This skill documents how to apply the same paradigm in other languages with idiomatic adaptations.
Open source positioning (nwave-ai master): Python canonical + DIY porting guide. Users in other languages port the pattern using their language's PBT library + a small state-delta shim (~70-150 LOC).
Enterprise positioning (nwave-pro bundle, deferred): pre-built language packages with tested implementations, kept consistent across versions.
| Language | Test framework | PBT library | State-delta port size | Idiomatic notes |
|---|---|---|---|---|
| Python | pytest | Hypothesis | shipped (nwave_ai.state_delta, ~250 LOC) | Reference implementation. Closure-over-parameters predicates, frozen dataclass Violation. |
| TypeScript / JS | vitest, jest, mocha | fast-check | ~80 LOC | Generics over Old, New. Predicate = (old: O, new: N) => boolean. Use expect.fail() for AssertionError equivalent. |
| Java | JUnit 5 | jqwik | ~120 LOC | Verbose generics (Predicate<O, N>). Builder pattern for assertStateDelta(...) fluent API. Use AssertionError. |
| Kotlin | kotest (built-in PBT) | native | ~80 LOC | DSL idiomatic — assertStateDelta { universe(...) ; expected(...) }. Lambda predicates fit naturally. |
| F# / .NET | xUnit, NUnit | FsCheck | ~70 LOC | Functional fit naturale. Discriminated unions for Violation, partial application for predicate factories. |
| Rust | cargo test | proptest | ~100 LOC | Fn traits for predicates. struct Violation with derive(Clone, Debug). Returns Result<(), AssertionError>. |
| Go | testing | gopter, quick | ~150 LOC | More verbose due to lack of closures over generics. Predicate = function accepting interface{}. Use t.Errorf for assertion. |
| OCaml | alcotest | qcheck | ~70 LOC | Functional fit naturale. Variant types for Violation, partial application natural. |
| Scala | ScalaTest | ScalaCheck | ~80 LOC | Pattern matching for Violation, implicit conversions for fluent predicate composition. |
API contract (locked at pilot, see nwave_ai.state_delta.matcher):
def assert_state_delta(
before: Mapping[str, Any],
after: Mapping[str, Any],
universe: set[str],
expected: Mapping[str, Predicate],
*,
strict: bool = False,
) -> None: ...
test cases passed, vs 10 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.