| Concept | Category | Core idea |
|---|---|---|
| TDD | Workflow | Write the failing test first; let it pull the implementation into existence |
| BDD | Workflow | Same as TDD but tests are phrased as behaviour specs readable by non-engineers |
| Regression testing | Workflow | Re-run tests to confirm a fixed bug stays fixed |
| Given-When-Then | Syntax | A sentence template for writing BDD scenarios |
| Unit testing | Scope | Test one function/module in isolation |
| Integration testing | Scope | Test multiple units working together, not in isolation |
| E2E testing | Scope | Drive the real UI through real user flows (Playwright, Cypress) |
| Stub | Test double | Replace a dependency with a fake that returns canned values |
| Mock | Test double | A stub that also asserts it was called in a specific way |
| Spy | Test double | Wraps the real implementation but records calls — observe without replacing |
| Fake | Test double | A working but simplified implementation (e.g. in-memory DB instead of real DB) |
| Test fixture | Setup | Shared, reusable setup data or state for a group of tests |
| Snapshot testing | Assertion style | Capture output once; future runs fail if it changes — common in UI |
| Property-based testing | Input strategy | Describe invariants; framework generates random inputs to break them |
| Mutation testing | Confidence check | Deliberately break your code; if tests don't catch it, the tests are weak |
| TAP | Output protocol | Standardised text format so any runner can talk to any harness |
| JUnit XML | Output protocol | XML format consumed by CI systems (GitHub Actions, Jenkins, GitLab) |
| CTRF | Output protocol | Newer JSON-based format, CI-agnostic |
- Test state coverage, not code coverage.
- Identify and test significant program states. Just testing lines of code isn't enough.
- There are several definitions of objects, that are not real. The general term is test double. This term encompasses: dummy, fake, stub, mock.
- A mock is both a technical and a functional object.
- Fuzzing
- canary testing
- "canary bird in the coal mine."
- from https://www.reddit.com/r/rust/comments/sdag9x/is_there_a_rust_way_for_doing_tdd/hudzvn0/
In XP, there are 2 kinds of tests: acceptance tests and unit tests. An acceptance test executes the code and verifies that it performs according to the acceptance criteria (the requirements of the application, so to speak). Unit tests do not verify the code against acceptance criteria.
The idea of a unit test is to essentially document behaviour.
- unit testing advice my @ThePrimeTime
- should be declarative
- meaning no logic inside them
- not useful during programming.refactoring
- because you change the unit
- functional or integration tests are better for refactoring
- should be declarative
Lookup
- fake-mock
- progamming.testing.given-when-then
- On the Diverse And Fantastical Shapes of Testing
- https://hypothesis.works/
- Why I Recommend Unit Tests in the Src Folder
- Mocks Aren't Stubs
- https://stackoverflow.com/questions/3459287/whats-the-difference-between-a-mock-stub
- https://blog.pragmatists.com/test-doubles-fakes-mocks-and-stubs-1a7491dfa3da
- https://en.wikipedia.org/wiki/Test_fixture#Software
- https://hypothesis.works/
- https://www.sqlite.org/testing.html
- Five Underplayed Premises Of TDD | Video – GeePawHill.org
- Beware the Integrated Tests Scam (was Integrated Tests Are a Scam) - The Code Whisperer
- Home - Test Anything Protocol