Alex Rivera | Logout

Eat, Sleep and Breathe Unit Testing/TDD/BDD

Asked 2009-10-23T21:48:03.983
29

I do write unit tests while writing APIs and core functionalities. But I want to be the cool fanboy who eats, sleeps and breathes TDD and BDD. What's the best way to get started with TDD/BDD the right way? Any books, resources, frameworks, best practices?

My environment is Java backend with Grails frontend, integrated with several external web services and databases.

Edit
Report

2 Answers

6

Find someone that has been doing TDD/BDD and pair program with them.

answered 2009-10-24T00:00:16.297
1

I can't see that anybody has really expressed that TDD is not about testing. TDD-ing is about expressing the expected behaviour before doing the tiny behavioural-changing modification. This greatly improves design and enables focusing in a way I have never experienced before. You get tests that protects your future refactorings and 90% coverage for free.

To learn it I would suggest (summarising what others have said and adding one of my own):

  1. visit the blogs and read the books mentioned above
  2. pair up with someone proficient in TDD
  3. practice

I practiced the Bowling kata (exercise) on my own about 20 times (about 30 minutes apiece) before I started to see the light. Started out by analysing Uncle Bob's description of it here. There are a host of katas on the codingdojo.org site including solutions and discussions. Try them!

answered 2009-11-06T10:11:57.000

Your Answer