I've been doing a lot of searching around for helpful stuff, so I'm just basically dumping what I've found here, mainly for my own benefit, but maybe someone else will find it useful.
So I've been looking around online for tutorials and examples on how to go about TDD. There seem to be a great deal of really trivial examples out there, but trivial examples aren't very useful. They're fine for explaining the basic concepts of the methodology, but generally in the real world things just aren't as simple as a "Fizz Buzz" generator! I imagine all sorts of problems and complexities emerge when trying to do TDD on a real-world system.
In the end I found a goldmine. Derek Greer over at Los Techies has a fantastic series of posts on TDD, and among them an in-depth walkthrough of using TDD to build a tic-tac-toe game. Now obviously this is still much simpler than a full-blown graphical game but it captures the process, which is what I'm interested in: what are the brick walls, the shifts in thinking you have to do, etc.
As there doesn't seem to be an index page for just this series of posts, I'll keep a list of them here for my own use. The series seems to be ongoing so I'll keep this list updated when I notice any new posts.
- A Unit Test Example
- Test First
- A Test-First Example – Part 1
- How Faking It Can Help You
- A Test-First Example – Part 2
- A Test-First Example – Part 3
- A Test-First Example – Part 4
- A Test-First Example – Part 5
- A Test-First Example – Part 6
- Test Doubles
- Double Strategies
- Auto-mocking Containers
- Custom Assertions
- Expected Objects
- Introducing the Expected Objects Library
- Avoiding Context Obscurity
Update: Let's Play TDD
I'm updating this post with a video series I've just found on YouTube by James Shore (user jdlshore). This looks like exactly what I've been looking for, and it's really in-depth: at the time of writing there are 128 videos in the series! Each one seems to be around 15 minutes long, which adds up to over 30 hours worth of material! This is incredible, such a valuable resource, and I had no idea it even existed. Here's a link to the playlist of the entire series, but I'll embed the first video here so you can preview it easily:
Unit testing videos
Channel 9: Top 10 Mistakes in Unit Testing
Google TechTalks: Automated Testing Patterns and Smells
Google TechTalks: Behaviour Driven Development