accuracy(Dart): measure import graph accuracy and close gaps below 90%
Part of #237.
Starting estimate: 75-90% recall. This is an unmeasured guess.
Measure
Run codemap on real Dart repositories at pinned commits and compare it to ground truth.
- Suggested ground truth: dart analyze or package_config resolution.
- Report: recall, precision, and whether the coverage status was honest for each file.
Likely gaps to check
package: imports, part files, exports.
Done when
- Repositories, commits, method and numbers are recorded here.
- Each miss has a root cause.
- Recall is at or above 90%, or the remaining gap is one codemap cannot close and its coverage status says so.
Dart import graph accuracy (#248)
Repos: dart-lang/shelf @ 62d3e4ee2503c3c497f749276e86b2331c18fd6a (104 .dart, pub workspace of pkgs/*), dart-lang/http @ 8c0d66acd2385761182d34b48c4c80ca6cfa4513 (340 .dart)
Method: git clone --depth 1, static reading only (no scripts, builds or tests executed). Sample: 30 files per repo via shuf -n 30 with a fixed seed (a sample, not the whole repo). For each sampled file F, codemap --json --importers F (codemap 4.6.3) was compared to a ground-truth importer set. Because 9 s per call ruled out querying every file, the unit is incoming edges to the sampled file. Truth was built by a regex resolver I wrote (tools/truth.py in the local scratch dir) and the disagreements were reviewed by hand. Intra-project edges only. Recall = TP/(TP+FN), precision = TP/(TP+FP) over edges. Honesty = whether coverage_status for a sampled file with a miss was something other than complete. Auto-written .codemap/config.json only lists were checked and include the target language. Dart truth = import/export/part/part of, conditional if (dart.library...) URIs, relative and package: URIs resolved through every in-repo pubspec name.
| repo | sampled | TP | FP | FN | recall | precision | files with a miss | miss under complete |
|---|---|---|---|---|---|---|---|---|
| shelf | 30 | 45 | 0 | 0 | 1.00 | 1.00 | 0 | 0 |
| http | 30 | 29 | 0 | 0 | 1.00 | 1.00 | 0 | 0 |
Honesty: coverage_status was complete for all sampled files and no miss was found, so the label held in this sample. Small sample (74 edges); a miss in a rarer construct (e.g. augment imports, generated part files) would not show here. No root causes to report; no fix needed from this data.
Measured with codemap 4.6.3. Sampled numbers are samples, not a census.