We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this questionI find unit 开发者_运维技巧testing vital.
Several times I have tried the TDD but given up on it as sitting down with a piece of paper and drawing out a few diagrams first always seem more productive. As so many advocate the TDD I will keep trying.
I looked at this http://xprogramming.com/xpmag/sudoku5 (the last article of 5) but this seemed to highlight the difficulty I have with the approach.
Are there any good sample walkthroughs on the web based on a simple easily defined problem? This way I could try the approach again myself then compare with the sample. The sample would need to explain the thinking behind the approach.
I prefer to code in C# but have used Java.
The XP bowling game episode in the usual example, it's a dialogue between two developers coding. Theit code is written in Java. It's a nice illustration of how design emerge, rather than being defined up front.
Roy Osherove's String Calculator TDD Kata is a very good place to start because many people have done it and blogged about it or posted screencasts of doing it. He has linked to a number of them. This video in c# is a pretty good low-ceremony implementation IMO. People writing about doing the kata in C# or Java are easy to find. If you prefer a step-by-step textual walkthrough try David Tchepak's.
http://katacasts.com/ has many good examples (in many different languages) of doing Code Katas which include heavy TDD.
Just recently Kent Beck has put video's up at http://pragprog.com/screencasts/v-kbtdd/test-driven-development (pay to watch) and I have yet to hear anything bad about them.
Another one to note is James Shore has also put up many TDD videos for his "Let's Play TDD" series at http://jamesshore.com/Blog/Lets-Play/
Two resources I have found really useful:
James Shore has a YouTube video series where he builds a small piece of software from scratch using TDD and recording every step of the process. To my mind this should be required viewing to anyone who's thinking about starting with TDD, I only came across it recently and I'm surprised it doesn't have more exposure. There's 120 15-minute videos - that's a LOT of material.
Derek Greer at Los Techies has a series of posts walking through creating a basic game of tic-tac-toe. This is also very good but obviously doesn't go into as much depth as the previous resource. I'd recommend this if you don't have a lot of time.
One VERY good for C is: http://cutter.sourceforge.net/reference/tutorial.html
I would also recomend this book for Java/Web/Spring : http://www.amazon.co.uk/Agile-Development-Spring-Hibernate-Eclipse/dp/0672328968/ref=sr_1_1?ie=UTF8&s=books&qid=1261472344&sr=8-1
This is a much better TDD solution to sudoku http://johannesbrodwall.com/2010/04/06/why-tdd-makes-a-lot-of-sense-for-sudoko/
Please have a look here- http://www.basicsbehind.com/tdd-by-example/ It has step by step implementation of a simple Shopping Cart app using TDD.
精彩评论