Sample questions
Question 1Easy
An exam score field accepts integers 0 to 100. Using equivalence partitioning on the numeric input, how many partitions are there?
- 101
- 4
- 3
- 2
Answer: C. 3
Explanation
There is one valid partition (0 to 100) and two invalid partitions (below 0 and above 100).
Step-by-step solution
- The valid range 0 to 100 forms one valid partition.
- Values below 0 form one invalid partition.
- Values above 100 form another invalid partition.
- Total is 3 partitions: option C.
Why the other options are wrong
- A. 101 is the count of integer values, not the number of partitions.
- B. 4 would need a fourth partition, but there are only the valid range and two invalid ranges.
- D. 2 would drop either the valid range or one of the invalid ranges.
Tip: Count partitions as ranges: one valid range plus each invalid side.
Question 2Easy
An input accepts integer ages from 18 to 60. Using standard boundary value analysis (min, min+, nominal, max-, max), which set of values is tested?
- 17, 18, 39, 60, 61
- 18, 29, 39, 49, 60
- 18, 19, 39, 59, 60
- 17, 19, 39, 59, 61
Answer: C. 18, 19, 39, 59, 60
Explanation
Standard BVA takes the minimum, just above the minimum, a nominal value, just below the maximum and the maximum: 18, 19, 39, 59, 60.
Step-by-step solution
- The valid range is 18 to 60.
- Standard BVA uses min 18, min+ 19, nominal 39, max− 59 and max 60.
- That set is 18, 19, 39, 59, 60: option C.
Why the other options are wrong
- A. 17 and 61 are outside the valid range; standard BVA does not use them.
- B. 29, 39 and 49 are not the boundary values; min+ is 19 and max− is 59.
- D. 17 and 61 are outside the valid range, so they are not standard BVA values.
Tip: Standard BVA: min, min+, nominal, max−, max.
Question 3Easy
Use case testing derives test cases from:
- Mutation operators
- Compiler warnings
- The main and alternative flows of use case scenarios
- The cyclomatic complexity of each function
Answer: C. The main and alternative flows of use case scenarios
Explanation
Each use case's basic flow and alternative or exception flows become end-to-end test scenarios.
Step-by-step solution
- A use case describes a main flow and alternative or exception flows.
- Each scenario through these flows becomes a test case.
- Thus tests come from the flows of use case scenarios.
Why the other options are wrong
- A. Mutation operators drive mutation testing.
- B. Compiler warnings are static analysis, not a source of tests here.
- D. Cyclomatic complexity guides basis-path (white-box) testing.
Question 4Easy
A full decision table for a rule with 3 independent true/false conditions has how many rules (columns)?
- 9
- 6
- 8
- 7
Answer: C. 8
Explanation
Each binary condition doubles the combinations:
2^3 = 8.
Step-by-step solution
- Each true/false condition doubles the number of combinations.
- 3 conditions give 2 × 2 × 2 = 8 rules.
- The answer is 8: option C.
Why the other options are wrong
- A. 9 is not 2 to the power 3.
- B. 6 is 2 × 3, which does not fit three true/false conditions.
- D. 7 is one short of the 8 full combinations.
Tip: A full decision table has 2 to the power of the number of binary conditions.
Question 5Medium
A state transition table has 4 states and 3 possible events. The diagram shows 5 valid transitions. How many invalid (state, event) combinations should be considered for negative testing?
- 8
- 7
- 5
- 12
Answer: B. 7
Explanation
The full table has 4 x 3 = 12 cells; 5 are valid transitions, leaving 7 invalid combinations.
Step-by-step solution
- The full table has 4 states × 3 events = 12 cells.
- 5 of these cells are valid transitions.
- 12 − 5 = 7 invalid combinations: option B.
Why the other options are wrong
- A. 8 would mean only 4 valid transitions.
- C. 5 is the number of valid transitions, not the invalid ones.
- D. 12 is the total number of cells, not the invalid ones.
Tip: Invalid combinations for negative testing = total state-event cells − valid transitions.
Question 6Medium
Equivalence partitioning is based on the assumption that:
- All values in one partition are processed the same way, so one representative is enough
- Only invalid inputs reveal defects
- Every possible input must be tested
- Errors cluster in the middle of input ranges, so the central value of each range is the only value worth testing
Answer: A. All values in one partition are processed the same way, so one representative is enough
Explanation
If the program treats a class of inputs identically, testing one member is expected to reveal the same faults as testing any other.
Step-by-step solution
- Equivalence partitioning assumes the program treats all values in one class the same way.
- So testing one representative of the class is enough.
- Option A states this assumption.
Why the other options are wrong
- B. Valid inputs can reveal defects too, so only invalid inputs is not the assumption.
- C. Equivalence partitioning exists so that every possible input does not need testing.
- D. Errors tend to cluster at boundaries, not in the middle of ranges.
Tip: Equivalence partitioning: one representative per class; boundary values are tested separately.
Question 7Medium
A discount applies as follows: 0 to 999 rupees no discount, 1000 to 4999 rupees 5%, and 5000 rupees and above 10%; negative amounts are rejected. Which set has exactly one value from each equivalence partition?
- 500, 600, 2500, 8000
- -50, 1000, 4999, 5000
- 0, 999, 1000, 4999
- -50, 500, 2500, 8000
Answer: D. -50, 500, 2500, 8000
Explanation
The partitions are: negative (invalid), 0 to 999, 1000 to 4999 and 5000 or more. -50, 500, 2500 and 8000 each fall in a different partition.
Step-by-step solution
- Partitions: negative (invalid), 0 to 999, 1000 to 4999, and 5000 or more.
- Option D gives −50, 500, 2500 and 8000.
- These fall in four different partitions, one value each: option D.
Why the other options are wrong
- A. 500 and 600 are both in the 0 to 999 partition, so the set repeats one.
- B. 1000 and 4999 are both in the 1000 to 4999 partition, so the set repeats one.
- C. 0 and 999 are both in the 0 to 999 partition, so the set repeats one.
Tip: Pick one value from each partition and check no two values share a partition.
Question 8Medium
A field accepts integers from 10 to 50 inclusive. Using three-value boundary analysis (the boundary and the values on either side of it), how many distinct values are tested?
- 5
- 4
- 6
- 8
Answer: C. 6
Explanation
For each boundary test boundary-1, boundary and boundary+1: 9, 10, 11, 49, 50, 51, which is 6 values.
Step-by-step solution
- Three-value BVA tests the boundary, one below it and one above it.
- At 10: 9, 10, 11. At 50: 49, 50, 51.
- These give 6 distinct values: option C.
Why the other options are wrong
- A. 5 is wrong; each of the two boundaries needs three values, giving 6.
- B. 4 would leave out values next to one of the boundaries.
- D. 8 is not the count; the distinct values are 9, 10, 11, 49, 50 and 51.
Tip: Three-value BVA: 3 values per boundary, so 3 × number of boundaries (unless they overlap).
Question 9Hard
Input A has 3 valid equivalence classes and input B has 4. What is the minimum number of test cases for weak normal equivalence class testing (every class of every input covered at least once)?
- 12
- 4
- 3
- 7
Answer: B. 4
Explanation
Each test can cover one class of A and one class of B at the same time, so max(3, 4) = 4 tests suffice. Strong normal testing would need 3 x 4 = 12.
Step-by-step solution
- Weak normal testing needs every class of every input covered at least once.
- Input A has 3 classes and input B has 4.
- Each test can cover one class of A and one class of B, so 4 tests cover everything.
- The minimum is max(3, 4) = 4: option B.
Why the other options are wrong
- A. 12 is 3 × 4, which is strong normal testing (all combinations).
- C. 3 tests would leave one class of input B uncovered.
- D. 7 is 3 + 4, more than needed because the classes can be paired.
Tip: Weak normal: the count is the larger of the class counts; strong normal: multiply them.
Question 10Hard
An ATM card is blocked after three consecutive wrong PINs. Which test design technique most directly targets this behaviour?
- Statement coverage
- Pairwise testing
- Equivalence partitioning
- State transition testing
Answer: D. State transition testing
Explanation
The response depends on the history of earlier events (number of failed attempts), which is exactly what state transition testing models.
Step-by-step solution
- The card's response depends on the number of earlier wrong PINs.
- So the outcome depends on the history of events, not only the current input.
- State transition testing models states and events, so it fits best: option D.
Why the other options are wrong
- A. Statement coverage checks code execution and ignores the history of events.
- B. Pairwise testing combines input parameters and does not model event history.
- C. Equivalence partitioning groups inputs but ignores the history of earlier events.
Tip: Behaviour that depends on past events points to state transition testing.
Practise all 16 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →