Full Branch Coverage with a Missed Qualifying Route

A shop’s rule awards a 12 CAD discount to every member and to any non-member spending at least 120 CAD. Other customers receive no discount. The following Python function implements that rule.


Python
def discount(member, spend):
    if member or spend >= 120:
        return 12
    return 0


Python uses short-circuit evaluation for or. The suite contains (True, 150) with expected result 12 and (False, 80) with expected result 0. Count only the full if decision’s true and false exits as branch items.


Which statements about this suite are true? Select all that apply.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More White-Box (Glass-Box) Testing Questions: