This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Jason, I agree about not confusing the two. Some (but not all) of the junit tutorials include TDD. And even more of the articles on TDD include pair programming.
Joined: Jul 31, 2003
Originally posted by Jason Menard: Just my two cents, but I would be careful about confusing test driven development (TDD, aka test-first design), a development methodology, with JUnit, a framework. Creating good unit tests does not require that TDD principles be used.
That's the problem when you know just enough to cause trouble. I had thought they were mutual predicates. Now it looks like I have to learn TDD just so I know when and when not to apply it. Thanks for all the responses so far. I'll be palying with some of the tutorials and walk-throughs this weekend. Tom
Originally posted by Jason Menard: Creating good unit tests does not require that TDD principles be used.
Agreed. TDD is more about creating a good design of the production code than about testing. High test coverage is more of a side effect of TDD.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
For what it's worth - I used the tutorials they point you to when you download JUnit and I got it working reasonbly well. I think the biggest challenge was figuring out how to set-up the part that ran all my tests and how to use it from the Swing GUI. Now I use it from Ant and that took a little figuring out too. If you are using Ant, I'd recommend Erik Hatcher and Steve Loughran's Java Development with Ant - also published by Manning. There are examples on how to set-up Ant with JUnit and how to run the reports that the Ant task can generate. Here's some more JUnit resources: Scott Davis, the Ex-President of our local Java User Group did a talk on JUnit for our Basic Concepts. Here's his ZIP file: http://denverjug.org/bc/junit.zip. Sort of interesting that Patrick Linskey was the featured speaker and he's co-author of Bitter EJB. The other JUnit resource I'm going to point to is Mike Clark, another co-author of Bitter EJB and author of JUnitPerf. He spoke to our JUG on Bitter EJB but he also gave a great talk on JUnit to the XPDenver user group. Agile Design and Testing With JUnit was the name of the talk and it was sponsored by Net Objectives. Here's a link that describes Mike's talk (which was terrific by the way) and here's a link to his notes. He also does Test Driven Design and I believe he talked about that but as others have mentioned, you do not have to do TDD to start using JUnit. Hope this helped -