How to start learning Test Driven Development or Behavior Driven Development?

When you get to the point of understanding that you do not have a lifetime to spend on F5 debugging/testing and you want to be a better developer ( I beg you to get it now! ), you should ask : How to learn Test Driven Development or Behavior Driven Development? Where are the best resources?

Note : Do I declare that I have the deepest, most structured and refine knowledge about the topic? Nope. I say this in the begging in order to avoid irrelevant and inconsiderate comments.

I do this because want to share my experience from my trip from FCD ( Full Chaos Development ) and SGD ( Shotgun Debugging ) to TDD/BDD which is still not done in order to provoke discussion so the knowledge is refined and distilled by the community – I will update the article with every good feedback. When I started learning there was not anybody to help me or guide me in my journey. Now when I have a team of developers to coach, teach, guide, take care of and lead them to get the projects done I do not want them to take the long and hard way. So I have decided to condense what I know to be valuable and post it.

I give you a list of books/videos/resources and I place them in the order I believe is most appropriate to read/watch. I put my fellow developers through them and mix them frequently with some short but practical projects ( not the useless and obscure which you struggle to put in the light of real world scenarios ). Book/Video-Task-Book/Video-Task.-Again-Again-Again. Explanation of the prior sentence:

  1. You will not learn TDD/BDD by just reading/watching because UMDM and as my teacher of physics said once ten years ago when I tried to play it smart in class – “Whoever writes remembers and whoever remembers forgets”.
  2. You must put it into practice right away so that everything that went through your head go through your fingers.
  3. There is not short-cut to get a good grasp of TDD quick. Practice is the way.
  4. Short frequent projects ( tasks ) to practice TDD/BDD are better then long ones because by my observation humans ( devs are humans too ) tend do be very good of deducing knowledge from experience from many examples rather then from a few. I mean that when you have done a lot of tasks and you reflect back on to them after the current task at hand, you tend to discover your previous flaws and to discover better ways of doing TDD
  5. If you give your developers 2 hours from their 8 hours every day for learning I promise you that after two months you will have productivity boost, sharp decline of bugs, better designed software which is fit for long term maintainability ( where the most cost goes ) and smiling developers that you will not otherwise have.

So the list I recommend :

  1. Book – Professional Test Driven Development with C#
    A lot of concepts are well explained. I can say convincingly explained to get you on track. The book also offers a bit of advice for structuring a project. Definitely does not provide real world examples and is not that worthy.
  2. Book – The Art of Unit Testing: with examples in C#-A very good book to get you a bit deeper.
  3. Book – Dependency Injection in .NET
    Prerequisite for testable and maintainable software.
  4. Video – Outside-In Test Driven Development – By my opinion the best way to do projects : outside-in mixed with TDD.
  5. Video – Test First Development – Part 1
  6. Video – Test First Development – Part 2 – Scratches the surface of different types of tests and how to transform requirements to tests and how to communicate them with the client. Very useful indeed! Check out Cucumber and SpecFlow here. Check for Gojko Adzic and ‘Specification by example’ book.
  7. Video – Advanced Unit Testing –  Be sure to watch this. This is marvellous explanation with examples on how to do TDD in practice in real world, non-trivial software. Do not miss the last three modules!
  8. Book  – xUnit Test Patterns
    Reference and study book.

Be sure not overlook these materials because of the short comments after the links! Of course this is not everything. Intentionally I do not provide any blogs because when you begin you will learning you will not be able to sort out the information and get into the right direction. If you start from blogs you will most probably get lost in the ocean of information and take the long hard way.

Books are the best place to start because

  1. they are written by professionals,
  2. scrutinized and edited by team of other professionals
  3. are peer-reviewed by other professionals
  4. published by other professionals who are interested in providing the best quality in order to get profit

so they (the books) have the best chance of providing you with the best condensed and refined material to start learning. Videos are good to polish/upgrade your skills and reflect upon your past work.

I know that I do not give much explanation why I see things that way because I am not actually an expert in TDD with 15+ years of experience. That is why I trust the experts in order to get up and running quickly in the best possible way.

I have personally applied all things ( skills, knowledge, etc. ) I learned from Mark Seemann books and videos. My unit of measure is that I actually improved the quality of my code.  I can see steady improvement in my teammates coding skills too. If you read, watch and practice and take heed on Mark Seemann`s  knowledge you will eventually understand what I am talking about. There are other great coders too that practice TDD and BDD but he is a good teacher which make his explanations and examples stick into your brain and are easily projected into real world examples.