Testing fundamentals · Concept
Boundary values and equivalence classes
Practise this out loud
Say your answer out loud to an AI interviewer that follows up, and get a score for it.
Practise by voiceThe interviewer asks
A loan form has an amount field that accepts ₹10,000 to ₹5,00,000, in multiples of ₹1,000. Using equivalence classes and boundary values, which values would you test, and why those?
Then
Follow-ups the interviewer asks next
- What is an equivalence class, in one line?
- Why do bugs gather at boundaries?
- Two-value or three-value boundary analysis: what's the difference?
- How does "multiples of 1,000" change your list?
- What about blank, letters, decimals, negative numbers, commas or a 20-digit number?
- The API checks the amount too. Do you test the same values there?
- How would you write these as one data-driven test?
The answer
What a strong answer covers
- Classes: below the range (invalid), in range and a multiple of 1,000 (valid), in range but not a multiple (invalid), above the range (invalid), not a number (invalid). One value per class is enough in principle.
- Boundaries (two-value): 9,999 and 10,000; 5,00,000 and 5,00,001. Three-value adds 10,001 and 4,99,999. With the step rule, the useful values become 9,000 / 10,000 / 11,000 and 4,99,000 / 5,00,000 / 5,01,000, plus 10,500 (in range, wrong step).
- Input format: blank, 0, negative, decimals (10000.50), leading zeros, spaces, Indian and international commas (1,00,000 and 100,000), letters, very long numbers (overflow), pasted text.
- Bugs sit at boundaries because developers write
<instead of<=, or mix rupees and paise. - The page's check is only a convenience; the API must enforce the same rules, so the same table runs against the API.
- Data-driven: a TestNG
@DataProvideror a JUnit@ParameterizedTestwith@CsvSource(value, expected result).
The red pen
Common traps
Avoid:20 random valid values; only the two edge values and no step rule; skipping the API; thinking boundaries are only for numbers (dates, lengths and list sizes have them too).
Practise this out loud
Say your answer out loud to an AI interviewer that follows up, and get a score for it.
Practise by voicePractise questions like this out loud
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.