# Test behaviour at the boundary

## The principle

For a numeric boundary, try the value just below, exactly at and just above it. Include the inputs a user can actually supply. When the rule changes an input before testing it, run the cases against the changed value. Give each test a named expected result.

## Work through an example

A ticket rule accepts cleaned titles of at least 10 characters. ‘Printer 1’ has nine and fails. ‘Printer 01’ has ten and passes. ‘Printer 001’ has eleven and passes. Extra outside spaces should not rescue the nine-character title. A missing title should get a clear error.

## Practise before reading the feedback

A new rule requires a cleaned title of 12 or more characters. Inspect ‘Repair pump’, ‘Repair pump1’, ‘  Repair pump  ’ and a missing value. Write expected outcomes and add one case above the boundary.

## Worked feedback

‘Repair pump’ has 11 characters with the internal space and fails. ‘Repair pump1’ has 12 and passes. Outside spaces are trimmed, so the third input still has 11 and fails. A missing value should show the required-field error. ‘Repair pump12’ has 13 and should pass.
