Skip to content

Aptentia Academy · Free lesson 2 of 4

Test the inputs that do not fit

Check blank fields, limits, uncertain matches, and repeated actions with clear expected behavior.

Check the Software You Build

Make an input test list with a result and review path for each case.

Jump to a section in this lesson

Write the rule before choosing test values

A value can look valid and still be wrong for the task. A date may use the right format but fall outside the allowed booking period. A record number may be present but refer to a different quote. Write both the format rule and the business rule.

OWASP's input-validation guidance distinguishes those kinds of checks and calls for validation on the server. Browser checks can help people correct a form, but the receiving system must also enforce its rules.

  • Required: is the value present, including after spaces are trimmed?
  • Type and range: is it a permitted value within the stated limits?
  • Meaning: does it refer to the right record and allowed state?
  • Exception path: what should happen when the answer is unknown?

Try values at the edge and values that are absent

For a fictional job count that allows whole numbers from 1 through 100, test 1 and 100, then 0, 101, a fraction, blank input, and text. A value of zero is not the same as a missing value. Decide which cases are allowed rather than silently changing bad input into a plausible number.

Also test a field containing only spaces. For records with leading zeros, decide whether the identifier is text before normalizing it. Removing zeros can change which record it means. A matching rule needs an agreed purpose, not just a convenient conversion.

Treat a match as a rule result, not proof of identity

Two rows can share a name and still describe different jobs. Choose fields that identify the thing you are trying to match. Test missing keys, duplicate keys, and conflicting details. If there is more than one possible match, define a review path instead of silently choosing the first row.

Test the same create request twice as a separate case. A repeated action may need to return the first result instead of making a second work order. The right behavior depends on the task, so state it in the test plan and check the stored result.

Worked example

A small input test set

For this fictional app, an approved quote needs a job address before scheduling. A draft may wait for that detail, but it must be clearly marked for review.

Blank or spaces-only address
Expected: the draft shows Address needed, is not schedulable, and has a named reviewer. A string of spaces must not pass as a usable address.
Two possible quote matches
Expected: no quote is linked automatically. The app presents the conflict for review. A shared customer name alone is not enough to choose a quote.
Zero and missing job count
Expected: both are rejected for the stated 1-to-100 rule, with a clear field error. The app must not turn a missing count into an accepted default without an explicit rule.
The same create request twice
Expected under this app's contract: one draft is created and both attempts identify that draft. Inspect saved records, not only the message shown after the second attempt.

Choose expected behavior before each run. A blocked record with a useful review path can be the correct result.

Fictional teaching example. No customer data or measured business results.

Your exercise

Build a useful set of awkward cases

Start with the checks from lesson 1 and keep all example data fictional.

  1. Choose one required field and one field with a limit. Write their rules in plain English.
  2. List a normal value, a blank, spaces only, an invalid type, and values just inside and outside the limit.
  3. Add a duplicate, an uncertain match, and a record with a conflicting detail. State the review path for each.
  4. Try the record matching lab. Note one case where a rule result still needs a person to check it. Do not treat the lab as a test of your own app.

You have a useful first draft when...

Each test value has a stated expected result, and uncertain records have an owner and next action.

Check your understanding

Try the practice quiz.

Choose one answer for each question, then check the feedback. Answers stay in this page's memory. They are not submitted or saved.

1.A field allows whole numbers from 1 through 100. Which set checks the edges well?
2.Two quotes share the same customer name. What should the matching test check?

0 of 2 answered

Sources and further reading

The examples and exercises are original. These primary sources support the technical methods used in this lesson.

  • OWASP: input validation

    Primary guidance on checking input formats, allowed values, and business rules on the server.

Use what you learned

Take the next step with a tool or guide.

Record matching lab

Explore matching rules with fictional records and review uncertain results.

Software verification checklist

Turn a promised result into checks you can run and record.