Separate green tests from valid refactoring

A rebate function must return 500 cents for purchases of at least 10000 cents and zero for smaller purchases. Its only tests check purchases of 2000 cents and 14000 cents, and both pass.


During a proposed refactoring, a developer renames a private helper and changes the rebate threshold from 10000 cents to 11000 cents. Both existing tests still pass. Which statements are correct? 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 Test-Driven Development Questions: