mirror of
https://github.com/Permissionless-Software-Foundation/psf-memo-client.git
synced 2026-09-21 16:52:02 -07:00
Review the refactorer's test-helper extraction (test-only, no source changes). No structural fixes needed. Refresh mutation and acceptance mutation manifests from the verification runs. By architect.
4.1 KiB
4.1 KiB
Architectural Review Summary — reduce-test-dry-duplication
Task and commits reviewed
- Task:
reduce-test-dry-duplication - Reviewed the refactorer branch ending at
0159119921bc(fast-forward merged intoswarmforge-architect), which extracted shared test helpers for the Memo post and Set Name behavior slices. No source files changed; the diff is test-only (427 insertions / 522 deletions across 13 test files).
Architectural findings and fixes applied
Reviewed UI/Core separation, dependency rule, information hiding/encapsulation, and local code quality. The refactorer's work is clean; no structural fixes were needed.
- Test helpers separated from tests (good). Shared fakes and test registrars
live in
test/helpers/(fake-wallet.js,fake-profiles.js) andtest/unit/*-helpers.js/test/property/behavior-helpers.js, kept apart from the.test.jsfiles. Thenode --test "test/unit/*.test.js"andnode --test "test/property/*.test.js"globs match only.test.js, so the helper modules are never executed as standalone tests. This satisfies the "keep tests separate from test helpers" rule. - Dependency direction (good). Helpers depend inward on
src/servicesand on each other; no test helper reaches into UI/IO. The fake wallet exposes only the small adapter surface the Memo action modules need (walletInfo,getUtxos,sendOpReturn) and records broadcasts for assertion, preserving information hiding. - Cohesion (good). Each helper owns one concern:
memo-action-helpers.jsregisters the shared MemoAction max/over-length/validation tests;page-controller-helpers.jsregisters the shared in-flight/missing-handler/ broadcast-failure page tests;page-build-helpers.jswires a page to a working action;behavior-helpers.jsregisters the shared property invariants (validation, counter conservation, setInput round-trip, broadcast-failure never navigates). Slice specifics are supplied through a smallcfgobject, so the two behavior slices share one implementation instead of duplicating it. - Local code quality (good). Helper APIs are documented, names are clear, and
the
cfg-driven registrars keep the per-slice test files terse and readable..gitignorenow excludestarget/(project-local tool output).
Verification results
- Unit (
node --test): 56/56 pass. - Property (
node --test test/property/*.test.js): 13/13 pass. - Acceptance (normal):
memo-new,post-memo, andset-namegenerated suites all pass (14 + 5 + 13 scenarios). - Mutation (
mutate4javascript,--max-workers 8): differential run reports 0/0/0 (manifests current; source unchanged).--mutate-allconfirms every testable core module fully kills: memo-action 5/0/0, memo-post 2/0/0, memo-set-name 2/0/0, page-controller 7/0/0, set-name-page 3/0/0, account-page 7/0/0, profiles 1/0/0, new-post 4/0/0. No survivors, no uncovered. - DRY (
dry4javascript srcanddry4javascript test): no duplicate candidates in either tree. - Gherkin acceptance mutation (soft):
memo-new.feature— 14 executed, 4 killed, 10 survived, 0 errors.post-memo.feature— 5 executed, 0 killed, 5 survived, 0 errors.set-name.feature— 13 executed, 6 killed, 7 survived, 0 errors.- Killed: byte/char
countdithers and the empty-value boundary — values are behaviorally connected to the counter and rejection branches. - Survived (documented equivalents): message/name/broadcast-error text dithers are opaque data — any non-empty value broadcasts and reflects identically, so the mutation does not change observable behavior.
Suite status
- Unit + property + acceptance all pass; source-level mutation fully kills all testable core modules. Gherkin acceptance mutation survivors are documented equivalents.
Handoffs sent
- None. The refactorer's work is test-only (no product behavior change) and this review produced no source changes, so there is no functional commit for the specifier and no follow-up work for the coder/refactorer to review. Per the handoff rules, non-functional work is not forwarded.
By architect.