Bird
0
0

You want to test a function that returns the maximum number from a list. Which test case is best to include?

hard📝 Application Q8 of 15
Testing Fundamentals - Why Software Testing Matters
You want to test a function that returns the maximum number from a list. Which test case is best to include?
AAll of the above
BTest with only one number in the list
CTest with an empty list
DTest with a list of positive and negative numbers
Step-by-Step Solution
Solution:
  1. Step 1: Consider test case variety

    Testing with positive/negative numbers checks normal behavior.
  2. Step 2: Include edge cases

    Single element and empty list test edge conditions.
  3. Step 3: Combine all cases

    All these cases together ensure thorough testing.
  4. Final Answer:

    All of the above -> Option A
  5. Quick Check:

    Good testing covers normal and edge cases [OK]
Quick Trick: Test normal and edge cases for best coverage [OK]
Common Mistakes:
  • Testing only normal cases
  • Ignoring empty input
  • Missing single element case

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Testing Fundamentals Quizzes