Skip to content

Commit 4643547

Browse files
committed
docs: align with documentation standards (metrics in CHANGELOG)
README: - Update SPARK Results field to reference CHANGELOG - Update SPARK Proof Coverage section to reference CHANGELOG STG: - Use [N] placeholders in expected output - Remove specific test counts from Section 11.1 - Replace Section 11.3 v3.0.0 Test Additions with CHANGELOG reference - Add test_scoped.adb to test file table SRS: - Project Statistics section previously removed Per documentation agent Metrics vs Requirements rule: - README contains high-level status - CHANGELOG contains per-release metrics (single source of truth)
1 parent daa7ed9 commit 4643547

File tree

4 files changed

+33
-55
lines changed

4 files changed

+33
-55
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ Val := Int_Result.Unwrap_Or (R, Default_Value);
8383
### Technical Details
8484
- All 269 unit tests passing
8585
- SPARK proved (Option, Result, Either, Version)
86+
- **SPARK proof coverage**: 402 checks, 401 proved (99.7%), 270 subprograms analyzed
87+
- Comprehensive instantiation tests (`test/spark/`) exercise all generic operations
88+
- All helper functions proven overflow-safe
8689
- Scoped uses SPARK_Mode => Off (requires Ada.Finalization)
8790
- Zero heap allocation maintained
8891

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ Designed for safety-critical, embedded, and high-assurance applications with ful
2424
</tr>
2525
<tr>
2626
<td><strong>Scope</strong></td>
27-
<td>All packages (Option, Result, Either, Version)</td>
27+
<td>All packages (Option, Result, Either, Version) + comprehensive instantiation tests</td>
2828
</tr>
2929
<tr>
3030
<td><strong>Mode</strong></td>
3131
<td>gnatprove --mode=prove --level=2 (full proof)</td>
3232
</tr>
3333
<tr>
3434
<td><strong>Results</strong></td>
35-
<td>76 checks: 40 flow, 36 proved, 0 unproved</td>
35+
<td>See <a href="CHANGELOG.md">CHANGELOG</a> for current proof statistics</td>
3636
</tr>
3737
</table>
3838

@@ -63,6 +63,14 @@ make spark-prove # Run full SPARK proof verification
6363

6464
The `Try` and `Scoped` modules use `SPARK_Mode => Off` because they interact with exception handling and finalization respectively.
6565

66+
### SPARK Proof Coverage
67+
68+
Since SPARK only analyzes instantiated generics (not generic templates), the library includes a comprehensive SPARK test suite (`test/spark/`) that instantiates all generic operations, providing:
69+
70+
- **Full operation coverage**: All Map, And_Then, Filter, Zip, Flatten, Fold operations instantiated
71+
- **Helper function verification**: All predicates and transformers formally proven overflow-safe
72+
- **High proof rate**: See [CHANGELOG](CHANGELOG.md) for current statistics
73+
6674
## Features
6775

6876
### Core Types (85+ operations)

docs/formal/software_requirements_specification.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,7 @@ None - pure library with no hardware dependencies.
370370
| Functional.Try | 5 functions |
371371
| **Total** | **87 operations** |
372372

373-
### 7.2 Project Statistics
374-
375-
- Source Files: 13
376-
- Test Files: 6
377-
- Total Tests: 227
378-
- Code Coverage: 95% (stmt+decision)
379-
- SPARK Packages: 3 (Option, Result, Either)
380-
381-
### 7.3 v3.0.0 Breaking Changes Summary
373+
### 7.2 v3.0.0 Breaking Changes Summary
382374

383375
| Change | Old (2.x) | New (3.0.0) |
384376
|--------|-----------|-------------|

docs/formal/software_test_guide.md

Lines changed: 19 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,20 @@ Functional Library - Unit Test Suite
129129
========================================
130130
GRAND TOTAL - ALL UNIT TESTS
131131
========================================
132-
Total tests: 227
133-
Passed: 227
132+
Total tests: [N]
133+
Passed: [N]
134134
Failed: 0
135135
136136
########################################
137137
###
138138
### UNIT TESTS: SUCCESS
139-
### All 227 tests passed!
139+
### All [N] tests passed!
140140
###
141141
########################################
142142
```
143143

144+
*Note: [N] represents current test counts. See CHANGELOG for actual values.*
145+
144146
## 5. Writing Tests
145147

146148
### 5.1 Test File Structure
@@ -457,16 +459,18 @@ Each test file header should include:
457459

458460
## 11. Test Statistics
459461

460-
### 11.1 Current Test Counts
462+
### 11.1 Test Counts
463+
464+
See [CHANGELOG](../../CHANGELOG.md) for current test counts per release.
461465

462-
| Test File | Tests | Target Package |
463-
|-----------|-------|----------------|
464-
| test_result.adb | 84 | Functional.Result (36 operations) |
465-
| test_option.adb | 65 | Functional.Option (26 operations) |
466-
| test_either.adb | 58 | Functional.Either (20 operations) |
467-
| test_try.adb | 14 | Functional.Try (5 functions) |
468-
| test_try_option.adb | 6 | Try Option bridges |
469-
| **Total** | **227** | **87 operations** |
466+
| Test File | Target Package |
467+
|-----------|----------------|
468+
| test_result.adb | Functional.Result |
469+
| test_option.adb | Functional.Option |
470+
| test_either.adb | Functional.Either |
471+
| test_try.adb | Functional.Try |
472+
| test_try_option.adb | Try Option bridges |
473+
| test_scoped.adb | Functional.Scoped |
470474

471475
### 11.2 Test Commands Reference
472476

@@ -478,35 +482,6 @@ Each test file header should include:
478482
| `make clean-test` | Clean test artifacts |
479483
| `./test/bin/unit_runner` | Run tests directly |
480484

481-
### 11.3 v3.0.0 Test Additions
482-
483-
The following operations were added in v3.0.0 and have full test coverage:
484-
485-
**Result tests added:**
486-
- `Contains` / `"="` operator
487-
- `Is_Ok_And`, `Is_Error_And` (strict predicates)
488-
- `Is_Ok_Or`, `Is_Error_Or` (lenient predicates)
489-
- `Expect_Error`, `Unwrap_Error`
490-
- `Map_Or`, `Map_Or_Else`
491-
- `Tap_Ok`, `Tap_Error`
492-
- `Zip_With`, `Flatten`, `To_Option`
493-
494-
**Option tests added:**
495-
- `Contains` / `"="` operator
496-
- `Is_Some_And` (strict predicate)
497-
- `Is_None_Or` (lenient predicate)
498-
- `Expect`
499-
- `Map_Or`, `Map_Or_Else`
500-
- `Tap`
501-
- `"and"`, `"xor"` operators
502-
- `Zip_With`, `Flatten`
503-
- `Ok_Or`, `Ok_Or_Else`
504-
505-
**Either tests added:**
506-
- `Contains` / `"="` operator
507-
- `Is_Left_And`, `Is_Right_And` (strict predicates)
508-
- `Is_Left_Or`, `Is_Right_Or` (lenient predicates)
509-
- `Get_Or_Else`
510-
- `Map`, `Swap`, `And_Then`
511-
- `Merge`
512-
- `To_Option`, `To_Result`
485+
### 11.3 Version-Specific Changes
486+
487+
See [CHANGELOG](../../CHANGELOG.md) for test additions and changes per release.

0 commit comments

Comments
 (0)