Browse Source

docs: optimize continue.md — remove redundancies and fix ambiguities

test-refactor
cinnaboot 2 months ago
parent
commit
f7c43594d5
  1. 10
      continue.md

10
continue.md

@ -5,7 +5,7 @@
### 1. Structure
- One `SCENARIO("description")` per logical test group, with `[tag1][tag2]` annotations
- Shared fixture: all constants, structs, and variables declared between `SCENARIO` opening and first `SECTION`
- Run `scripts/precalc_*.py` to generate expected values — these Python scripts are the authoritative source, providing an independent check against the C++ simulation. Embed the values directly in `WithinAbs()` calls (no need to declare named constants unless the value is reused).
- Embed expected values directly in `WithinAbs()` calls (see Section 4 for precalc script usage). No need to declare named constants unless the value is reused.
### 2. Duplication Elimination
- Use lambdas that capture the fixture for repeated setup→call→assert patterns
@ -24,7 +24,7 @@ All constants defined in `src/test_utilities.h` — use those, do not redefine l
| Constant | Value | Use for |
|----------|-------|---------|
| `A_TOL` | `1e-6` | Semi-major axis (meters), magnitude < 1e10 |
| `A_TOL` | `1e-6` | Semi-major axis (meters) |
| `E_TOL` | `1e-12` | Eccentricity, round-trip conversion |
| `ANG_TOL` | `1e-12` | Angles in radians (nu, inc, Ω, ω) |
| `ANG_TOL_COARSE` | `1e-4` | Angles, degenerate cases (polar/retrograde) |
@ -34,8 +34,6 @@ All constants defined in `src/test_utilities.h` — use those, do not redefine l
| `REL_TOL` | `1e-8` | Relative / percentage errors (dimensionless) |
| `DRIFT_TOL` | `1e-12` | Energy drift percent (parabolic orbit) |
- Tighten aggressively: if observed error is `1e-8`, use `1e-6` (two orders of margin)
- Replace qualitative checks (`a > b`) with quantitative (`WithinAbs(expected, tol)`)
- `INFO("label: " << value)` for debugging context
@ -53,9 +51,9 @@ All constants defined in `src/test_utilities.h` — use those, do not redefine l
## Refactoring Procedure
### Step 1: Refactor
- Verify the test file has a TOML config in `old_tests/`. If it doesn't, skip the TOML rewrite step — the test is likely hardcoded.
- Verify the test file has a TOML config in `old_tests/`. If it doesn't, the test is likely hardcoded — still refactor the C++ code but skip the TOML rewrite step.
- Check if the test is already in `tests/` (already refactored). Skip if so.
- Check the capability matrix in Section 5 — if the test needs SOI, maneuvers, rendezvous, etc., flag this before starting.
- Check the capability matrix in the Tooling & Sim Engine Capabilities section — if the test needs SOI, maneuvers, rendezvous, etc., flag this before starting.
- Process **one test file at a time**.
- Create `scripts/precalc_<test_name>.py` and run it to get expected values.
- Copy from `old_tests/` to `tests/`, rewrite using the pattern from `test_true_anomaly_roundtrip.cpp`.

Loading…
Cancel
Save