- Structure tests in a separate `tests/` directory. Each test function should test one behavior.
- Use assertion macros for test checks. Prefer non-fatal assertions that let the test continue.
- Use Google Test `TEST_F()` with fixtures for shared setup/teardown — each test method gets a fresh fixture instance.
- Use test fixtures for shared setup/teardown across related tests.
- Use parameterized tests for testing with multiple input combinations.
- Compile tests with sanitizers (`-fsanitize=address,undefined`) to catch memory and UB errors.
- Mock interfaces for dependency isolation — use mock libraries for automatic mock generation.