0
0
Software Engineeringknowledge~10 mins

Equivalence partitioning and boundary value analysis in Software Engineering - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define an equivalence partition for ages between 18 and 60.

Software Engineering
def is_valid_age(age):
    return [1]
Drag options to blanks, or click blank then click option'
A18 <= age <= 60
Bage < 18 or age > 60
Cage > 18 and age < 60
Dage == 18 or age == 60
Attempts:
3 left
💡 Hint
Common Mistakes
Using < or > instead of <= or >=, which excludes boundary values.
Using 'or' instead of 'and' in the condition.
2fill in blank
medium

Complete the code to test the lower boundary value for a password length of at least 8 characters.

Software Engineering
def is_valid_password(password):
    return len(password) [1] 8
Drag options to blanks, or click blank then click option'
A>
B<
C>=
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' which excludes passwords of length exactly 8.
Using '<' or '<=' which are incorrect for minimum length checks.
3fill in blank
hard

Fix the error in the boundary value check for input between 1 and 100 inclusive.

Software Engineering
def is_in_range(value):
    return value [1] 1 and value [2] 100
Drag options to blanks, or click blank then click option'
A>=
B<=
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' or '<' which exclude boundary values.
Mixing up the operators for lower and upper bounds.
4fill in blank
hard

Fill both blanks to create a test condition that partitions input into valid and invalid age groups using equivalence partitioning.

Software Engineering
def age_group(age):
    if age [1] 17:
        return 'invalid'
    elif age [2] 18:
        return 'valid'
Drag options to blanks, or click blank then click option'
A<=
B>=
C<
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '<=' excludes age 17 from invalid group.
Using '>' instead of '>=' excludes age 18 from valid group.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps test inputs to their validity using boundary value analysis.

Software Engineering
test_results = {input_value: (input_value [1] 0 and input_value [2] 100) for input_value in [[3]]}
Drag options to blanks, or click blank then click option'
A>=
B<=
C50, 0, 100
D10, -1, 101
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' or '>' which exclude boundary values.
Choosing test inputs outside the valid range.