Bird
Raised Fist0

You have three modules: A returns a list of numbers, B filters out even numbers, and C sums the remaining numbers. How would you write an integration test to verify the final sum?

hard🚀 Application Q8 of Q15
Testing Fundamentals - Testing Types and Levels
You have three modules: A returns a list of numbers, B filters out even numbers, and C sums the remaining numbers. How would you write an integration test to verify the final sum?
ATest each module separately without combining outputs.
BPass the list from A to B, then B's output to C, and check if sum matches expected.
COnly test module C with a fixed input.
DSkip testing module B and combine A and C outputs.
Step-by-Step Solution
Solution:
  1. Step 1: Understand module flow

    Module A outputs list, B filters evens, C sums filtered list.
  2. Step 2: Design integration test

    Pass output from A to B, then B to C, verify final sum matches expected result.
  3. Final Answer:

    Pass the list from A to B, then B's output to C, and check if sum matches expected. -> Option B
  4. Quick Check:

    Integration test = Chain outputs and verify final result [OK]
Quick Trick: Chain module outputs stepwise to test integration [OK]
Common Mistakes:
MISTAKES
  • Testing modules in isolation only
  • Skipping intermediate module outputs

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Testing Fundamentals Quizzes