October 7, 2008
@ 10:56 PM

image

I want to invite any of you who are within a few hours of Des Moines, Iowa to attend the second Iowa Code Camp on November 8th.  The first Iowa Code Camp back in May was a huge success. From Derik's write-up:

Yesterdays event was awesome.  They had about 125-150 people show up for the first ever Code Camp in Iowa.  The venue could not have been any nicer and setup any better.

I will be giving one presentation on using RhinoMocks and one workshop on TDD.  Below are the abstracts.  If you have the chance, take part, and register today.

TDD: A Workshop in Driving Your Design with Tests

If you've heard about Test Driven Development (TDD) and wondered what it was or how to do it, then this workshop is for you.  We'll take a practical, introductory approach to getting started with TDD.  We'll introduce fundamental object-oriented design principles including separation of concerns, dependency injection/inversion, and more.  This will be a hands on lab, so bring your laptops and a copy of Visual Studio 2008 and expect to learn.

Easing your Testing With RhinoMocks

When learning about testing you'll see trivial examples illustrating how to write tests. However most production code is non-trivial, making calls to configuration files or to a database which makes testing in isolation hard.  The use of mock objects allows you to isolate code you want to test by providing fake objects to your methods, allowing you to set up complex scenarios to test specific conditions.  In this session we'll first dig into some code that is not very testable and refactor it to make it more testable.  After the refactoring we'll use and explore RhinoMocks to see how we can test different scenarios in our code and verify our code is working as it should.


 
Categories: Announcement | Community | CRIneta | Rhino Mocks | Testing

October 5, 2008
@ 08:18 PM

Yesterday Oren announced the release of RhinoMocks 3.5.  While the RC version has been out for a bit the RTM release fixes a few bugs.  You can read all about the enhancements and features in Oren's post

The feature that excites me the most about the new RhinoMocks release is the AAA Syntax (Arrange-Act-Assert).  One thing I've always struggled with when explaining mocking to people is the record replay model.  The new syntax seems to be more natural.  I have no empirical evidence to back that last statement up, only anecdotal evidence from observing fellow employees interact with the new syntax.

A close second in terms of changes is the deprecations of CreateMock().  In all the features, patches, improvements, and bug fixes this is the only item Oren bolded, which shows it's importance:

CreateMock() is deprecated and marked with the [Obsolete] attribute. Use StrictMock() instead.

This one is great for beginners who instinctively pick up the binaries and see the method CreateMock() and end up later with brittle tests.  Brad Abrams talks about the "Pit of Success" and quotes Rico Mariani:

The Pit of Success: in stark contrast to a summit, a peak, or a journey across a desert to find victory through many trials and surprises, we want our customers to simply fall into winning practices by using our platform and frameworks. To the extent that we make it easy to get into trouble we fail.

In earlier versions of Rhino it was too easy to use CreateMock() when DynamicMock() is what you wanted.  New mockers were often using the wrong method (I was one of these CreateMock() abusers/users).  The warning when using CreateMock, and the other enhancements/changes, make falling into the pit of success (with mocking) a much more likely reality.

You can download the bits from Oren's download area.  When you download, I would encourage you to make a donation to Oren's open source efforts.