My experience is mostly with server-side web frameworks, so that's how I'll describe it:
- I start in an "outer" TDD loop:
- 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)
- 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.
- Repeat steps 3 until I hit some logic that isn't solved with simply writing together things the framework gives me.
- 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.
- I start an "inner" TDD loop:
- Write a unit test for that business function.
- Make it pass as simply as I can.
- Refactor/cleanup.
- Repeat steps 7-9 until I'm satisfied that it's completely tested.
- Pop back up to my outer loop. It should be passing now.
- Refactor/cleanup.
- Goto 1