Scott Hanselman

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

July 06, 2009 Comment on this post [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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service
July 06, 2009 12:33
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!
July 06, 2009 14:25
@Durga : From what I've seen the transcripts appear after 3-4 other podcasts. I guess it takes time to transcript them.
July 06, 2009 14:33
This is an awesome book with real life examples. Every one should Go and get this.
July 06, 2009 20:51
The Transcripts are done by non-technical humans.
July 07, 2009 10:14
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.
July 07, 2009 16:54
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
July 08, 2009 19:53
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
July 09, 2009 23:59
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
August 13, 2009 5:32
I gone through all your posts.Its really unbelievable.Its very interesting and knowledgeable.Thanks for putting such things into it.Keep it up.
August 24, 2009 3:26
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
September 03, 2009 9:49
Nick:
all the test reviews are available here
http://www.osherove.com/videos/category/test-review
March 08, 2010 14:27
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.