• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

test driven design

 
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
What is test driven design??? How can i make any project based on this design?
Thanks,
kundan
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a good summary at http://www.objectmentor.com/writeUps/TestDrivenDevelopment and an example at http://www.objectmentor.com/resources/articles/xpepisode.htm
 
kundan varma
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you really think XP programming should be so strictly followed or is possible in real life coding and design???
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's at least a good idea to try it for a while, in my experience.

I don't understand what you mean by "real life coding and design" - what in the example seems to conflict with reality to you?
 
kundan varma
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What i mean was that is an example rather than real life project
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, they work in real life. Robert Martin proposes these three rules:


Over the years I have come to describe Test Driven Development in terms of three simple rules. They are:

1. You are not allowed to write any production code unless it is to make a failing unit test pass.

2. You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.

3. You are not allowed to write any more production code than is sufficient to pass the one failing unit test.


See more from his blog on the topic.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by kundan varma:
What i mean was that is an example rather than real life project



Well, when I work in real life, it often enough works very similarly to the example, yes.

I guess I still don't understand what your doubt is...
 
author
Posts: 799
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ahhh, I'm still proud of that Object Mentor writeup on TDD for its short and succinct nature. It makes things sound so deceptively easy. ;-)

As far as using TDD (test-driven development) on a "real" effort, shops all over the place are doing it all the time, some for extremely large applications. Sabre, for example, uses it for some pretty complex systems.

Most of us who've done TDD for some time won't go back to any other way of development. None of us would consider writing any sort of large system without the confidence, design guidance, and comprehensive documentation TDD gives you.

-Jeff-
 
Jeff Langr
author
Posts: 799
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oh yeah, and you can do TDD and pretend that it never came out of XP. It works just fine as a development practice on its own.

-Jeff-
 
Jeff Langr
author
Posts: 799
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want an example of a "real" system built using TDD, take a look at the source for the testing tool called Fitnesse.
 
kundan varma
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you all for your inputs, ya now its clear to me and acceps that TDD is the right and proper way of doing a project

Thanks,
kundan
 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The never-ending fight that I have with project managers is the time and effort required to develop and maintain a complete JUnit test suite. If you test every class and every method, you've roughly doubled the size of your code base and maintainence effort. That effort isn't free and without cost, and it takes an enlightened PM to realize what's in it for them. When they are rewarded on budget and schedule metrics, and not on-going quality or maintainence, it's a hard sell.

I try explaining that it's better to find defects as early as possible, and a complete JUnit suite will pay dividends later on when it comes time to refactor or add new features, but the argument often falls on deaf ears.

We did write JUnit tests on the last project that went to production - on time and no defects, but we were far from 100% code coverage. As deadlines loomed the JUnit tests were put aside.

I hope to do better next time, but it takes planning and foresight. Not everyone on the team is 100% behind it.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is that without the tests, you don't know as well when the code really is *done" - that is, is actually working.

With other words, when you don't have tests, how can you say you are done when actually you have to expect to still spend a significant amount of time on debugging and bug fixing?
 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nice discussion
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic