exortech.com

Peripatetic thinking

Agile Vancouver Tech Talk #2 - TDD vs BDD

March14

Last Monday night, Skye and I hosted the second Agile Vancouver tech talk. This month’s topic was test-driven development (TDD) vs. behaviour-driven development (BDD). The goal of the session was to give participants some hands-on experience with TDD and a bit of exposure to BDD. Participants were encouraged to bring laptops to the session if they had them or pair/partner up with others if they didn’t.

About 50 participants showed up for the session. Most people worked in Java using JUnit (with one pair using TestNG), another handful used C# (using NUnit) and one group worked in Perl and Python. I wrote my tests using JBehave and showed my solution on the projector to give beginners a bit of a jump start.

For the problem, I built some scenarios from my weekend’s trip to the grocery store. Participants were encouraged to write a solution for calculating the total of a shopping receipt from a list of items. I presented the following 10 scenarios:

  1. 1 x EnviroKidz Waffles - $3.79
  2. 2 x Unsalted Rice Cakes - $2.99
  3. 1.16kg Broccoli @ 2.82/kg
  4. 1 x Happy Planet Strawberry Banana Juice - $3.50 + $0.20 Deposit +
    $0.03 Enviro fee
    • 1. 1 x EnviroKidz Waffles - $3.79
    • 2 x Unsalted Rice Cakes - $2.99
    • 1.16kg Broccoli @ 2.82/kg
  5. Same as 5. but with a $0.05 No plastic bag discount
  6. 2 x Amy’s Organic Soup - $2.99 / $2.79 for Club members (Club #000104991)
  7. Calculate frequent shopper points for previous order, where new points = floor(total * 3)
  8. Calculate new total of frequent shopper points for the previous scenario. Customer Club #000104991 currently has 933 points.
  9. Non-groceries have 5% GST applied. Calculate the total for:
    • 1 x EnviroKidz Waffles - $3.79
    • 1 x Economist - $7.50

We spent an hour working on coding up the scenarios, where most participants made it up to scenario #5. This was followed by 30 minutes of discussion where participants presented their code. The most interesting solution IMO was produced by the Perl group who wrote a simple Regex parser for the items and started implementing a wiki-style DSL for specifying test scenarios.

On the whole, I think that the session went quite well, and most participants enjoyed having the opportunity to sit down and directly try out TDD. I think that we will try to do more hands-on sessions for subsequent tech-talk gatherings, potentially building on what we worked on in this session.

If you attended Monday night’s session and would like to post your solution to the scenarios, please feel free to leave a comment on this post linking to your code. I intend to post my solution for these scenarios at some point soon.

posted under agile | No Comments »

Exxon Valdez: Where’s the justice?

March13

18 years later and Exxon Mobil is still in court appealing payment for damages caused by the Valdez oil spill. It’s one of the longest running US court cases ever, and the inhabitants of the towns affected by the spill have yet to receive compensation. The only people getting richer are Exxon and the lawyers. With 18 years separating the disaster and a resolution, any compensation would be so disconnected from the actual event as to be an almost meaningless windfall. As one of the town’s inhabitants says: ” I’d rather have had a few dollars in my pocket all my life, than have a heap of money just as I’m about to check into the old folks’ home.” Where’s the justice in that?

Beyond ThoughtWorks

March13

I had my last day at ThoughtWorks about 3 weeks ago. In my 5.5 years with the company I had the chance to live in 4 countries (Canada, China, India and England) and to work with and learn from some really amazing people. I think that ThoughtWorks is a great company with a great depth of talent and knowledge, a solid global culture, passionate leadership and a progressive perspective on the IT industry and the world. And I still find Roy to be an inspiring leader.

However, having recently returned from 6 months in China, I wasn’t really looking forward to the prospect of more travel. China was a great experience, but it sure made it feel nice to be back home. As there’s nothing happening for ThoughtWorks in Vancouver these days, work would mean spending a considerable amount of time on the road or moving elsewhere. Considering that I live in Vancouver because I love being in Vancouver, spending most of my waking hours away defeats the purpose. I also wasn’t looking forward to being an absentee father to my amazing one year-old daughter. So, it was time to part ways with the company.

For my last day, ThoughtWorks graciously offered to fly me out to Calgary to say farewell to some of my colleagues. Serendipitously it coincided with the office’s annual ski trip to the Rockies, so I got 3 days of fabulous skiing at Fernie in the bargain. It had been snowing heavily before we arrived, so there was tonnes of fresh powder. JJ and I had a once-in-a-lifetime run down the saddles into Lizard Bowl just as the ski patrol dropped the ropes.

In considering what to do next, I was pretty confident in finding local Agile consulting engagements in the city by leveraging my growing network here. I also had a burning product idea that I was thinking about tackling. But what I really wanted to do, and have wanted to do for the last 6 years, is to align my skills and experience delivering enterprise systems with the issue that matters most to me — namely, addressing the problem of global warming. Fortuitously, just as I started looking around, an opportunity came into my inbox via the Web of Change mailing list. The opportunity was with a local start up called Small Energy Group that is helping large buildings and institutions to monitoring their energy usage and significantly improve their energy efficiency. Several sets of interviews later and I’m the newest member of their team.

I can’t talk too much about what we’re working on right now. But we have a public release coming up quite soon, so I’ll post information about it then.

The company is located in (unassuming) Dundarave, West Van. I’m commuting back at forth to work by bicycle (one of these days I’ll post pictures). This is what my route looks like:

posted under life | 1 Comment »

More MacBook Pros and Cons

March10

Now that I’ve had my MacBook Pro for a little over a month, I have some additional observations on its merits and demerits. Overall, I’m still extremely happy with the product and consider it to be the best laptop I’ve owned to-date.

I still do quite a bit of work in Windows (both development and work with MS Office). I purchased a copy of VMWare Fusion to virtualize my Windows Bootcamp partition. Fusion makes it easy to operate concurrently on both Windows and OSX without any noticeable performance hit. I can drag files or copy and paste text back and forth from one environment to the other. Unlike Parallels, it provides a performant virtualized environment that I would actually do development in. That said, I have noticed some strangeness when trying to access a DVD drive or USB devices while running Fusion. I haven’t investigated enough to figure out what the issue is, but these problems seemed to disappear after shutting down the virtualized environment.

Another thing about the MacBook that is quite nice is the little remote that it comes with. It works well for driving presentations, pausing movies and shuffling songs. I’ve previously owned a USB-enabled remote for presentations, which I’ve now happily passed on to my wife.

Speaking of movies, I’ve been quite impressed with the quality of the MacBook Superdrive. I have a few DVD movies that I picked up in China that I haven’t been able to play on a PC. But the Superdrive can read them.

My one big annoyance is the lack of support for a direct VGA connection. I hate having to carry around the DVI-VGA dongle. It’s easy to forget or leave behind attached to the projector. I understand why Apple would provide support for the higher-quality, more future-proof DVI, but the majority of projectors and external monitors out there still require a VGA connection. Would providing VGA support really been such a big effort?

posted under technology | No Comments »