wood burning stoves 2.0*
The moose likes Testing and the fly likes Test-Driven Development Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Test-Driven Development" Watch "Test-Driven Development" New topic
Author

Test-Driven Development

Manfred Mueller
Greenhorn

Joined: Jul 18, 2002
Posts: 10
First of all I'd like to say thank you, Andy and Dave, for the lots of information and insight you let me draw from the "Pragmatic Programmer" and "Programming Ruby" which I discovered only a few months ago.
On my "Ruby way", browsing your web site for the Win32 Ruby package, I found that you also published a book on unit testing. Since your classic book taught me that unit testing is indispensable and I didn't really care for that until then, I decided to deal with this subject. So I headed for Kent Beck's "Test-Driven Development: By Example" which I enjoyed reading a lot - but rather for its literacy and esprit than for its practical use.
While Kent Beck fully succeeds in whetting your appetite for unit testing, he does not really provide you with the how-tos (despite the patterns sections). After working through the book, I still don't know how to tackle unit testing in conjunction with refactoring in my everyday practice to produce the sort of "ad hoc design" he advocates (and which admittedly is very appealing). Kent Beck does not mention mock objects and contents himself with desktop application issues which further lessens his book's practical relevance.
Anyway, I'd like to further pursue this topic, willingly with the help of your book, should it suit my needs. So let me know: which approach takes "Pragmatic Unit Testing" to the practical issues of testing? Are there recipes how to make the most of unit testing? Do you care for more than just simple applications?
Any other recommendations from anyone?
Thanks in advance,
Manfred
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
I have asked the same issue with u, but the authors haven't replied to my post yet... Here is the link to that thread.
U might want to participate in that thread also...


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Dave Thomas
Author
Ranch Hand

Joined: May 01, 2001
Posts: 45
Originally posted by Manfred Mueller:
Anyway, I'd like to further pursue this topic, willingly with the help of your book, should it suit my needs. So let me know: which approach takes "Pragmatic Unit Testing" to the practical issues of testing? Are there recipes how to make the most of unit testing? Do you care for more than just simple applications?

Manfred:
First, many thanks for the kind words.
I'm not sure how to answer the question: I'd like to think it would suit your needs, but...
The book follows two threads. The first is a very practical one: it talks about how to write and run unit tests using JUnit. This is a fairly no-nonsense approach: it looks at the various APIs, describes you to use the various setup and teardown facilities, and how to integrate the tests with your code.
In parallel, it also discusses _what_ to test: how to know the the tests you're writing are being effective.
Throughout we take a pretty practical approach: not much theory, and a fair amount of experience.
Cheers

Dave


Dave Thomas <br />Author of "<a href="http://www.amazon.com/exec/obidos/ASIN/020161622X/ref=ase_electricporkchop/002-7467239-7061602" target="_blank" rel="nofollow">The Pragmatic Programmer: From Journeyman to Master</a>
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Manfred,
I want to encourage you to simply start testing those things you see how to test.
A complex program really isn't that different from a simple one when it comes to unit testing - at least the complexity shouldn't be that visible at the unit level but should emerge from the collaboration of many small simple units.
The same is true about Desktop-, Web- or whatever applications. The meat most often is in the business logic, and that should be mostly independent from the GUI (or persistence or...). Writing unit tests really doesn't differ that much for the most important parts of those applications.
There *are* some things that are dependend on the type of application when you want to unit test all parts of it. But you really can start to care about that when you have some experience with unit testing the "easy" parts.
Hope this helps...


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
Doug Wang
Ranch Hand

Joined: Oct 05, 2001
Posts: 445
Originally posted by Dave Thomas:

In parallel, it also discusses _what_ to test: how to know the the tests you're writing are being effective.

I will show more interests in your what to part, for I'd like to learn the experience in writing effective tests.
[ February 19, 2004: Message edited by: Doug Wang ]

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Test-Driven Development