Test Driven Development - Book recommendations?


#1

Can anyone recommend a book on test-driven development ?

Suspect a book with Rails specifics is a bit of a pipe-dream at the
moment, but anything you’ve found particularly applicable in a Rails
environment would be useful.

BTW … I’m assuming TDD is the way to go with Rails … but any
thoughts or observations anyone has on the topic (pro or con) would be
welcome …

Cheers, Andy


#2

Kent Beck: Test-Driven Development is very good. Java and Python.

and study rubyonrails code, for example this
http://rforum.andreas-s.net/trac/browser/trunk/test/

cheers
Christer


#3

Kent Beck’s “Test Driven Development” is fantastic, as well as his
eXtreme Programming Explained book. Of course Pragmatic Unit Testing
by Hunt/Thomas is a winner as well.

Erik

#4

Hmmm … is the Pragamtic book applicable to RoR ? It looks to me like
it might be specific to Java.

BTW, Erik, did you work for ‘PP’ in the past ?

Andy

erik wrote:

Kent Beck’s “Test Driven Development” is fantastic, as well as his
eXtreme Programming Explained book. Of course Pragmatic Unit Testing
by Hunt/Thomas is a winner as well.

Erik


#5

On Dec 1, 2005, at 9:48 AM, rails nut wrote:

Hmmm … is the Pragamtic book applicable to RoR ? It looks to me like
it might be specific to Java.

There are Java and C# versions of this book available, which sort of
indicates
how language neutral it really is. I bought the C# book and found that
only
a small portion of the book is specific to the platform it covers (e.g.
using NUnit).
Sure the code samples will be in C#/Java, but they’re just samples.
The most
valuable material is in the text. It is worth the read even if you’ll
never
touch C#/Java (and here’s hoping you won’t!).


Scott B.
Lunchbox Software
http://lunchboxsoftware.com
http://lunchroom.lunchboxsoftware.com
http://rubyi.st


#6

erik wrote:

On 1 Dec 2005, at 09:48, rails nut wrote:

BTW, Erik, did you work for ‘PP’ in the past ?

No, not in the past. Though I am a pragmatic programmer, and was
floored the first time I read the book by the same name. A couple of
years later I sat down at a table beside Dave T. to speak on an
expert panel at a No Fluff Just Stuff symposium. He’s been a friend
ever since.

One of these days soon I’ll work for ‘PP’ though :wink:

Erik

ahhh … I wasn’t thinking Pragmatic Programmer when I typed ‘PP’ :slight_smile:

Andy


#7

While you’re waiting for your Amazon parcel, you can look at those
articles:
http://www.xprogramming.com/xpmag/refactoringisntrework.htm
http://www.xprogramming.com/xpmag/recordmap.htm

Alain R.


#8

On 1 Dec 2005, at 09:48, rails nut wrote:

Hmmm … is the Pragamtic book applicable to RoR ? It looks to me like
it might be specific to Java.

True… but the same techniques and, most importantly, philosophy
apply. You’ll just have to type less curly brackets when switching
to Ruby. The Beck book has Python in it, so its getting warmer
language-wise. The Pickaxe book has coverage of unit testing in
Ruby. So, Beck for the philosophy and some specifics, Pragmatic Unit
Testing for the quick how-to, and Pickaxe for the translation to Ruby.

BTW, Erik, did you work for ‘PP’ in the past ?

No, not in the past. Though I am a pragmatic programmer, and was
floored the first time I read the book by the same name. A couple of
years later I sat down at a table beside Dave T. to speak on an
expert panel at a No Fluff Just Stuff symposium. He’s been a friend
ever since.

One of these days soon I’ll work for ‘PP’ though :wink:

Erik

#9

at the top of my models I have

modelName < ActiveRecord::Base

I understand the “<” but what is this “::” and “Base.”

It has started to drive me bonkers every time I see it. (for those
of you who don’t like character deficient personalities, I shall
rephrase "I drive myself bonkers every time I see it using it as the
stimulus to my going bonkers pattern that I have installed as a
behaviour).

bruce


#10

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bruce,

That’s a (from Pickaxe) “scope resolution” operator. It says
‘ActiveRecord’ is the namespace and ‘Base’ is the (in this case)
class within that namespace.

  • –Jeff

On Dec 1, 2005, at 5:06 PM, Bruce B. wrote:

behaviour).

bruce


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFDj6RIG9xIoXK+giARAtrgAKCWrLKyO7F3+fo2j6CeQ3+nJRK/4QCcDRAf
C/xlNRiPcMmu1PBhr/0gXhA=
=KY5G
-----END PGP SIGNATURE-----


#11

Can anyone recommend a book on test-driven development ?

Test-Drive Development: A Practical Guide, by Dave A…

Suspect a book with Rails specifics is a bit of a pipe-dream at the
moment, but anything you’ve found particularly applicable in a Rails
environment would be useful.

There aren’t any yet. But I’m giving a work shop that will cover
Test-Driven Development of Rails apps in the new year. See
http://www.canadaonrails.com/ for more information.

BTW … I’m assuming TDD is the way to go with Rails … but any
thoughts or observations anyone has on the topic (pro or con) would be
welcome …

Yes it is the way to go. When you stop using your web browser for
development, you stop wasting time tweaking little visual bits that
are the job of the designer. It’s nice to get rid of the
code->browser->refresh context switch. And manual testing is so
1970s.

-Steven


#12

Base is the name of the class and it resides in the ActiveRecord
module. It’s similar to a namespace in Java or.NET, but modules offer
other functionality as well. Hope this helps.

–Ryan


#13

This means that modelName inherits from the Base class inside the
ActiveRecord module.

:: is the scope operator
Base is the class name.

Pat