Repository navigation
core module has almost no test coverage #2
Description
Context
The fork's testing effort — substantial, and carefully documented in TESTING.md — targets
driver and web-ui. The core module was left out:
| Module | Production | Tests |
|---|---|---|
core |
4,384 L / 38 files | 71 L / 1 file |
driver |
3,753 L / 24 f | 6,042 L / 21 f |
web-ui |
3,179 L / 15 f | 2,148 L / 8 f |
metadata |
390 L / 3 f | 247 L / 2 f |
agent |
261 L / 3 f | 0 |
core's only test is BytesUtilsCharacterizationTest, a characterization of the endianness
helpers.
It is the least covered module, and it is the one that produces the bytes written to the card.
It holds the readers and writers for all three pack formats (binary, archive, fs), plus
XXTEACipher, PackAssetsCompression, VorbisEncoder, AudioConversion and
ImageConversion. The hardening work done on driver establishes that the index and its
installation are correct — but nothing currently establishes that the content written into
.content/ faithfully represents the source pack.
The risk is not hypothetical, since driver builds on these classes: silent corruption
introduced during conversion would pass every existing specification.
Description
Establish coverage for core, starting with the property that matters most and costs least to
write: the round trip. A pack synthesised in code, written and then read back, must yield
an equivalent model — for each format, and for each cross-format path the library offers.
Follow the distinction TESTING.md already sets out: characterize what the code does today,
including where it is wrong, then convert to specifications as defects are fixed.
Affected files
core/src/test/java/studio/core/v1/— most of the work, to be createdcore/src/main/java/studio/core/v1/reader/{binary,archive,fs}/— under testcore/src/main/java/studio/core/v1/writer/{binary,archive,fs}/— under testcore/src/main/java/studio/core/v1/utils/XXTEACipher.java— test vectorscore/src/main/java/studio/core/v1/utils/PackAssetsCompression.java— under test- possibly a shared
PackFixtures, along the lines ofDriverTestSupport
Implementation plan
- A fixture builder: a parameterisable synthetic
StoryPack(node count, assets present or
absent, enriched metadata or not). No device data committed, asdriveralready does. - Per-format round trip:
write→read→ structural comparison of the model. - Cross-format round trip:
binary→archive→binary, and the other paths exposed by
LibraryService. This is what a user actually exercises. XXTEACipher: known vectors, plus thedecipher(cipher(x)) == xproperty.PackAssetsCompression: compress then decompress, andhasCompressedAssetson a mixed
pack.- Failure paths: truncated file, invalid magic number, asset referenced but missing.
Characterize what happens today — several of these likely produce an unhelpful exception,
or a partial pack. - Extend the "Coverage map" table in
TESTING.md.
Acceptance criteria
- Round trip covered for all three formats
- Cross-format conversions covered in both directions
-
XXTEACiphercovered by vectors and by its involution property - Failure paths characterized, with
KNOWN GAPmarked as such - No device data or third-party content committed
-
TESTING.mdupdated (coverage map and counts) -
mvn -Dskip.installnodeyarn=true -Dskip.yarn=true testgreen on Linux and Windows
Complexity
L — the work splits cleanly per format and can land across several PRs.
Activity
lgnap commentedon Sep 11, 2026
FS round trip: antoinevalentinHA#65 (
FsPackRoundTripTest, 10 cases, three KNOWN GAPs, on-disk layout pinned against FORMATS.md). Remaining: cross-format conversions, PackAssetsCompression, failure paths.