Partitions group inputs expected to behave similarly. Choose representatives and verify that the grouping matches actual rules.
Before you start
You should understand inputs, expected outputs and the boundaries of the component under test. State the risk a test should detect before choosing a tool or mock. Distinguish controlled dependencies from real integrations so the result does not imply more coverage than the test actually provides.
The practical goal is to reason through this situation: A parser may distinguish valid numeric strings, missing input and malformed input. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.
Step-by-step walkthrough
Step 1: List behavioral categories
Missing, malformed and accepted inputs can take distinct paths.
Step 2: Choose justified representatives
Values belong together only if relevant rules treat them alike.
Step 3: Add boundaries separately
Length and normalization transitions can split a proposed category.
Worked scenario
A parser may distinguish valid numeric strings, missing input and malformed input.
A numeric parser treats absent input, empty text, whitespace, ordinary digits and out-of-range numbers differently under some policies. Calling them all ‘invalid’ hides normalization paths that may behave inconsistently. Define expected outcomes first, then choose representative and boundary cases for each meaningful class.
Common mistake
One representative cannot justify a partition whose values follow different normalization paths.
Verify the behavior
Review whether every category is genuinely uniform under the parser’s rules.
Interview exercise
Partition email input behavior.
Answer and reasoning
Separate absent, syntactically invalid and accepted forms, including relevant length and normalization boundaries.
Continue learning
Compare the scenario with the Software Testing interview questions and test your understanding with the Software Testing MCQs. For terminology and implementation details, consult the reference material.