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.
Rails N. (Guest)
on 2005-12-01 14: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
Christer N. (Guest)
on 2005-12-01 14: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
erik (Guest)
on 2005-12-01 15: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
Rails N. (Guest)
on 2005-12-01 16: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
erik (Guest)
on 2005-12-01 16: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 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 ;)

	Erik
scott (Guest)
on 2005-12-01 17: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 B.
Lunchbox Software
http://lunchboxsoftware.com
http://lunchroom.lunchboxsoftware.com
http://rubyi.st
Rails N. (Guest)
on 2005-12-01 17: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 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 ;)
>
> 	Erik

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

Andy
arav2132 (Guest)
on 2005-12-01 23: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.
srbaker (Guest)
on 2005-12-01 23:51
(Received via mailing list)
> 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
Bruce B. (Guest)
on 2005-12-02 03: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
rails_lists (Guest)
on 2005-12-02 03: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 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-----
ryan.wood (Guest)
on 2005-12-02 04: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
Pat M. (Guest)
on 2005-12-02 04: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.