Repository navigation
docs(testing): drop the CRAP gate, keep the complexity limit - #40
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the CRAP gate from the testing practice and keeps the complexity limit. Also adds two entries that point tests at real regressions and keep the domain core free of adapters.
Why
CRAP is
complexity² × (1 − coverage)³ + complexity, so it is a coverage gate in another form: an untested function with complexity 6 or more fails, and any test that merely executes the code makes it pass. We already decided on 2026-10-06 not to gate coverage. We want tests whose failure signals a real regression, not tests that raise a coverage number.What CRAP was guarding is covered elsewhere:
Changes
practices/testing.md: removes the CRAP formula and the "CRAP gate" section. The complexity rule now says the way out of a failure is to separate pure decision logic from I/O, not to chop code into arbitrary tiny functions.practices/ci-change-selection.md: removes the per-shard coverage export note that only served the gate.practices/architecture.md: module-boundary tools now also enforce direction (the domain core imports no adapter, framework or UI module), naming the tool per stack: Boundary, ArchUnit beside Spring Modulith, Oxlintno-restricted-importsscoped to core files (dependency-cruiser rejected, to reuse the stack's linter), and separate Rust crates. Verified against official docs on 2026-10-21.practices/testing.md: mocking your own modules is rejected. Use a fake behind a port, checked by the same contract tests as the real adapter; tests coupled to internals fail on refactors, not regressions.Checks
mise run check:fullpasses: lint with zero errors, 7 tests passing, actionlint and zizmor with no findings.Projects that adopted the gate keep running it until they remove it themselves.