SKILL

unit-testing

Writes unit tests for code that already exists — choosing what deserves a test, what the cases are, and how to assert without welding the test to the implementation. Use this whenever the user asks for tests, unit tests, more coverage, or tests for a specific function or module, and also when adding to untested code where a characterization test is needed first. For building new code test-first, use test-driven-development.

Target: Software development & testing. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original English text

Topics in the source

  • Unit testing
  • 1. Decide what deserves a test
  • 2. Pick the seam
  • 3. Enumerate cases before writing any
  • 4. Write tests that survive refactoring
  • 5. Testing code that was not built for it
  • 6. Keep the suite trustworthy

A test earns its place by failing when something breaks and staying quiet otherwise. A test that never fails is documentation with a runtime cost; a test that fails on every refactor is a tax. Both get deleted eventually, and the second one takes the good tests' credibility with it. Coverage is not the goal. Coverage measures which lines ran, not whether anything was checked — a suite that executes everything and asserts nothing scores beautifully and catches nothing. In descending order of value: 1. Logic with branches — conditionals, loops, calculations, parsing, state transitions 2. Anything that has broken before — bugs cluster; a fixed bug without a test will return 3. Boundaries — where data is validated, converted, or crosses a system edge 4. Contracts other code relies on — a public API's shape and its documented failure modes Not worth it: generated code, thin pass-throughs, framework behaviour, getters, and anything where the test would restate the implementation line for line. Done when: you can say why each planned test exists, in terms of a failure it would catch. Test at the smallest stable interface that exposes the behaviour, not necessarily the smallest unit. A pri

This is an excerpt. Refer to the complete source and its current requirements.

Source repository
OKHP3/skillz
Source file
community/unit-testing/SKILL.md
Fixed revision
7b187777d42ab7bc7bab1e5f2c940cd3139ecebf
Read the complete original documentation ↗

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: OKHP3/skillz · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-10T10:00:54.404Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.