0
0
Software Engineeringknowledge~20 mins

Equivalence partitioning and boundary value analysis in Software Engineering - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Master of Equivalence Partitioning and Boundary Value Analysis
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Equivalence Partitioning

Which of the following best describes the purpose of equivalence partitioning in software testing?

ATo test only the smallest and largest values of input data
BTo divide input data into groups that are expected to be treated the same by the software
CTo check the software's response to invalid inputs only
DTo write test cases that cover every possible input value
Attempts:
2 left
💡 Hint

Think about grouping inputs that behave similarly to reduce test cases.

🔍 Analysis
intermediate
2:00remaining
Boundary Value Analysis Output

Consider a function that accepts an integer input between 1 and 10 inclusive. Which test input value is a boundary value?

Software Engineering
def test_input(value):
    if 1 <= value <= 10:
        return "Valid"
    else:
        return "Invalid"
A1
B11
C5
D0
Attempts:
2 left
💡 Hint

Boundary values are at the edges of valid input ranges.

assertion
advanced
2:00remaining
Assertion for Boundary Value Test

Which assertion correctly tests that a function calculate_discount returns 0% discount for purchase amounts less than $100?

Software Engineering
def calculate_discount(amount):
    if amount >= 100:
        return 10
    else:
        return 0
Aassert calculate_discount(101) == 0
Bassert calculate_discount(100) == 0
Cassert calculate_discount(99) == 0
Dassert calculate_discount(50) == 10
Attempts:
2 left
💡 Hint

Check the discount for just below the boundary value.

🔍 Analysis
advanced
2:00remaining
Debugging Equivalence Partitioning Test Cases

Given the following test cases for a function accepting ages 18 to 60 inclusive, which test case is incorrectly chosen based on equivalence partitioning?

Software Engineering
test_cases = [17, 18, 30, 60, 61]
A61 - valid partition boundary
B18 - valid partition boundary
C30 - valid partition middle
D17 - invalid partition
Attempts:
2 left
💡 Hint

Check if 61 belongs to any valid or invalid partition.

framework
expert
3:00remaining
Designing Test Cases Using Both Techniques

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?

A[6, 7, 13, 14, 15]
B[1, 5, 8, 12, 20]
C[8, 9, 10, 11, 12]
D[7, 8, 10, 12, 13]
Attempts:
2 left
💡 Hint

Include values just outside and inside the valid range.