Which of the following best describes the purpose of equivalence partitioning in software testing?
Think about grouping inputs that behave similarly to reduce test cases.
Equivalence partitioning divides inputs into groups where all values in a group are expected to be handled the same way, reducing the number of test cases needed.
Consider a function that accepts an integer input between 1 and 10 inclusive. Which test input value is a boundary value?
def test_input(value): if 1 <= value <= 10: return "Valid" else: return "Invalid"
Boundary values are at the edges of valid input ranges.
Boundary values are the smallest and largest valid inputs, here 1 and 10. Among options, 1 is a boundary value.
Which assertion correctly tests that a function calculate_discount returns 0% discount for purchase amounts less than $100?
def calculate_discount(amount): if amount >= 100: return 10 else: return 0
Check the discount for just below the boundary value.
For amounts less than 100, discount is 0. Testing with 99 checks this boundary condition correctly.
Given the following test cases for a function accepting ages 18 to 60 inclusive, which test case is incorrectly chosen based on equivalence partitioning?
test_cases = [17, 18, 30, 60, 61]
Check if 61 belongs to any valid or invalid partition.
61 is outside the valid range and belongs to the invalid partition, but it is not a boundary value for invalid inputs since 61 is just above 60. The boundary invalid value should be 61, but 61 is not a boundary value for equivalence partitions here.
You need to design test cases for a login form that accepts passwords between 8 and 12 characters. Which set of test inputs best combines equivalence partitioning and boundary value analysis?
Include values just outside and inside the valid range.
Option D includes values just below (7), at the lower boundary (8), a middle valid value (10), at the upper boundary (12), and just above (13), covering both equivalence partitions and boundary values.