Test speed
Keep the suite fast enough to run on every change by measuring the slow tests, shaping the pyramid, cutting IO from the fast tier, and sharding. Use when the suite is slow enough that developers skip it or batch changes to avoid the wait.From its SKILL.md
npx -y skills add Amey-Thakur/AI-SKILLS --skill test-speedAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.7 KB, 582 tokens by cl100k_base, as published. Nobody here has run it
Test speed
A suite that takes twenty minutes stops being run. People push without it, batch unrelated changes to amortize the wait, and the fast feedback the suite exists to give quietly collapses. Speed is not vanity: it is what keeps testing inside the edit loop. Most slow suites are slow for a few measurable reasons, and the culprits are rarely the tests you would guess.
Method
- Measure before optimizing. Run
pytest --durations=25, Go's-jsontiming, or Jest--verboseand sort. A handful of tests usually own most of the wall clock; fix those and ignore the fast majority. - Shape the pyramid toward the fast tier. Where a unit test can cover a rule, delete the integration test that duplicates it and keep integration tests for the wiring only. To audit the current distribution, defer to test-pyramid-audit.
- Cut IO the fast tier does not verify. Replace a real database with an in-memory one or transactional rollback, swap sleep-and-poll for an injected clock, and stub network calls. A unit test that opens a socket is misfiled: move it or fake the boundary. For choosing those doubles, defer to test-doubles.
- Reuse expensive setup instead of rebuilding it. Start Testcontainers or
a dev database once with
scope="session", not per test, and reset data with fast truncation. A per-test container start is often the single largest line in the durations report. - Run in parallel across cores. Turn on
pytest -n auto(xdist), Go's default package parallelism, or Jest workers. This requires isolation to already hold, so fix order-dependence before expecting the gain. - Shard across CI machines and cache the unchanging. Split the suite by timing across runners so total time drops toward the slowest shard, and reuse built Docker layers and warmed dependency caches so cold-start cost is not paid every run.
Checks
- Does
--durationsshow a flat tail rather than a few tests dominating? - Does the unit tier run with zero real network or disk access?
- Does wall-clock time roughly halve when you double the workers?
Boundaries
Speed serves feedback: do not trade away coverage of real integration seams to hit a number, and keep a slower e2e stage for genuine end-to-end confidence. Micro-optimizing already-fast unit tests is wasted effort. What to cover at each tier is testing-strategy's call. A system that is simply slow to boot is an architecture problem this skill cannot paper over.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most test skills give in 582 tokens
Counted across 1,201 of the 2,096 authors here whose files we hold, read 2026-09-06
- Write a failing test before writing codein 43 of 1201, across 36 files
- Run the full test suitein 36 of 1201, across 35 files
- Test only one variable per experimentin 34 of 1201, across 17 files
- Read product marketing context before asking questionsin 34 of 1201, across 14 files
- Mock external dependenciesin 34 of 1201, across 30 files
- Define primary, secondary, and guardrail metricsin 33 of 1201, across 16 files
- Pre-determine sample size before startingin 31 of 1201, across 14 files
- Test behavior rather than implementationin 31 of 1201, across 29 files
- Formulate a hypothesis before designing a testin 30 of 1201, across 13 files
- Document every test hypothesis, variant, and resultin 29 of 1201, across 11 files
- Use descriptive test function namesin 25 of 1201, across 21 files
- Commit to the methodology without stopping earlyin 24 of 1201, across 8 files
Said here and by no other author read
- Measure test durations before optimizing
- Prioritize fixing the slowest tests
- Replace integration tests with unit tests
- Replace real IO with in-memory alternatives
- Stub network calls in unit tests
- Reuse expensive test setup across sessions
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.