This is the Object that goes Bing!

The point: In Behavior Driven Development it is the behavior of the object you develop and not ‘What It Is-ness’. I usually try first to visualize what an Object is as a Structural distinction and then attach behavior to it. This is my ‘blind spot’ a type of bias in constructing Objects. I look at ‘what it is’ -ness of the Object.. Well, something to think about this week at work.

This point is what I got in a short conversation with Bret Pettichord when I kept insisting that we need ‘RadioGroup’ type of object in Watir that tells you which radio in a collection is set. I immediately jumped into thinking of RadioGroup as a collection of Radio Objects and I think he said; OK so RadioGroup is an object but I kept thinking, well, yes, an object but which Radio in it is set and then I finally got the point (I think) which was RadioGroup is an Object, an invented Object - I was stuck with my bias for calling it Structurally what IT IS, rather then just saying, well, there is this Object and we can ask it what is it’s value at the behavior level rather than looking at structural implementation to see what value inside of it is set. This was a big opener for me.

This is why I think I am clueless sometimes how to create new Objects because I first try to visualize them as Structures. In Ruby I can now start thinking about ‘do I have an object that behaves this way?’ and if I don’t have that behavior I can maybe construct a new Object with that behavior.

In a moment of silliness I was reminded of the Monty Python’s ‘This is the machine that goes bing’ hospital sketch from Monty Python. You got to see it. - yes, the machine goes bing! because that’s the behavior it has and what the machine is; well, is irrelevant. The Bing! is what matters. The machine is known for its behavior… In that joke I think Monty Python invented BDD, looking at Objects as behavior providers and our relationship to them as behavior consumers.

Could it be that this is that important point in Ruby about duck typing, the one about if it walks and quacks, and we don’t care what it is… It might be a duck but it’s not as relevant as the fact that it quacks.

This is the Object that goes quack! - that is my new motto for BDD, the Monty Ruby style!