Jeremy D. Miller -- The Shade Tree Developer

Sponsors

The Lounge

Syndication

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
If...

you write a fairly complicated integration test to exercise some the interplay between different classes and some brand new DSL code...

and the test passes on the first try...

is the explanation:

 

A) You're damn good.  Clean design.  Good unit tests.  Master of the programming universe is you.

or.....

B) Your test is wrong!

 

While you, dear reader, ponder this question I shall now proceed to double check my test code.


Posted Tue, Oct 14 2008 3:02 PM by Jeremy D. Miller

[Advertisement]

Comments

Chauncey Smith wrote re: If...
on Tue, Oct 14 2008 3:16 PM

My test is usually Wrong.

Jarrod wrote re: If...
on Tue, Oct 14 2008 3:28 PM

Red, Green, Refactor

If your test never goes red, then you may have written a test that can never fail.

Felipe Lopes wrote re: If...
on Tue, Oct 14 2008 3:52 PM

Yes, master!

Kidding.

Rob wrote re: If...
on Tue, Oct 14 2008 3:58 PM

c) You're still confused about how to use Rhino.Mocks AAA syntax ;)

Jeremy D. Miller wrote re: If...
on Tue, Oct 14 2008 4:01 PM

@Rob,

We've had a couple "Come to Jesus" meetings already about how we're going to use Rhino Mocks going forward (classic mode or the new AAA, and how does that AAA thing work exactly?).  I'm lukewarm on the whole AAA thing.

Randolpho wrote re: If...
on Tue, Oct 14 2008 4:01 PM

That is the age old question:

Who tests the test?

Justice~! wrote re: If...
on Tue, Oct 14 2008 4:04 PM

Maybe for poor schlubs the answer is b) but when you are a master of your domain like myself (get it?  master of your domain?  DSL?  See what I did there?) a) is the only true way.  

Jeremy D. Miller wrote re: If...
on Tue, Oct 14 2008 4:11 PM

@Randolpho,

I'll give you my automatic comeback to that one:  "Pay attention to what you're doing"

Randolpho wrote re: If...
on Tue, Oct 14 2008 4:46 PM

But if you pay attention to what you're doing, do you really need tests? :-D

Anyway, I was more paraphrasing "Who watches the Watchmen?" than I was attempting to take a stab at unit testing or TDD.

Adron wrote re: If...
on Tue, Oct 14 2008 5:43 PM

The first test is supposed to fail, then you go and make it green.

Red-Green-Refactor    ->  it's right over there on the right side of your site.  :)

Jeremy D. Miller wrote re: If...
on Tue, Oct 14 2008 5:49 PM

Adron-->

It was an INTEGRATION test -- like the blog post states rather clearly.  As in, all the individual classes had been dev'd in a TDD manner first.

Erik wrote re: If...
on Tue, Oct 14 2008 6:29 PM

en.wikipedia.org/.../Occam's_Razor - that is all.

Ayende Rahien wrote re: If...
on Tue, Oct 14 2008 9:21 PM

I remember having this exact issue with Rhino Mocks about 2.5 years back, I couldn't believe that the test would pass and spent several hours debugging that.

Spooky

Jeremy D. Miller wrote re: If...
on Tue, Oct 14 2008 10:00 PM

@Ayende,

The one that's really scaring me at work is our new Rules engine / Rules DSL.  We unit tested the hell out of all the little bitty parts, but we've literally gone 500 integrated tests w/o finding a bug.  Lots of false negatives, but no bugs.

Nobody on the team actually believes that we're 100% bug free.  Just wondering about what we're missing.

Re: If… (Time is the ultimate YouTube Audio Preview Moderator) « Chris Chew’s Weblog wrote Re: If… (Time is the ultimate YouTube Audio Preview Moderator) « Chris Chew’s Weblog
on Tue, Oct 14 2008 11:56 PM

Pingback from  Re: If… (Time is the ultimate YouTube Audio Preview Moderator) « Chris Chew’s Weblog

Ayende Rahien wrote re: If...
on Wed, Oct 15 2008 3:03 AM

For a long time, I actually believed that Rhino Mocks _was_ bug free.

And it was, for the set of scenarios that I used it for.

The bugs that were found usually had to do with:

- Using the API with the wrong order or method calls

- Using the API with nasty CLR features such as COM interop, generics, out parameters and such.

A language tends to be very simple to build. You'll see the pain for real when you give it to someone who isn't aware of the underlying assumptions that you don't realize that you made.

Reflective Perspective - Chris Alcock » The Morning Brew #201 wrote Reflective Perspective - Chris Alcock » The Morning Brew #201
on Wed, Oct 15 2008 4:38 AM

Pingback from  Reflective Perspective - Chris Alcock  » The Morning Brew #201

Ganesh wrote re: If...
on Wed, Oct 15 2008 9:44 AM

IMHO if anything works fine at the very first step, it is bound to fail very fast as well

Ian Cooper wrote re: If...
on Wed, Oct 15 2008 1:43 PM

@Jeremy

Do you have any QA guys. I just ask because there mind set is different, They test for failure whereas devs test for success. it's an advantage of getting them to author acceptance tests or do explotatory testing.

Although I sometimes wonder why anyone in their right mind would do what some testers do to break the product.

Jeremy D. Miller wrote re: If...
on Wed, Oct 15 2008 7:19 PM

@Ian,

Testers, what are those?  Basically, I wasn't able to recruit the one and only tester I trust in Austin, so we decided to go dev-only.  The obvious drawback is making ourselves do adequate exploratory testing.  The upside is a better test automation story.

Lucas Goodwin wrote re: If...
on Thu, Oct 16 2008 8:42 PM

I run into this from time to time (tests succeeding out of the gate).

I've found more often then not that the integration test is testing a scenario that's already being addiquately covered by unit tests on the underlying parts.

Or I wrote the test in a way that used my assumptions to my advantage that basically insured it was testing a known good scenario.

btw, this form is broken in IE7 today (Javascript errors)

Websites tagged "tester" on Postsaver wrote Websites tagged "tester" on Postsaver
on Sat, Dec 27 2008 7:32 PM

Pingback from  Websites tagged "tester" on Postsaver

Add a Comment

(required)  
(optional)
(required)  
Remember Me?