Hi Arminas,
thanks for your post. It contains a lot of useful tips. I really enjoyed it.
You started with an interesting sentence:
Test-Driven Development seems such a simple technique, yet it causes a wide range of reactions towards it.
First things first: That's 100% true.
But... 😉
I think TDD is not that simple. Or, to put it in better words: Using TDD in real-world projects is not that simple.
I have "learned" TDD years ago. I've read "all the books" ("Test-Driven Development by Example", "Growing Object-Oriented Software Guided By Tests", "The Art of Unit Testing", and so on). I knew how to write tests. I knew "Red-Green-Refactor". Easy. I've done a ton of katas (FizzBuzz, The Bowling Game, Roman Numbers, ...) over and over. Still no problem.
But when it came to (what I call) "real-world" applications, I was paralyzed.
I'm a .NET guy writing most of my stuff in C# and ASP.NET MVC. Where do I start? Do I start with the controller? If so, WHERE in the controller? Controller actions return views (in most cases). Do I test the views? If so, HOW? Do I assert against every HTML element? Or maybe I just test my model? Or is it stupid to test models?
Some day it all clicked. But it was hard work. Learning the stuff that's between FizzBuzz and the complex systems at work. Maybe it took so long because I had the wrong resources. I don't know. But every time I read "TDD is simple", I have the reflex to write a long comment. Sorry about that. 😄
Hello, thanks for you comment. I agree, that is way I wrote that it just "seems like a simple technique".
But I'd say statement that it's simple is still true. Because TDD essentially is just "write failing test, fix code, repeat". So more correctly I would say, "TDD is simple, applying it is not" :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Arminas,
thanks for your post. It contains a lot of useful tips. I really enjoyed it.
You started with an interesting sentence:
First things first: That's 100% true.
But... 😉
I think TDD is not that simple. Or, to put it in better words: Using TDD in real-world projects is not that simple.
I have "learned" TDD years ago. I've read "all the books" ("Test-Driven Development by Example", "Growing Object-Oriented Software Guided By Tests", "The Art of Unit Testing", and so on). I knew how to write tests. I knew "Red-Green-Refactor". Easy. I've done a ton of katas (FizzBuzz, The Bowling Game, Roman Numbers, ...) over and over. Still no problem.
But when it came to (what I call) "real-world" applications, I was paralyzed.
I'm a .NET guy writing most of my stuff in C# and ASP.NET MVC. Where do I start? Do I start with the controller? If so, WHERE in the controller? Controller actions return views (in most cases). Do I test the views? If so, HOW? Do I assert against every HTML element? Or maybe I just test my model? Or is it stupid to test models?
Some day it all clicked. But it was hard work. Learning the stuff that's between FizzBuzz and the complex systems at work. Maybe it took so long because I had the wrong resources. I don't know. But every time I read "TDD is simple", I have the reflex to write a long comment. Sorry about that. 😄
But again: Nice post. Keep up the great work.
Hello, thanks for you comment. I agree, that is way I wrote that it just "seems like a simple technique".
But I'd say statement that it's simple is still true. Because TDD essentially is just "write failing test, fix code, repeat". So more correctly I would say, "TDD is simple, applying it is not" :)