Monday, February 1, 2010

Unit Testing Quiz Part I

Here's a question anyone should be able to answer if they're to be considered proficient at unit testing:

Your client asks you to unit test the serialization/deserialization code for a data model class written by their in-house developers. Since the implementation of the class is sensitive information, you are expected to work without either source code or a description of the serialized form of the model. All you know is the public API of the model: properties and methods, contracts and invariants. The client assures you that the serialized models will only be used by the given code, and do not need to be readable by any other application or implementation. If the class has the methods serialize() and deserialize(), for serializing and deserializing the model respectively, describe how you would write unit tests to test these two functions despite the given constraints.


If I remember I'll post the answer later.

Tuesday, January 12, 2010

Singletonitis

Proposition A: proper OO design exploits polymorphism.

Proposition B: singleton inhibit polymorphism.

A & B imply Proposition C: proper OO design excludes singletons (in most cases).

Friday, December 18, 2009

Tree Etiquette

Dear Developers (I'm looking at you, Eclipse!),

When you have an expandable tree UI, always remember to include a "collapse all" button. Thanks!

Love and Kisses,
Phil

Tuesday, November 10, 2009

D'oh!

Always remember - if you update your path in Windows, you have to restart Eclipse before Eclipse Ant will see the change. ARGH! This cost me 2 hours!

Unit Testing Anti-Patterns

This is a presentation I gave recently about Unit Testing Anti-Patterns. The material is fairly basic, but you'd be surprised at how many professional developers are addicted to very bad practices writing unit tests, and are generally unfamiliar with the basic principles in this presentation.

Unit Testing Anti-Patterns (PDF)

Monday, November 9, 2009

Favorite Lines from the Latest Art Brut Album, "Art Brut vs. Satan".

"I can't believe I've only just discovered the Replacements" - "The Replacements"

"How can we sleep at night when no one likes the records we like?" - "Demons Out!"

Tuesday, October 20, 2009

12XU?

Strangely enough, a band named Sub Debs recorded a song named "12XU" in 1999, that is not at all the Wire song.