You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: redistribute edge-case tests, reach 100% line coverage, drop report Floor column
- Delete the catch-all EdgeCaseCoverageTests and move every test next to the
type it exercises, matching the repo's mirror-the-source layout: indexer
misses and Clear()-on-empty into each *Tests.cs; the non-generic
IEnumerable/IEnumerator + Reset paths into each *EnumerationTests.cs; the
wrap-around backward-shift case into CelerityMultiMapCollisionTests.
- Remove the dead table-sizing guard in FrozenCelerityDictionary
(`if (size <= n) size <<= 1;`). NextPowerOfTwo(n + 1) already returns a power
of two strictly greater than n for every constructible size (it caps at 2^30),
so the guard was unreachable — and `size <<= 1` would overflow to a negative
size if it ever ran. Dropping it takes the library to 100% line coverage.
- Drop the "Floor" column from the coverage report's PR summary table.
Full suite: 1881 tests pass; library coverage 100% line / ~99% branch.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: ROADMAP.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ The next release rounds out the `Celerity.Collections` package with missing coll
61
61
- Comprehensive benchmark suite: uniform, clustered, and adversarial key distributions. Status: `done` — `DistributionBenchmark` sweeps uniform/sequential/clustered shapes and `AdversarialHasherBenchmark` shows the naive hasher degrading to O(n) while Murmur3 recovers. Tracked in [#60](https://github.com/marius-bughiu/Celerity/issues/60).
62
62
- Benchmark suite expansion: realistic workloads, memory-allocation, concurrent-access, cache-locality, large-dataset (millions), and `FrozenDictionary<,>` comparison benchmarks. Status: `done` — added as an extended, on-demand suite kept out of the per-PR CI regression run; see [`docs/performance.md`](docs/performance.md#extended-benchmark-suite). Tracked in [#26](https://github.com/marius-bughiu/Celerity/issues/26).
- Improve code coverage. Status: `done` — coverage reporting is gated in CI (`coverage.yml`, ~99.9% line coverage on the library, published to the [coverage dashboard](https://marius-bughiu.github.io/Celerity/coverage/)), edge-case tests close the non-generic enumerator / throw / backward-shift corners, property-based parity tests (CsCheck) and a seedable differential fuzzer (`Celerity.Fuzz`, nightly soak) check every collection against its BCL oracle, and the approach is written up in [`docs/testing.md`](docs/testing.md). Tracked in [#29](https://github.com/marius-bughiu/Celerity/issues/29).
64
+
- Improve code coverage. Status: `done` — coverage reporting is gated in CI (`coverage.yml`, 100% line coverage on the library, rendered by an in-repo generator and published to the [coverage dashboard](https://marius-bughiu.github.io/Celerity/coverage/)), edge-case tests close the non-generic enumerator / throw / backward-shift corners, property-based parity tests (CsCheck) and a seedable differential fuzzer (`Celerity.Fuzz`, nightly soak) check every collection against its BCL oracle, and the approach is written up in [`docs/testing.md`](docs/testing.md). Tracked in [#29](https://github.com/marius-bughiu/Celerity/issues/29).
65
65
- Improve documentation. Status: `done` — added a performance tuning guide, a BCL migration guide, a troubleshooting guide, and a FAQ, alongside the existing README usage examples, "choosing a collection" table, and API reference. Tracked in [#15](https://github.com/marius-bughiu/Celerity/issues/15).
66
66
- Bump XML doc coverage; treat missing docs as warning-as-error. Status: `done` — `Celerity.csproj` promotes CS1591 to error.
Copy file name to clipboardExpand all lines: docs/testing.md
+4-8Lines changed: 4 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Celerity's first guiding principle is *correctness first* — "a fast collection
7
7
| Layer | Project / file | What it proves | Run locally |
8
8
|---|---|---|---|
9
9
| Behavioural unit tests |`Celerity.Tests`| Each public method does the right thing on hand-picked inputs, including collisions, resizes, and the out-of-band default/zero/null key. |`dotnet test`|
10
-
| Edge-case coverage tests |`Celerity.Tests/Collections/EdgeCaseCoverageTests.cs`| The corners example tests skip: non-generic `IEnumerable`/`IEnumerator` paths, `Reset()`, indexer misses, `Clear()` on empty, wrap-around backward-shift. |`dotnet test`|
10
+
| Edge-case coverage | alongside each type's tests (`*Tests.cs`, `*EnumerationTests.cs`, `*CollisionTests.cs`)| The corners example tests skip: non-generic `IEnumerable`/`IEnumerator` paths, `Reset()`, indexer misses, `Clear()` on empty, wrap-around backward-shift. |`dotnet test`|
11
11
| Property-based tests |`Celerity.Tests/Properties/`| Across thousands of randomized operation sequences, every collection stays observably equal to its BCL oracle. |`dotnet test`|
12
12
| Differential fuzzer |`Celerity.Fuzz`| A long random walk finds no divergence from the BCL; failures replay deterministically from a seed. |`dotnet run -c Release`|
13
13
| Native AOT smoke test |`Celerity.AotSmokeTest`| Every collection/hasher works in a trimmed, AOT-compiled native binary. | see [aot.md](aot.md)|
@@ -30,9 +30,9 @@ Both compare against a BCL oracle (`Dictionary<,>`, `HashSet<>`, or a `Dictionar
30
30
The bulk of the suite lives in `Celerity.Tests`, mirroring the library's folder layout. Test names follow `Method_ShouldExpectedBehavior_WhenCondition`. Notable categories:
31
31
32
32
-**Collision tests** (`*CollisionTests.cs`) — force every key down one probe chain with a constant hasher, then verify lookups, removals, and backward-shift deletion keep every entry findable.
33
-
-**Enumeration tests** (`*EnumerationTests.cs`) — the struct enumerators, `Keys`/`Values` views, and mid-enumeration mutation detection.
33
+
-**Enumeration tests** (`*EnumerationTests.cs`) — the struct enumerators, `Keys`/`Values` views, mid-enumeration mutation detection, and the non-generic interface surface (`IEnumerable.GetEnumerator()`, `object IEnumerator.Current`, `IEnumerator.Reset()`).
34
34
-**Load-factor / constructor validation** — boundary resizes and argument checking.
35
-
-**Edge-case coverage**(`EdgeCaseCoverageTests.cs`) — the non-generic interface surface (`IEnumerable.GetEnumerator()`, `object IEnumerator.Current`, `IEnumerator.Reset()`), indexer misses on the out-of-band key, `Clear()` on an empty collection, and a hand-built wrap-around cluster that exercises the `bypassesGap` branch of backward-shift deletion.
35
+
-**Edge cases**live next to the type they exercise rather than in a catch-all file: indexer misses on the out-of-band key and `Clear()` on an empty collection sit in `*Tests.cs`; the wrap-around cluster that exercises the `bypassesGap` branch of backward-shift deletion sits in `*CollisionTests.cs`.
36
36
37
37
Run them with:
38
38
@@ -134,14 +134,10 @@ The report is rendered by [`scripts/coverage_report.py`](../scripts/coverage_rep
134
134
The `coverage` workflow (`.github/workflows/coverage.yml`) runs on every PR and on `main`:
135
135
136
136
- Collects coverage, renders the report + badge with `scripts/coverage_report.py`, and uploads it as a build artifact.
137
-
-**Fails the build** if line coverage drops below `MIN_LINE_COVERAGE` (95%) or branch coverage below `MIN_BRANCH_COVERAGE` (90%). The suite sits far above these (~99.9% line) — the floor guards against silent regressions; it is not the target.
137
+
-**Fails the build** if line coverage drops below `MIN_LINE_COVERAGE` (95%) or branch coverage below `MIN_BRANCH_COVERAGE` (90%). The suite sits far above these (100% line, ~99% branch) — the floor guards against silent regressions; it is not the target.
138
138
- Posts a coverage summary comment on the PR.
139
139
- On `main`, publishes the HTML report to `gh-pages` under [`/coverage`](https://marius-bughiu.github.io/Celerity/coverage/) and refreshes the README badge.
140
140
141
-
### What is deliberately not covered
142
-
143
-
A single line — the integer-overflow guard in `FrozenCelerityDictionary`'s table sizing (`if (size <= n) size <<= 1;`) — is unreachable without ~2³⁰ keys, so it is left uncovered by design rather than tested with an impractically large input. It is defensive code, kept for safety.
0 commit comments