Free practice · ordering · medium

Practice

Review a defensive input boundary

Order the checks for approving an input boundary.

Trusted input boundary

Business logic receives only validated, typed values

  1. PresenceRequired value supplied
  2. FormatAllowed external form
  3. ConvertFocused typed conversion
  4. RangeAllowed business limits
  5. UsePass checked value to logic
  6. ReportReturn useful safe failures

Presence, type, format, conversion, and range checks belong at a narrow boundary with useful failures and no hidden fallback.

Arrange in the correct order
  1. 1. Pass only validated typed values into business logic
  2. 2. Test normal, exact-boundary, missing, and malformed inputs
  3. 3. Convert only inside the focused input boundary
  4. 4. Define a useful rejection for each invalid dimension
  5. 5. Document required presence, type, format, and range