Bird
0
0

Consider this code snippet representing a test suite run:

medium📝 Predict Output Q4 of 15
Testing Fundamentals - Testing Types and Levels
Consider this code snippet representing a test suite run:
def smoke_test(build):
    if build['critical_feature'] == 'working':
        return 'Pass'
    else:
        return 'Fail'

result = smoke_test({'critical_feature': 'working'})
print(result)

What will be the output?
APass
BFail
CError
Dnull
Step-by-Step Solution
Solution:
  1. Step 1: Analyze function input and condition

    The input dictionary has 'critical_feature' set to 'working', so the condition is true.
  2. Step 2: Determine function return value

    Since condition is true, function returns 'Pass' which is printed.
  3. Final Answer:

    Pass -> Option A
  4. Quick Check:

    Function returns 'Pass' when critical feature works [OK]
Quick Trick: If critical feature works, smoke test passes [OK]
Common Mistakes:
  • Assuming output is 'Fail' without checking condition
  • Expecting an error due to dictionary usage
  • Ignoring the return value and print output

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Testing Fundamentals Quizzes