characterisation-tests

Record current behavior of legacy code with characterisation tests.

3|Updated May 3, 2026
One-click install
npx skills add https://github.com/chloebrett/slay --skill characterisation-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: characterisation-tests
Source: https://github.com/chloebrett/slay/tree/main/.claude/skills/characterisation-tests
Command: npx skills add https://github.com/chloebrett/slay --skill characterisation-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the challenge of understanding and documenting existing code behavior that lacks proper tests, enabling safe modifications and refactoring.

Core Features & Use Cases

  • Behavior Documentation: Capture the actual output of legacy or untested code paths to serve as a safety net during refactoring.
  • Error Path Characterisation: Identify how systems behave under exceptional conditions, including rejected promises or exceptions.
  • Guided Process: Provides practical steps, heuristics, and examples for creating effective characterisation tests in various programming environments.

Quick Start

Load the code you wish to understand into a test harness, write a dummy assertion expecting a placeholder, observe the actual output, then update your test to expect that output.

Frequently Asked Questions about characterisation-tests

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

FAQPage Schema
How do I write characterisation tests for legacy code with no existing tests?

Characterisation tests document legacy code behavior by loading code into a test harness, observing actual outputs, and updating assertions to match those outputs for safe refactoring.

Can I use characterisation tests for asynchronous code paths and rejected promises?

Yes, characterisation tests support asynchronous code paths by examining rejected promises, exceptions, and error handling to document system behavior under exceptional conditions.

What is the best way to document current code behavior before refactoring?

The best way to document code behavior before refactoring is writing characterisation tests that capture actual outputs, boundary conditions, and side effects to build a safety net for future changes.

How do characterisation tests differ from mutation testing?

Characterisation tests record actual current behavior to enable safe refactoring of untested legacy code, while mutation testing evaluates test suite effectiveness by introducing code mutations to detect coverage gaps.

What are the limitations of characterisation tests for complex systems?

Characterisation tests document existing behavior but do not verify correctness, meaning they capture and enshrine existing bugs as expected outputs unless developers manually identify and exclude incorrect behavior.