Philly Code Camp Autumn 2010: That’s a Wrap!

Unit Testing Patterns and Anti-Patterns_Delivery

This past weekend I had the pleasure of having been invited to speak at the Autumn Edition of the Philadelphia CodeCampBrian Donohue, who organizes the Philadelphia ALT.NET User Group asked me to come and deliver one of my talks for the ALT.NET track.  This continues a nice (and growing) tradition of the NYC-area events and the Philadelphia-area events collaborating to exchange speakers, event-planning experiences, fund-raising techniques, and other elements necessary to deliver a top-notch CodeCamp experience for attendees.

Philly CodeCamp is Crazy Big!

For those that haven’t had the opportunity to attend one of the Philly CodeCamp events, let me set the stage for you with some (semi-)random metrics…

  • 475+ Attendees
  • 60 Sessions
  • 13 Tracks
  • $1000+ raised for a local Charity

Easily the largest CodeCamp event I have had the opportunity to attend, Philly CodeCamp is certainly among the largest of the .NET Community-oriented events that don’t come with a mandatory attendance fee.  As such, there’s almost guaranteed to be something for everyone at just about every level.

This year saw talks ranging from an Introduction to Visual Studio Lightswitch (no, I didn’t deliver that one 🙂 ) to talks on the Rx (Reactive) Extensions framework.  And because the Philly CodeCamp is held at DeVry’s technical training center just north of Philadelphia, there was even room for Philly.NET’s perennial favorite, the day-long “Beginner Track” that featured “Intro to .NET for MainFrame Programmers” this year.  I wish I had more time to attend more sessions because I would have absolutely loved to have been a fly on the wall during that one!

Either way, at least as far as size/capacity, fund-raising ability, and hardcore organizing skill I consider the Philly CodeCamp to be the “Gold Standard” when it comes to looking for an event to emulate in re: their planning and logistics.  For the NYC CodeCamp we don’t have the luxury of a space the size of the DeVry campus to hold our events so we cannot really aspire to ever be that large in re: capacity, but the level of sheer organizing skill that goes into their delivering the Philly CodeCamp twice a year is certainly something against which all CodeCamp organizers should measure their own events.

I’m sure that just as with all such events, 100s of things probably went wrong during the day’s activities but the fact that neither the speakers nor the attendees were any the wiser about any of them means that the event was a great success!

Unit Testing Patterns and Anti-Patterns

For this CodeCamp, I delivered a new talk called Unit Testing Patterns and Anti-Patterns. That’s me delivering the session in that photo above that fellow CodeCamp speaker Jess Chadwick was kind enough to post to Twitter for folks to see (and for me to download and use here in this post!).  I’ve no idea what the capacity was of the room we were in, but its was completely packed – not an empty seat in the house.  My guess is that the session was probably attended by between 60-75 people.  Its humbling to draw that kind of a crowd for a CodeCamp session and encouraging to me that it was for one about best-practices rather than any specific ‘hot’ technology.  This confirms my unofficial observation that more and more people in .NET are at least understanding of the value proposition for doing unit tests now and that the next hurdle isn’t about acceptance of the concept but is instead about teaching effective techniques when doing so.

As with just-about any first-time-delivered talk, my hopes for it exceeded the time allotted and I was only able to get through about 1/3 of the material I had hoped to cover.  This was partly due to this being a new talk for which I’ve not entirely hashed out the proper balance of concepts and code, but also due to the particular approach I took with this talk to try to actively engage the audience rather than have them only be passive spectators.

The presentation began with a series of about 10 slides, each one showing a different category of aspects of unit testing for which there have evolved clear patterns and anti-patterns (e.g., Speedy Tests, Code Repetition, Data-dependent Tests, Over-specification, etc.) .  My goal was to have the audience provide me (verbally) with one or two examples of the anti-patterns for each of the categories.  I would then take them through a code sample that contained several of these anti-patterns which I would subsequently refactor to remove the anti-pattern by introducing one or more of the patterns.

Timing, Timing,Timing!

Partly because of the number of categories I wanted to cover and partly because asking the audience to throw out ideas takes much longer than just presenting them outright, it took us about 50 minutes out of the 80 minute session period to get through the slides, leaving a bit less than 30 minutes remaining to take a look at the code.  And then, because in order to demonstrate most of the patterns and anti-patterns requires at least a moderately complex project that the audience can be made to understand, I had to spend time walking the room through at least the basics of the solution to which the tests were applied before we could take a meaningful look at the existing tests.

I could feel the minutes slip away as we began to dig into the first several tests.  Then I asked the audience to provide me some ideas about where the existing tests might have anti-patterns that could be rewritten to employ some patterns.  Another problem of increasing audience participation – and more time slipped away from me as I realized that we were waaaay behind where I’d expected to be by that time the session!

In the end, we covered only perhaps 1/4 to 1/3 of the code I’d wanted to look at and the patterns (and anti-patterns) that I’d wanted to demonstrate in the session 🙁

Audience Value is All That Really Matters

Despite my time troubles, I received near-universal positive feedback from the session.  Although actual (scoring) reviews aren’t yet in from all attendees, I had quite a number of people approach me afterwards and comment about how much value they got out of the talk.  This kind of feedback can be deceiving however since its a sort of self-selecting sampling: I’m skeptical that those that hated the session would bother to seek me out afterwards with “that was the worst session I’ve ever attended – what a colossal waste of my time; you suck!” so it remains to be seen whether others also found the content to be useful.  I’m quite curious how the reviews will come in for this one.

If the final reviews are in fact generally positive, I suspect that there are several reasons for this:

  • I’m the only one that knows that I didn’t get through the whole presentation so the fact that I ran out of time probably wasn’t that obvious to attendees 🙂
  • I think my technique for engaging the audience, while time-consuming, went over really well and helped to foster a sense of a discussion rather than a lecture
  • By running through every slide first (vs. showing a slide, jumping to code, returning and showing another slide, then jumping back to code) we were able to cover (at least verbally) all of the anti-patterns and have at least some discussion of some possible corrective patterns for each of them.  This meant that even though we were able to spend only a short period of time actually in code, we still at least discussed everything I wanted to cover which may have made the talk seem less aborted than it actually was.

In the end, whether I covered everything in code that I had wanted or not, the only real measure of success in such a talk is whether the audience felt the time spent there was worth their while.  Hopefully once the reviews are in I will see that this was the case in this presentation.

But if I deliver this again, I think I need to carefully rethink how to do so (effectively) within the constrained time-limit of a 75-80 minute session.  Another thought also might be to perhaps shelve this talk until a half-day or full-day workshop venue presents itself so that the content I want to be able to cover can be delivered in a format that would permit the deeper exploration of the topics that I wanted to get to.

Slides and Code Samples

The slides for this talk can be found here and the code samples can be downloaded here.  As a word of warning, the code samples now contain only the ‘before’ tests with some of the anti-patterns present.  I haven’t had time (yet) to adjust this code to show the ‘after’ state where the patterns have been applied.  Hopefully that will come in the next few days after I get a moment to catch my breath a bit – look for another post on my blog once that’s completed.

In the mean time enjoy the slides and the samples and Happy Coding~!