Remembering Boundary Conditions with CORRECT
The CORRECT acronym gives you a way to remember potential boundary conditions. For each of these items, consider whether or not similar conditions can exist in the method that you want to test, and what might happen if these conditions are violated:
-
Conformance—Does the value conform to an expected format?
-
Ordering—Is the set of values ordered or unordered as appropriate?
-
Range—Is the value within reasonable minimum and maximum values?
-
Reference—Does the code reference anything external that isn’t under direct control of the code itself?
-
Existence—Does the value exist (is it non-null, nonzero, present in a set, and so on)?
-
Cardinality—Are there exactly enough values?
-
Time (absolute and relative)—Is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access