TDD != Unit Tests (and vise versa)

1 comment

Monday, June 30, 2014

It’s been a busy week that started somewhere three months ago and I’ve missed most of the whole “TDD is dead” argument.

I finally had some time to sit and watch the discussions on the topic between Kent Beck, Martin fowler and David Heinemeier Hansson.

If you’re interested in unit testing and TDD (and you should be) - this is a great opportunity to listen to great minds and learn what they think of the subject – I know I learnt a lot and plan to continue watching till the end (there’s .

Although I only got as far as the 2nd part–  I can see a pattern emerging – it seems that every argument for or against TDD is actually about unit testing.

It seems that the discussion is not about “why TDD is good/bad” but a discussion about whether or not use unit tests (use!), the unnecessary layers of abstraction they might introduce (the dreaded design for testability) and how people completely miss the point by tying themselves to implementation by over mocking their application.


A quick search in the internet showed me why at least one of the participants think so:


DHH has a good point – obviously how you write unit tests effects directly the way you practice TDD.

But there’s more to TDD than just writing unit tests just like there’s more to software development than writing code. I always argue that the unit tests are a byproduct of TDD and not the other way around – we use unit test to drive our code design, and at the end of the process we’re left with a pretty decent test coverage that can prevent regression but we’re also left with a very specific design – which is the objective of the whole process.

Knowing how to write good unit tests is crucial in order for TDD to succeed – but you also need to have good coding practices, know how to refactor your code and a thing or two on software design in order to be successful.

Because TDD is not about writing unit tests – it’s about design. The tests are there to help with that and theoretically can be deleted as soon as you’re done writing your code – although I’m yet to find someone who would give up the benefit of having the unit tests.

I hope that the next 3 parts of the hangout would concentrate on TDD as a design methodology and leave the unit testing discussion behind.

My DevGeekWeek sessions

No comments

Thursday, June 26, 2014

I’ve had fun today at DevGeekWeek where I got to talk about writing clean code and unit testing best practices.

I’d like to thank the participants of today’s seminar – you were a great audience and I enjoyed speaking with you and learning about your experience with Agile, unit testing and writing code.

Just in case you weren’t there today – here are the slides:

DevGeekWeek 2014


Monday, June 09, 2014

Those you know me (or read my blog) know that I’m passionate (with a capital P) about software development, clean code and of course unit testing.

And I’m happy to be given the opportunity to talk about these topics as part of The DevGeekWeek 2014 conference.DGW_addmails_down

The DevGeekWeek is a week of all things software development and is scheduled for the 22-26 of June and will be held in the Daniel Hotel in Hertzelia (Israel).

CodeValue is responsible for the Extreme .NET with C# track with great speakers including yours truly.


I’ll be delivering two sessions on the last day at the Code Quality, Testing & Automation with Visual Studio & TFS seminar:

We’ll start with a session by Alon Fliess about Architecting Code For Quality, then my colleague Haim Kabesa with Building Coded UI Tests with Visual Studio and Test Manager and after launch I get to present two of my favorite topics:

  • Writing Clean Code in C# and .NET
  • Building Unit Tests correctly with Visual Studio 2013

I’ll talk about code and readability, avoiding stupid bugs and unit testing for the .NET developer – using Visual Studio to make it all happen.


See you there!

Related Posts Plugin for WordPress, Blogger...