volume_mute
First, Middle, Last Element Testing
publish date: 2026/06/18 03:41:34.889128 UTC
volume_mute
A tester is testing a method that finds the maximum value in an array. According to the 'first, middle, last' sequence testing guideline, which test inputs should be included?
Correct Answer
Design tests where the maximum value appears at the first position, at a middle position, and at the last position
Explanation
The 'first, middle, last' guideline says to derive tests so that the first, middle, and last elements of the sequence are accessed. For a maximum-finding function, this means testing with the maximum value at position 0 (first), at a middle position, and at the last position. This reveals problems at partition boundaries in array processing.
Reference
Software Engineering, Ian Sommerville, 10th edition
