# Unit Tester for Algorithm Validation

Write metric-driven unit tests for one toolbox algorithm, using assertions defined in TESTING.md. The deliverable includes test cases that validate algorithm behavior against independent references.

**Canonical URL:** https://skillshunter.net/skills/discovered-2a5e37d9b795bdc6301d4e491d2e7fa887a5c5c06a65713e

**JSON URL:** https://skillshunter.net/api/public/v1/skills/discovered-2a5e37d9b795bdc6301d4e491d2e7fa887a5c5c06a65713e

**Markdown URL:** https://skillshunter.net/skills/discovered-2a5e37d9b795bdc6301d4e491d2e7fa887a5c5c06a65713e.md

**Instructions download URL:** https://skillshunter.net/skills/discovered-2a5e37d9b795bdc6301d4e491d2e7fa887a5c5c06a65713e/download

**Category:** Software & Development

**Source URL:** https://github.com/embedded-pro/embedded-agent-kit/blob/25b3baf222edcd427aa6cfbbc1429151ddd5bb33/skills/unit-tester/SKILL.md

**Source commit:** 25b3baf222edcd427aa6cfbbc1429151ddd5bb33

**Listing approved at:** 2026-12-02

**Created at:** 2026-11-30T09:04:10.000000Z

**Updated at:** 2026-12-02T09:15:52.000000Z

## Catalog information

The following descriptions are catalog information. Listing approval does not mean the skill has been tested or is safe for every environment.

### Editor's note

Before starting, read `TESTING.md` and the public interface in `<root>/<domain>/<Name>.hpp`, `doc/<domain>/<Name>.md`, and `<root>/<domain>/test/Test<Name>.cpp` if it exists. Select the algorithm's metric family (M1–M9) and apply robustness dimensions R1–R3 always, and R4–R6 where applicable.

### When to use it

- Add unit tests for a new algorithm in the numerical toolbox
- Extend existing tests for a robotics algorithm
- Validate a neural network algorithm against defined robustness dimensions

## Skill instructions

---
name: unit-tester
description: Write metric-driven unit tests for one toolbox algorithm, with assertions against independent references chosen from TESTING.md. Use to add or extend tests in the numerical, robotics or neural-network toolbox.
---

Add or extend the tests of one algorithm. `<root>` is the source folder that AGENTS.md *Domain* names.
`TESTING.md` defines what to assert: metric families M1–M9 and, where it defines them, robustness dimensions R1–R6.
Apply them; do not copy them.

## Steps

1. Read `TESTING.md`, the public interface in `<root>/<domain>/<Name>.hpp`, `doc/<domain>/<Name>.md`
   and `<root>/<domain>/test/Test<Name>.cpp` if it exists.
2. Find the algorithm's family in `TESTING.md`. Select its M metrics. If `TESTING.md` defines R1–R6, apply R1–R3 always and R4–R6 where the family needs them.
3. Write one `TEST_F` on `float` per property. Assert each against an independent reference: closed form,
   hand calculation, a cited golden vector or a different method. Use `EXPECT_NEAR` with `math::Tolerance<float>()`.
4. Add a new test file to `<root>/<domain>/test/CMakeLists.txt`.
5. Run the *Build* commands. Fix until build and tests pass.
6. Check the per-algorithm checklist in `TESTING.md`, if it has one. Coverage must be ≥ 90 %; an uncovered branch
   usually means a missing unhappy-flow test.
7. Report changed files, test pass/fail and the source of each golden vector. Put the sources in the report, not in the test file.

## Rules

- Never assert the implementation against its own output.
- One behaviour per test. No test per parameter permutation.
- Seeded random generators only.

