docs: add Go-to-.NET gap analysis and test mapping

Research documents covering implementation gaps (structuregaps.md)
and full test function mapping (testmapping.md + CSV files) between
the Go NATS server and .NET port. 857/2937 Go tests mapped (29.2%),
2080 unmatched, 2966 .NET-only tests.
This commit is contained in:
Joseph Doherty
2026-02-24 10:07:29 -05:00
parent 1743cfc550
commit 0dc2b38415
4 changed files with 6522 additions and 0 deletions

147
docs/testmapping.md Normal file
View File

@@ -0,0 +1,147 @@
# Go-to-.NET Test Mapping
## Overview
| Metric | Count |
|--------|-------|
| Go test functions | 2,937 |
| .NET test methods | 3,305 |
| .NET tests passing | 3,501 (Theory data rows expand the count) |
| Go tests with .NET equivalent | 857 (29.2%) |
| Go tests without .NET equivalent | 2,080 (70.8%) |
| .NET tests with no Go counterpart | 2,966 |
## Data Files
- **[go_test_mapping.csv](go_test_mapping.csv)** — All 2,937 Go test functions with their mapped .NET test (if any)
- Columns: `go_file`, `go_line`, `go_test`, `dotnet_test`, `dotnet_file`
- Empty `dotnet_test`/`dotnet_file` = no .NET equivalent found
- **[dotnet_unmapped_tests.csv](dotnet_unmapped_tests.csv)** — All 2,966 .NET test methods with no Go counterpart
- Columns: `dotnet_file`, `dotnet_line`, `dotnet_test`
## Matching Methodology
Matches were found using these strategies (in priority order):
1. **Reference comments** (571 matches) — .NET tests with `// Go: TestXxx` comments citing the Go function
2. **Exact normalized name** (3 matches) — CamelCase Go name matches underscore .NET name after normalization
3. **Substring containment** (21 matches) — Core Go name contained within .NET method name or vice versa (min 8 chars)
4. **Keyword overlap** (235 matches) — CamelCase/underscore word overlap with >= 60% Go coverage, >= 30% .NET coverage, min 2 shared meaningful words
5. **Domain-aware matching** (27 matches) — File-area restricted keyword matching with relaxed thresholds
## Coverage by Go Test File
| Go File | Total | Matched | Unmatched | Coverage |
|---------|-------|---------|-----------|----------|
| accounts_test.go | 64 | 30 | 34 | 47% |
| auth_callout_test.go | 31 | 1 | 30 | 3% |
| auth_test.go | 12 | 10 | 2 | 83% |
| certstore_windows_test.go | 4 | 0 | 4 | 0% |
| client_proxyproto_test.go | 23 | 0 | 23 | 0% |
| client_test.go | 82 | 39 | 43 | 48% |
| closed_conns_test.go | 7 | 1 | 6 | 14% |
| config_check_test.go | 3 | 1 | 2 | 33% |
| dirstore_test.go | 19 | 2 | 17 | 11% |
| errors_test.go | 2 | 0 | 2 | 0% |
| events_test.go | 51 | 10 | 41 | 20% |
| filestore_test.go | 232 | 73 | 159 | 31% |
| gateway_test.go | 88 | 27 | 61 | 31% |
| ipqueue_test.go | 9 | 0 | 9 | 0% |
| jetstream_batching_test.go | 29 | 0 | 29 | 0% |
| jetstream_cluster_1_test.go | 151 | 60 | 91 | 40% |
| jetstream_cluster_2_test.go | 123 | 27 | 96 | 22% |
| jetstream_cluster_3_test.go | 97 | 7 | 90 | 7% |
| jetstream_cluster_4_test.go | 85 | 4 | 81 | 5% |
| jetstream_cluster_long_test.go | 7 | 1 | 6 | 14% |
| jetstream_consumer_test.go | 160 | 26 | 134 | 16% |
| jetstream_errors_test.go | 4 | 0 | 4 | 0% |
| jetstream_jwt_test.go | 18 | 0 | 18 | 0% |
| jetstream_leafnode_test.go | 13 | 0 | 13 | 0% |
| jetstream_sourcing_scaling_test.go | 1 | 0 | 1 | 0% |
| jetstream_super_cluster_test.go | 47 | 0 | 47 | 0% |
| jetstream_test.go | 312 | 128 | 184 | 41% |
| jetstream_tpm_test.go | 5 | 0 | 5 | 0% |
| jetstream_versioning_test.go | 18 | 0 | 18 | 0% |
| jwt_test.go | 88 | 27 | 61 | 31% |
| leafnode_proxy_test.go | 9 | 0 | 9 | 0% |
| leafnode_test.go | 110 | 51 | 59 | 46% |
| log_test.go | 6 | 2 | 4 | 33% |
| memstore_test.go | 37 | 9 | 28 | 24% |
| monitor_test.go | 100 | 54 | 46 | 54% |
| mqtt_ex_test_test.go | 2 | 0 | 2 | 0% |
| mqtt_test.go | 123 | 64 | 59 | 52% |
| msgtrace_test.go | 33 | 2 | 31 | 6% |
| nkey_test.go | 5 | 4 | 1 | 80% |
| norace_1_test.go | 100 | 14 | 86 | 14% |
| norace_2_test.go | 41 | 0 | 41 | 0% |
| opts_test.go | 86 | 23 | 63 | 27% |
| parser_test.go | 17 | 12 | 5 | 71% |
| ping_test.go | 1 | 0 | 1 | 0% |
| raft_test.go | 104 | 19 | 85 | 18% |
| rate_counter_test.go | 1 | 0 | 1 | 0% |
| reload_test.go | 73 | 31 | 42 | 42% |
| ring_test.go | 2 | 0 | 2 | 0% |
| routes_test.go | 70 | 31 | 39 | 44% |
| server_test.go | 42 | 14 | 28 | 33% |
| service_test.go | 1 | 0 | 1 | 0% |
| service_windows_test.go | 1 | 0 | 1 | 0% |
| signal_test.go | 19 | 2 | 17 | 11% |
| split_test.go | 12 | 0 | 12 | 0% |
| store_test.go | 17 | 1 | 16 | 6% |
| subject_transform_test.go | 4 | 1 | 3 | 25% |
| sublist_test.go | 65 | 40 | 25 | 62% |
| trust_test.go | 3 | 0 | 3 | 0% |
| util_test.go | 7 | 1 | 6 | 14% |
| websocket_test.go | 61 | 8 | 53 | 13% |
| **TOTAL** | **2,937** | **857** | **2,080** | **29.2%** |
## Top Gap Areas (by unmatched count)
| Go File | Unmatched | Notes |
|---------|-----------|-------|
| jetstream_test.go | 184 | Core JetStream API: TTL, encryption, snapshots, mirrors, KV |
| filestore_test.go | 159 | Block management, compaction, tombstones, recovery |
| jetstream_consumer_test.go | 134 | Pull/push delivery, ack policies, filter subjects, backoff |
| jetstream_cluster_2_test.go | 96 | Domains, leaf nodes, mirrors, desyncs, rollups |
| jetstream_cluster_1_test.go | 91 | Meta recovery, health checks, scheduling, peer mgmt |
| jetstream_cluster_3_test.go | 90 | Account limits, encryption, orphan recovery, scaling |
| norace_1_test.go | 86 | Stress/race: cluster operations, consumer storms |
| raft_test.go | 85 | NRG observer mode, catchup, snapshots, term tracking |
| jetstream_cluster_4_test.go | 81 | Consumer pause/resume, NRG, subject delete markers |
| opts_test.go | 63 | Config parsing edge cases, TLS, cluster config |
| gateway_test.go | 61 | Interest-only mode, auth, TLS, service imports |
| jwt_test.go | 61 | Claims parsing, validation, account resolver |
| leafnode_test.go | 59 | Hub-spoke, loop detection, TLS, compression |
| mqtt_test.go | 59 | Session persistence, QoS, retained messages, will |
| websocket_test.go | 53 | Compression, auth, TLS, frame handling |
## Zero-Coverage Files (no .NET equivalent at all)
| Go File | Tests | Category |
|---------|-------|----------|
| jetstream_super_cluster_test.go | 47 | Multi-cluster topology |
| norace_2_test.go | 41 | JetStream cluster stress |
| jetstream_batching_test.go | 29 | Request batching |
| client_proxyproto_test.go | 23 | PROXY protocol v1/v2 |
| jetstream_jwt_test.go | 18 | JetStream + JWT integration |
| jetstream_versioning_test.go | 18 | Stream/consumer versioning |
| store_test.go | 16 | Generic store interface contract |
| signal_test.go | 17 | OS signal handling |
| split_test.go | 12 | Protocol buffer splitting |
| leafnode_proxy_test.go | 9 | Leaf node proxy connections |
| ipqueue_test.go | 9 | Internal priority queue |
| jetstream_leafnode_test.go | 13 | JetStream over leaf nodes |
| certstore_windows_test.go | 4 | Windows certificate store |
| jetstream_errors_test.go | 4 | JetStream error codes |
| jetstream_tpm_test.go | 5 | Trusted Platform Module |
## Notes on the .NET Unmapped Tests
The 2,966 unmapped .NET tests fall into several categories:
1. **Parity/behavioral tests** — Tests written to verify specific .NET behaviors that don't map 1:1 to a single Go test (e.g., `ClientProtocolParityTests`, `JetStreamClusterGovernanceParityTests`)
2. **Infrastructure tests** — Tests for .NET-specific infrastructure like `JetStreamApiFixture`, `JetStreamClusterFixture`
3. **Extended coverage** — Additional edge case tests beyond what Go covers (e.g., `FileStorePermutationTests` with 6-way cipher/compression matrix)
4. **Unit tests against stubs** — Tests that exercise .NET stubs/simulations rather than real distributed behavior
See [dotnet_unmapped_tests.csv](dotnet_unmapped_tests.csv) for the full list.