Build expectations before implementation

You are developing a library late-fee function with TDD. The input is a non-negative integer number of overdue days. The first two overdue days are free; each additional day costs 30 cents, with a maximum total fee of 180 cents.


The current implementation returns zero for every input. During test planning, calculate the expected fees for 2, 3, and 9 overdue days. Also determine how many of these three assertions would fail if each were run independently against that unchanged implementation.


Enter each fee in cents as an exact integer and the failure count as an exact integer number of tests.

Your answers

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 Test-Driven Development Questions: