Why Unit Testing sucks

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.

(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!

:slight_smile:

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

···

On Feb 16, 9:10 am, "Phrogz" <g...@refinery.com> wrote:

> (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."

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.

···

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

A woman says to her Ruby programmer friend:

[...]

Unit testing gives away the punchline!

:slight_smile:

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!

:slight_smile:

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.

:slight_smile:

Stephan

Are jokes Turing complete?

Robert

···

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!
>>
>> :slight_smile:
>
> 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.

:slight_smile:

Stephan

--
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

No. And nerd-humor is NEVER funny.

···

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

Are jokes Turing complete?

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!
> >>
> >> :slight_smile:
> >
> > 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.
>
> :slight_smile:
>
> 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

But that's not the point, is it?

···

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.

It is to us nerds (:

m.

···

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.

But that's not the point, is it?

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

···

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

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.