Forum: Ruby on Rails Test Driven Development - Book recommendations ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1a09a03a0f5091eb071f177a198f8506?d=identicon&s=25 Rails Nut (railsnut)
on 2005-12-01 13:16
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
Af95bdaf87958c40150b813e94381bfd?d=identicon&s=25 Christer Nilsson (christer)
on 2005-12-01 13:30
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
4d6a47158a7c8a032e5f6a4da8976d7d?d=identicon&s=25 erik (Guest)
on 2005-12-01 14:14
(Received via mailing list)
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
1a09a03a0f5091eb071f177a198f8506?d=identicon&s=25 Rails Nut (railsnut)
on 2005-12-01 15:48
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
4d6a47158a7c8a032e5f6a4da8976d7d?d=identicon&s=25 erik (Guest)
on 2005-12-01 15:56
(Received via mailing list)
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 Thomas 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 ;)

	Erik
6993d6b4b6d882f421e1b45ac147f3e0?d=identicon&s=25 scott (Guest)
on 2005-12-01 16:33
(Received via mailing list)
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 Barron
Lunchbox Software
http://lunchboxsoftware.com
http://lunchroom.lunchboxsoftware.com
http://rubyi.st
1a09a03a0f5091eb071f177a198f8506?d=identicon&s=25 Rails Nut (railsnut)
on 2005-12-01 16:48
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 Thomas 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 ;)
>
> 	Erik

ahhh ... I wasn't thinking Pragmatic Programmer when I typed 'PP'  :)

Andy
0091f92762685860109bbcb02edfdf27?d=identicon&s=25 arav2132 (Guest)
on 2005-12-01 22:02
(Received via mailing list)
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.
741a3b49ae2937c3d62e45d1699b674a?d=identicon&s=25 srbaker (Guest)
on 2005-12-01 22:51
(Received via mailing list)
> Can anyone recommend a book on test-driven development ?

Test-Drive Development: A Practical Guide, by Dave Astels.

> 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
2dd904ec5981c31e7bb7a5743a53caf8?d=identicon&s=25 Bruce Balmer (brucebalmer)
on 2005-12-02 02:10
(Received via mailing list)
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
7d3039b18b2d4db92a13937f09446c9c?d=identicon&s=25 rails_lists (Guest)
on 2005-12-02 02:34
(Received via mailing list)
-----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 Balmer wrote:

> behaviour).
>
> bruce
>
>
>
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> 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-----
E37ca8b3eee534fa6781f7ba13743afb?d=identicon&s=25 ryan.wood (Guest)
on 2005-12-02 03:02
(Received via mailing list)
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
42172acdf3c6046f84d644cb0b94642c?d=identicon&s=25 Pat Maddox (pergesu)
on 2005-12-02 03:02
(Received via mailing list)
This means that modelName inherits from the Base class inside the
ActiveRecord module.

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

Pat
This topic is locked and can not be replied to.