Skip to content

Instantly share code, notes, and snippets.

@blaix
Created May 18, 2018 21:55
Show Gist options
  • Save blaix/5276c08d862129442bac916edbec2726 to your computer and use it in GitHub Desktop.
Save blaix/5276c08d862129442bac916edbec2726 to your computer and use it in GitHub Desktop.

My experience is mostly with server-side web frameworks, so that's how I'll describe it:

  1. I start in an "outer" TDD loop:
  2. Write a functional test that hits the URL of the feature I'm testing This fails for a silly reason: no route, no template, etc. (scaffolding)
  3. I add only the piece of scaffolding that's causing the failure I'm seeing. At this point I'm just dealing with "glue" that the framework provides me.
  4. Repeat steps 3 until I hit some logic that isn't solved with simply writing together things the framework gives me.
  5. I call a function (or whatever) that doesn't exist yet but named for the logic I'm introducing. My integration test is now failing because it doesn't exist.
  6. I start an "inner" TDD loop:
  7. Write a unit test for that business function.
  8. Make it pass as simply as I can.
  9. Refactor/cleanup.
  10. Repeat steps 7-9 until I'm satisfied that it's completely tested.
  11. Pop back up to my outer loop. It should be passing now.
  12. Refactor/cleanup.
  13. Goto 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment