# Posted Jim Weirich OSCON 2006 video presentation

**URL:** <https://www.ruby-forum.com/t/posted-jim-weirich-oscon-2006-video-presentation/84675>\
**Category:** Ruby\
**Created:** [February 6, 2007, 10:15pm UTC](https://www.ruby-forum.com/t/posted-jim-weirich-oscon-2006-video-presentation/84675 "2007-02-06T22:15:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diego\_Scataglini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3bc359/32.png) [@Diego\_Scataglini](https://www.ruby-forum.com/u/Diego_Scataglini)\
**Post date:** [February 6, 2007, 10:15pm UTC](https://www.ruby-forum.com/t/posted-jim-weirich-oscon-2006-video-presentation/84675/1 "2007-02-06T22:15:17Z")

</div>

For anybody interested, I posted the talk about Design By Contract in  
Ruby  
that Jim W. gave @ OSCON 2006 on my blog.

> **[Best Online Casino in Australia | Top Licensed Casinos for Gamblers](https://toponlinecasinoaustralia.com?anchor=jim_weirich_test_drivern_development)**
>
> Best Online Casino in Australia with licensed games only. Play blackjack, roulette, poker and other top-notch casino games. Enjoy gambling 24/7.

I have 3 or 4 more that I am in the process of uploading.  
I am waiting for a written release from some of the presenters 🙂 before  
I  
make them public.  
Last thing I need is to get sued 😃

Enjoy 😃

---

<div class="post-metadata">

**Author:** ![Diego\_Scataglini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3bc359/32.png) [@Diego\_Scataglini](https://www.ruby-forum.com/u/Diego_Scataglini)\
**Post date:** [February 7, 2007, 12:19am UTC](https://www.ruby-forum.com/t/posted-jim-weirich-oscon-2006-video-presentation/84675/2 "2007-02-07T00:19:31Z")

</div>

On Feb 6, 4:14 pm, “Diego Scataglini” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> For anybody interested, I posted the talk about Design By Contract in Ruby  
> that Jim W. gave @ OSCON 2006 on my blog.[Best Online Casino in Australia | Top Licensed Casinos for Gamblers](http://jroller.com/page/dscataglini/?anchor=jim_weirich_test_drivern_)…
> 
> I have 3 or 4 more that I am in the process of uploading.  
> I am waiting for a written release from some of the presenters 🙂 before I  
> make them public.  
> Last thing I need is to get sued 😃

Interesting presentation.

The more these test/specification/dbc system evolve the more they seem  
like double-entry bookkeeping. Aren’t we just writing the code twice  
but from two differnt perspectives and seeing if they match up?

T.

---

<div class="post-metadata">

**Author:** ![Diego\_Scataglini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3bc359/32.png) [@Diego\_Scataglini](https://www.ruby-forum.com/u/Diego_Scataglini)\
**Post date:** [February 7, 2007, 12:35am UTC](https://www.ruby-forum.com/t/posted-jim-weirich-oscon-2006-video-presentation/84675/3 "2007-02-07T00:35:32Z")

</div>

Trans wrote:

> The more these test/specification/dbc system evolve the more they seem  
> like double-entry bookkeeping. Aren’t we just writing the code twice  
> but from two differnt perspectives and seeing if they match up?  
> Mostly, yes. (Though usually the test is a drastic simplification for a  
> specific example.) Thrice if you do acceptance testing. Is that a bad  
> thing?

Devin

---

<div class="post-metadata">

**Author:** ![Diego\_Scataglini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3bc359/32.png) [@Diego\_Scataglini](https://www.ruby-forum.com/u/Diego_Scataglini)\
**Post date:** [February 7, 2007, 6:29am UTC](https://www.ruby-forum.com/t/posted-jim-weirich-oscon-2006-video-presentation/84675/4 "2007-02-07T06:29:51Z")

</div>

On Feb 6, 11:18 pm, “Diego Scataglini” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I believe one of the main differences is that DBC is more of a runtime  
> check.

Perhaps. But one of the first thing I thought when I saw Jim run it is  
where’s the “–debug”? I don’t see why you’d want this to happen in  
production.

T.

---

<div class="post-metadata">

**Author:** ![Diego\_Scataglini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3bc359/32.png) [@Diego\_Scataglini](https://www.ruby-forum.com/u/Diego_Scataglini)\
**Post date:** [February 7, 2007, 10:56am UTC](https://www.ruby-forum.com/t/posted-jim-weirich-oscon-2006-video-presentation/84675/5 "2007-02-07T10:56:16Z")

</div>

On 7 Feb 2007, at 05:28, Trans wrote:

> On Feb 6, 11:18 pm, “Diego Scataglini” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I believe one of the main differences is that DBC is more of a  
> > runtime  
> > check.
> 
> Perhaps. But one of the first thing I thought when I saw Jim run it is  
> where’s the “–debug”? I don’t see why you’d want this to happen in  
> production.

I’ve not watched the presentation, but with experience of other DBC  
systems I imagine the reason would be that contract violations can  
happen in production - and knowing about them is generally a good  
thing 🙂

Cheers,

Adrian

---

<div class="post-metadata">

**Author:** ![Diego\_Scataglini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3bc359/32.png) [@Diego\_Scataglini](https://www.ruby-forum.com/u/Diego_Scataglini)\
**Post date:** [February 8, 2007, 7:59pm UTC](https://www.ruby-forum.com/t/posted-jim-weirich-oscon-2006-video-presentation/84675/6 "2007-02-08T19:59:55Z")

</div>

On Feb 6, 2007, at 6:18 PM, Trans wrote:

> The more these test/specification/dbc system evolve the more they seem  
> like double-entry bookkeeping. Aren’t we just writing the code twice  
> but from two differnt perspectives and seeing if they match up?

Given that double-entry bookkeeping is often cited as one of the  
subtle advancements that led to global the dominance of the Western  
world, I’m not sure this is a bad thing.

But.

“Yes and no”. For a single piece of code, it’s generally a lot  
simpler to test that the code did the right thing than to write the  
functional code itself. If you add in edge cases, the problem  
multiplies: it’s a lot easier to write 10 individual test cases,  
each for one edge case, than to write one piece of functional code  
that elegantly (or even inelegantly) handles all the edge cases. As  
your app grows, this aspect grows by leaps and bounds.

I’ve been asked something along the lines of “well how do we know  
that the test code doesn’t have bugs in it?”. The answer is that we  
don’t. However, think of this as a probability problem. The  
following are gross oversimplifications, but should get the gist.

- If you have one test case per chunk of code, and that test case  
also has a 10% chance of being wrong, and if they’re wrong in exactly  
the same way, then you have an 81% chance that the code executes  
correctly and tests cleanly, an 18% chance that the test fails (9%  
false positive, 9% false negative), and a 1% chance that the test  
passes incorrectly. Since a failure will likely to look through your  
code until you either find what’s wrong in your code or your test,  
then you’ve just dramatically decreased the chance of an uncaught bug.

- As code increases the likelyhood of bug-free code decreases  
exponentially with the amount of code. However, since tests often  
must implicitly test things other than the specific thing they’re  
testing, the likelihood of bugs remaining uncaught also decreases at  
an exponential rate.

There are limits to all of this, and I do think that people are prone  
to putting too much faith in automated testing, but it still runs  
circles around a lack of it.

-faisal

---

<div class="post-metadata">

**Author:** ![Diego\_Scataglini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3bc359/32.png) [@Diego\_Scataglini](https://www.ruby-forum.com/u/Diego_Scataglini)\
**Post date:** [February 7, 2007, 5:19am UTC](https://www.ruby-forum.com/t/posted-jim-weirich-oscon-2006-video-presentation/84675/7 "2007-02-07T05:19:46Z")

</div>

I believe one of the main differences is that DBC is more of a runtime  
check.
