Scott Hanselman

Hanselminutes Podcast 169 - The Art of Unit Testing with Roy Osherove

July 6, '09 Comments [12] Posted in NUnit | Open Source | Podcast | Tools
Sponsored By

ArtOfUnitTesting My one-hundred-and-sixty-ninth podcast is up. In this show recorded in Norway, Roy Osherove educates Scott on best practices in Unit Testing techniques and the Art of Unit Testing.

Also, be sure to check out Roy's talk at the recent Norwegian Developer's Conference, they're quite excellent and worth your time.

Roy's Publisher has given Hanselminutes listeners a code until August 1st, 2009 for 37% off. The code is "hansel37" and it's good at http://www.manning.com and takes the price to US$25.19. Oddly in other ironic news, the book is (tonight at least) $26.39 on Amazon. Go figure.

Links from the Show

Subscribe: Subscribe to Hanselminutes Subscribe to my Podcast in iTunes

Do also remember the complete archives are always up and they havePDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is a sponsor for this show!

Building quality software is never easy. It requires skills and imagination. We cannot promise to improve your skills, but when it comes to User Interface, we can provide the building blocks to take your application a step closer to your imagination. Explore the leading UI suites for ASP.NET and Windows Forms. Enjoy the versatility of our new-generation Reporting Tool. Dive into our online community. Visit www.telerik.com.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Monday, July 06, 2009 8:33:29 AM UTC
I am curious how you get PDF transcripts of your podcasts. Is it some tool you run over the podcast and then proof-read? (Hope its not manually done)

This tool if it exists will sure be of use to folks like me who can read faster than go thru podcasts and prefer reading transcripts...

Thanks!
Durga
Monday, July 06, 2009 10:25:22 AM UTC
@Durga : From what I've seen the transcripts appear after 3-4 other podcasts. I guess it takes time to transcript them.
Monday, July 06, 2009 10:33:05 AM UTC
This is an awesome book with real life examples. Every one should Go and get this.
Monday, July 06, 2009 4:51:49 PM UTC
The Transcripts are done by non-technical humans.
Tuesday, July 07, 2009 6:14:20 AM UTC
With regard to your question about how many "negative" test cases to write:

I like to think that the tests establish my contract for the thing I'm testing. If there's a test there, it's because some other code probably depends on the functionality working that way. If there's no test, it's because there's no guarantee about how the functionality will work (that behavior is "implementation dependent"). Over-specifying your conditions can make it harder to refactor your code later, which can lead to test maintenance nightmares. On the flipside, the presence of a test is a sign that people who are refactoring should tread lightly. It's OK to change the behavior, but they need to realize that their changes will have ramifications to other code.

Sometimes, negative test cases are very important. If you're writing a validator, you would want to know that it rejects bad input. You would also want to know that it accepts good input, so you're likely to have a large family of tests.

Also, I sometimes like to start with a simple test case, and sometimes the negative cases are easiest. To me, it feels like a progression from easy-to-understand (and easy-to-write) to more complicated and more corner-case-y.
Tuesday, July 07, 2009 12:54:10 PM UTC
FYI: If you order the book from Manning you will get a free e-book PDF version; if you order from Amazon you will get free shipping.

Net result:
Book + eBook from Manning = ~$30
book from Amazon = ~$25
Wednesday, July 08, 2009 3:53:22 PM UTC
yooder, every print book comes with a coupon inside it to download a free edition of the PDF version, so you *always* get the PDF, as long as you have an original print book.

Roy
Thursday, July 09, 2009 7:59:43 PM UTC
Awesome, awesome, awesome show guys!
Too bad it's so short, Scott I bet you could talk to Roy about TDD for hours.
However I learned that Roy has some great opinions about the topic and he's not too religious at the same time.

@RoyOsherove: I definitely gotta buy your book!
me
Thursday, August 13, 2009 1:32:29 AM UTC
I gone through all your posts.Its really unbelievable.Its very interesting and knowledgeable.Thanks for putting such things into it.Keep it up.
Sunday, August 23, 2009 11:26:26 PM UTC
Another interesting episode. Thanks.

I tried finding the webcasts you referred to of Roy examining the unit tests of various projects, but to no avail. There doesn't seem to be any reference to them on Roy's blog and they're not linked in the show notes.

Are they publicly available?

Nick
Thursday, September 03, 2009 5:49:06 AM UTC
Nick:
all the test reviews are available here
http://www.osherove.com/videos/category/test-review
Monday, March 08, 2010 10:27:06 AM UTC
Fantasy Faces is a family owned and operated business based in Calgary. We provide excellent quality and creative face painting for birthday parties, theme parties, dance performances, grand openings, promotions, community and/or corporate events. We specialize in face painting, our face painters are best in Calgary. Henna tattoos or mehndi art best in Calgary. Airbrush, nail art and glitter tattoos is a few more creative services we offer in Calgary.
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.