This repository was archived by the owner on Jun 18, 2026. It is now read-only.
Commit 391b54e
zalenix-gardener
Add GraphCompressorTest: 29 tests covering all 5 compression strategies
GraphCompressor.java had no JUnit coverage (one of the larger untested
classes in the gvisual package - 482 lines, 5 distinct strategies,
nontrivial Jaccard pruning, plus a full CompressionResult value type).
New GraphCompressorTest.java (29 @test methods) exercises:
* Argument validation: null graph, null attribute fn, null/empty
seeds, threshold out of [0,1], binSize < 1, k < 1
* Empty + singleton graphs (degenerate edge case for divisions)
* Structural equivalence on K_{2,3} (asserts exact node/edge counts,
grouping, ratio 0.4, edge-reduction 83.3%, aggregated weight = 6)
* Structurally distinct nodes (path graph) ⇒ no merges
* Neighborhood similarity at thresholds 0.0, 0.5, 1.0
* Exact degree binning (star graph) + binSize=2 coarsening
* Attribute compression: label-based grouping, null bucketing via
__unassigned__, intra-group edge dropping in the quotient
* k-hop locality: seed neighborhood capture, already-claimed
skipping with two seeds, unknown-seed handling
* compressibilityReport contains every strategy line
* Result accessors: getSummary, toCSV (sorted nodes), getMembersOf,
getSupernodeOf, unmodifiable maps
* Superedge weight aggregation (sum of crossing originals)
All 29 tests green: 'mvn -Dtest=GraphCompressorTest test' → Tests run:
29, Failures: 0, Errors: 0, Skipped: 0.1 parent daa9f01 commit 391b54e
1 file changed
Lines changed: 450 additions & 0 deletions
0 commit comments