[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Why Unit Testing sucks

Gavin Kistner

2/16/2007 4:11:00 PM

A woman says to her Ruby programmer friend:

"As I was going to St. Ives,
I met a man with seven wives.
Each wife had seven sacks,
each sack had seven cats,
each cat had seven kits.
Kits, cats, sacks, wives:
how many were going to St. Ives?"

The programmer says:
"Hrm.
irb> (1..(%w|kits cats sacks wives|).length).inject(0){ |s,n| s +
7**n }
=> 2800

Er, wait, should the man with the wives be included in the count?
Maybe 2795."

"What?" says the woman. "No, the answer is one...you can only be sure
that the person telling the story was going to St. Ives. The man and
his wifes-with-cats posse might not have been going there."

The programmer chuckles.

....

At the next local Ruby users group meeting, the programmer decides to
tell the joke. He announces to the group:

"I have a joke. Er, wait, let me make sure I get this right...

require 'test/unit'

class Foo < Test::Unit::TestCase
def test_answer
answer = tell_joke
assert_equal( 1, answer )
end
end

Uhm...wait. Let me start over.
"

Everyone just sort of looks at him with pity.

Unit testing gives away the punchline!

:)

12 Answers

Gavin Kistner

2/16/2007 4:14:00 PM

0

On Feb 16, 9:10 am, "Phrogz" <g...@refinery.com> wrote:
> irb> (1..(%w|kits cats sacks wives|).length).inject(0){ |s,n| s +
> 7**n }
> => 2800
>
> Er, wait, should the man with the wives be included in the count?
> Maybe 2795."

Er...That 2795 should have read 2801. Oops.

Eric Hodel

2/16/2007 7:09:00 PM

0

On Feb 16, 2007, at 08:15, Phrogz wrote:

> A woman says to her Ruby programmer friend:
>
> [...]
>
> Unit testing gives away the punchline!
>
> :)

I believe there are two lessons in your story:

You shouldn't write any code without knowing what you're doing.

You shouldn't write any code without knowing when you'll be done.




Stephan Kämper

2/17/2007 9:37:00 AM

0

Eric Hodel wrote:
> On Feb 16, 2007, at 08:15, Phrogz wrote:
>
>> A woman says to her Ruby programmer friend:
>>
>> [...]
>>
>> Unit testing gives away the punchline!
>>
>> :)
>
> I believe there are two lessons in your story:
>
> You shouldn't write any code without knowing what you're doing.
>
> You shouldn't write any code without knowing when you'll be done.

Corollary 1:

Although some code is a joke - some times even a WTF (also see
thedailywtf.com) - not all jokes can be used as code.

:-)

Stephan

Robert Dober

2/18/2007 7:20:00 PM

0

On 2/17/07, Stephan Kämper <sigma.kappa@stephankaemper.de> wrote:
> Eric Hodel wrote:
> > On Feb 16, 2007, at 08:15, Phrogz wrote:
> >
> >> A woman says to her Ruby programmer friend:
> >>
> >> [...]
> >>
> >> Unit testing gives away the punchline!
> >>
> >> :)
> >
> > I believe there are two lessons in your story:
> >
> > You shouldn't write any code without knowing what you're doing.
> >
> > You shouldn't write any code without knowing when you'll be done.
>
> Corollary 1:
>
> Although some code is a joke - some times even a WTF (also see
> thedailywtf.com) - not all jokes can be used as code.
>
> :-)
>
> Stephan
>
>
Are jokes Turing complete?

Robert
--
We have not succeeded in answering all of our questions.
In fact, in some ways, we are more confused than ever.
But we feel we are confused on a higher level and about more important things.
-Anonymous

Ryan Davis

2/19/2007 2:12:00 AM

0


On Feb 18, 2007, at 11:20 AM, Robert Dober wrote:

> Are jokes Turing complete?

No. And nerd-humor is NEVER funny.


Ryan Davis

2/19/2007 6:06:00 AM

0


On Feb 18, 2007, at 9:02 PM, Albert Ng wrote:

> But that's not the point, is it?

It isn't?? Tell me, exactly what _was_ the point?

> On 2/18/07, Ryan Davis <ryand-ruby@zenspider.com> wrote:
>>
>>
>> On Feb 18, 2007, at 11:20 AM, Robert Dober wrote:
>>
>> > Are jokes Turing complete?
>>
>> No. And nerd-humor is NEVER funny.


Martin DeMello

2/19/2007 12:02:00 PM

0

On 2/19/07, Ryan Davis <ryand-ruby@zenspider.com> wrote:
>
> On Feb 18, 2007, at 11:20 AM, Robert Dober wrote:
>
> > Are jokes Turing complete?
>
> No. And nerd-humor is NEVER funny.

It is to us nerds (:

m.

SonOfLilit

2/19/2007 2:09:00 PM

0

Yes, e.g. Brainfuck.

On 2/18/07, Robert Dober <robert.dober@gmail.com> wrote:
> On 2/17/07, Stephan Kämper <sigma.kappa@stephankaemper.de> wrote:
> > Eric Hodel wrote:
> > > On Feb 16, 2007, at 08:15, Phrogz wrote:
> > >
> > >> A woman says to her Ruby programmer friend:
> > >>
> > >> [...]
> > >>
> > >> Unit testing gives away the punchline!
> > >>
> > >> :)
> > >
> > > I believe there are two lessons in your story:
> > >
> > > You shouldn't write any code without knowing what you're doing.
> > >
> > > You shouldn't write any code without knowing when you'll be done.
> >
> > Corollary 1:
> >
> > Although some code is a joke - some times even a WTF (also see
> > thedailywtf.com) - not all jokes can be used as code.
> >
> > :-)
> >
> > Stephan
> >
> >
> Are jokes Turing complete?
>
> Robert
> --
> We have not succeeded in answering all of our questions.
> In fact, in some ways, we are more confused than ever.
> But we feel we are confused on a higher level and about more important things.
> -Anonymous
>
>

John Smith

9/16/2010 9:19:00 PM

0

On 9/16/2010 2:07 PM, Kevin Cunningham wrote:

>...
> Sounds just like the last meeting of the White Citizens Council. This
> is what the tea baggers want, they would love to return to the days
> when the white man ran this country and then that commie Dr. King came
> along. Now for the love of mercy, we have an African-American
> president! And he wants to stop our war machine! What the heck
> happened?
>
> It was so much better when women were chained to their beds.......

Dude, you have bad mental problems. You might be a danger to yourself
and/or others. You need to get with a shrink and work on this ...

With only your best interest at heart,
JS

Brenda Ann

9/16/2010 9:26:00 PM

0


"John Smith" <assemblywizard@gmail.com> wrote in message
news:i6u1kj$1id$3@news.eternal-september.org...
> On 9/16/2010 2:07 PM, Kevin Cunningham wrote:
>
>>...
>> Sounds just like the last meeting of the White Citizens Council. This
>> is what the tea baggers want, they would love to return to the days
>> when the white man ran this country and then that commie Dr. King came
>> along. Now for the love of mercy, we have an African-American
>> president! And he wants to stop our war machine! What the heck
>> happened?
>>
>> It was so much better when women were chained to their beds.......
>
> Dude, you have bad mental problems. You might be a danger to yourself
> and/or others. You need to get with a shrink and work on this ...
>
> With only your best interest at heart,
> JS

Don't know about you... but I see a tongue firmly embedded in cheek when I
read that post..