Bird
0
0

Consider this code snippet for testing input groups:

medium📝 Predict Output Q13 of 15
Testing Fundamentals - Functional Testing Techniques
Consider this code snippet for testing input groups:
inputs = [1, 5, 10, 15, 20]
covered_groups = set()
for i in inputs:
    if i <= 5:
        covered_groups.add('low')
    elif i <= 15:
        covered_groups.add('medium')
    else:
        covered_groups.add('high')
print(sorted(covered_groups))

What will be the output?
A['low', 'medium', 'high']
B['low', 'medium']
C['medium', 'high']
D['low', 'high']
Step-by-Step Solution
Solution:
  1. Step 1: Analyze input classification

    Inputs 1 and 5 are 'low', 10 and 15 are 'medium', 20 is 'high'.
  2. Step 2: Determine covered groups

    All three groups 'low', 'medium', and 'high' are added to covered_groups.
  3. Final Answer:

    ['low', 'medium', 'high'] -> Option A
  4. Quick Check:

    All input groups covered = ['low', 'medium', 'high'] [OK]
Quick Trick: Check each input group coverage carefully [OK]
Common Mistakes:
  • Missing the 'high' group for input 20
  • Assuming 15 is 'high' instead of 'medium'
  • Forgetting to sort the output

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Testing Fundamentals Quizzes