Sign in Go Pro

Test Driven Development with Espresso

How To Drive a Bug Fix with Red/Green/Refactor

This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson

Up next


In this Lesson you will learn:

  • A high level overview of what TDD is.
  • How to test drive a bug fix using Red/Green/Refactor
  • How to use the not matchers to verify that an item is NOT on the screen.
  • How to check the fragment backstack for items

- TDD Wikipedia
- TDD By Example – an must read for any TDD fan
- Is TDD Dead? A great video discussion with industry thought leaders
- IsNot.not Hamcrest Matcher
- Red/Green/Refactor by Uncle Bob Martin


Could you post the link you mention about how to setup a CI environment?

Actually that is not proper TDD. What I had expected to see was once you added the code to hide the fab, that you show that something undesired has happened: It keeps being hidden when you go back. How do you fix it? Right! Write another test that ensures that the button is back up when you go back. That one should fail and only then you should write the whole onBackstackChanged callback. So in a way, you cheated and failed to properly explain hard core TDD.

You need to go PRO to post comments.

Lessons in Test Driven Development with Espresso