R86 Write no test for input that is plainly unreasonable

Off by default

Superseded by R252 Test only the happy path and the boundaries the requirements set.

Write no test of what code does with input that is plainly unreasonable.

Reason

Input that no caller gives and no requirement names is not part of what the code is for; a test of it fixes behavior nobody needs and is one more test to run and keep up (Art. III §4).

Verification

Input is plainly unreasonable when no caller of the code gives it or could be expected to, and no requirement, specification or record of a bug names it: a negative count of files, a path that is a number, a type the signature excludes. A boundary the requirements set, such as an empty list the code must accept, a limit it must enforce or input from outside that it must reject, is not unreasonable, and a test of it complies.

Violated when a change adds a test that asserts what code does with plainly unreasonable input.

Provisions of the constitution it cites

Relations

Parent
R83 Code
Requires
none
Conflicts with
none

Metadata

ID
86
Revision
3
Kind
rule
Status
superseded
Slug
no-tests-for-unreasonable-input
Default level
project
Constitution revisions
>=1
Check
none
Default
off
Uses
Instructions instructions, Review review
Original language
English en
Translations
Chinese zh