Test Driven Development, do you use it?

  • (2 Pages)
  • +
  • 1
  • 2

19 Replies - 5830 Views - Last Post: 07 March 2013 - 07:20 AM

Poll: Test Driven Development, do you use it? (22 member(s) have cast votes)

Do you use TDD?

  1. Yes, all the time (6 votes [27.27%] - View)

    Percentage of vote: 27.27%

  2. Yes, for most of my code I develop (3 votes [13.64%] - View)

    Percentage of vote: 13.64%

  3. Yes, for some of the code I develop (7 votes [31.82%] - View)

    Percentage of vote: 31.82%

  4. No, I am not familiar with it (4 votes [18.18%] - View)

    Percentage of vote: 18.18%

  5. No, I dont like it (0 votes [0.00%])

    Percentage of vote: 0.00%

  6. No. (some other reason for not using it) (2 votes [9.09%] - View)

    Percentage of vote: 9.09%

Vote Guests cannot vote

#16 cfoley  Icon User is online

  • Cabbage
  • member icon

Reputation: 1985
  • View blog
  • Posts: 4,120
  • Joined: 11-December 07

Re: Test Driven Development, do you use it?

Posted 25 February 2013 - 01:27 AM

Whenever I don't use TDD, these are the times I end up debugging corner cases forever or struggling to build on the foundation of a shaky codebase. For all but the most trivial of prototyping, I use TDD almost religiously. Sometimes I write the code before the tests but that's because I want to feel the way to get the interface right. Maybe I would be better to do some upfront planning here.
Was This Post Helpful? 1
  • +
  • -

#17 wordswords  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 76
  • View blog
  • Posts: 272
  • Joined: 17-December 11

Re: Test Driven Development, do you use it?

Posted 25 February 2013 - 04:48 PM

View Posttycos, on 14 February 2013 - 12:27 AM, said:

I have worked on projects that have used Cucumber tests, Ruby on Rails, I am sure we wrote too many tests at times and running all of them took ages!

Watching some dev videos recently I would be more inclined to use unit tests, when writing these tests what you write often becomes part of the classes you use in the final code so you don't feel you are wasting time.

Where any kind of tests really help is when many people are all on a single project and pushing new features out often, it becomes hard to ensure you don't break parts of a system you have not worked on.

So I do use it sometimes and have mixed feelings about it.


That sounds like BDD, not TDD. Cucumber is a tool for writing automated acceptance tests in a domain language. TDD is usually about writing unit tests.

This post has been edited by wordswords: 25 February 2013 - 05:28 PM

Was This Post Helpful? 0
  • +
  • -

#18 wordswords  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 76
  • View blog
  • Posts: 272
  • Joined: 17-December 11

Re: Test Driven Development, do you use it?

Posted 25 February 2013 - 05:06 PM

TDD is really about writing the tests first. If you're not writing the tests first, you're not doing TDD.

Writing unit tests and aiming for high code coverage (percentage of your code that is covered by unit tests) is a really good thing to do, and is very important in most applications. TDD is one step further however (or backwards, or sideways, depending on your thoughts on TDD).
Was This Post Helpful? 1
  • +
  • -

#19 tycos  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 53
  • Joined: 12-February 13

Re: Test Driven Development, do you use it?

Posted 07 March 2013 - 03:11 AM

View Postwordswords, on 25 February 2013 - 05:06 PM, said:

TDD is really about writing the tests first. If you're not writing the tests first, you're not doing TDD.


I have worked on projects where the tests were written first, cucumber was just part of the tests that were written which test behavior yes, there was a lot more to it than that but I did not want to go into too much detail.

It is strange when you first dev in this way, so many people like to dive straight into coding the solution. Would be nice to see some tutorials on this site for TDD.

Have you seen the MDD(Mortgage Driven Development) and Refuctoring Your Cukes video? Worth looking up.
Was This Post Helpful? 1
  • +
  • -

#20 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3568
  • View blog
  • Posts: 11,086
  • Joined: 05-May 12

Re: Test Driven Development, do you use it?

Posted 07 March 2013 - 07:20 AM

LOL! I haven't seen the video yet, but this teaser had me rolling on the floor:

Quote

In this talk you'll learn how to use Mortgage-Driven Development (MDD) to destroy the readability and value of your Cucumber tests, so that you can protect your position as the only person who understands what the system does:

Learn the simple refuctorings that gradually, over time, will undermine and ultimately destroy the readably of your cukes so that business stakeholders no longer take any interest in them, and you can get back to coding in peace.

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2