Archive

Archive for the ‘Technical’ Category

Back to the future TDD

December 20th, 2009

Test written in November/2009:

@Test
premiumDisplayedForAShortTermPolicy() {
given(theBroker.hasStartedAQuoteWithMinimumDataToConvertToNewBusiness());
and(theBroker.enters.field(DUE_DATE, “15/12/2009″));
when(theBroker.underwrites());
then(thePolicy.hasCurrentMotorPremiumDisplayed());
}

The intent of DUE DATE was a date in a short future, less than a year. So, one month would be enough. That test broke on the 16/12/2009!!! Back to the future.. The future has come!

A way of showing the intent would be:

@Test
premiumDisplayedForAShortTermPolicy() {
given(theBroker.hasStartedAQuoteWithMinimumDataToConvertToNewBusiness());
and(theBroker.enters.field(DUE_DATE, oneMonthFromToday()));
when(theBroker.underwrites());
then(thePolicy.hasCurrentMotorPremiumDisplayed());
}

Technical

Build Dashboard Radiator - Your Build Light ++

December 15th, 2009

Why do we need more than a build light?

I’m really impressed and happy with how Continuous Integration (CI) has been widely used and accepted by many companies lately. However, sometimes the CI build is placed in the refrigerator where it just breaks and no one notices for many reasons, perhaps because people usually receive an e-mail notification that gets ignored or even moved to a folder that is never read. In order for us to gain as much as possible from what CI brings to us the CI build results have to be visible as a radiator. One of the ways of making CI results visible is by using a build light, which can go green or red depending on the results of the build. What we have noticed on our current project is that the colour of the light would not be enough information to be visible to the team. Our smart colleague Dave Yeung created a Build Dashboard Radiator for us.

CI Build Light VS CI Dashboard Radiator

What else do I get from a Build Dashboard Radiator?

Ideally it should provide you with more information than just whether or not the build has passed. It can, and should, be customised for each project. For example:

  • Build time
  • How many tests failed
  • If you have different builds you should be able to know which one failed
  • Different test environments that can go up and down and you want to keep track of

Implementation for Hudson

The concept of a Build Dashboard Radiator can be accomplished for any CI Server such as Cruise, Hudson or TeamCity. Dave’s implementation works for Hudson. This implementation requires Grease Monkey so that we can use GM_xmlhttpRequest which allows us to do asynchronous http request to our Hudson server. With this implementation we managed to keep track of Hudson’s builds, including its time and also our stage environments. If you follow the a step by step tutorial below to install our Hudson implementation you will be able to keep track of Hudson Builds and Environment Availability. This is the result page of our examples file inside the tutorial pack. It shows 2 builds and 2 environments.

ci-build-dashboard-radiator-examples

Hudson’s Builds:

You can add as many Hudson builds as you want to your dashboard in a declarative html way: Build-Dashboard-Radiator---Build-Example As you can see, you can also make sure that your build time does not exceed a particular time that you can define using:

<span class=”expectedDuration”>12</span> minutes</span>

Exceeding the expected duration represents a kind of build failure that you can see from the dashboard and act on it ASAP.

Environment Availability:

If you are developing a web application, you might have multiple environments that you want to make sure are available, such as Integration, UAT and even Production. We use the dashboard to get to know as soon as possible if one of these environments is offline: ci-build-dashboard-radiator-env-examples What this does is basically ping the page from the href and check if the http response is 200 (success). Simplicity! :)

Step by step tutorial and Code

  • Install Firefox and Grease Monkey plug-in
  • This is the reason why I unpublished this post and I am publishing it again now. The new grease monkey does not allow by default the interception of local files. To enable that you have to open firefox config page with about:config and change the property greasemonkey.fileIsGreaseable to true. This image might help
  • Download this file and extract it to a folder
  • Drag and drop grease monkey script (file build-dashboard-radiator.user.js) to your Firefox. Grease monkey will attempt to install it, confirm the installation. IMPORTANT! You have to drag and drop the file in order for Grease Monkey to install it properly. Do not use the normal Grease Monkey installation process, which is via the plug-in install button.
  • Open the example file (build-dashboard-radiator-examples.html)
  • You can change the examples and the css files to your needs.

I hope it’s as useful for you guys as it has been for us so far…

Thanks again Dave.

Technical

Build Dashboard Radiator - (Old post, click below for new)

December 6th, 2009

Click here to see the post about the Build Dashboard Radiator and perhaps download the code again.

Why this post has been removed?

The reason why this post has been removed is because the new grease monkey does not allow by default the interception of files. So, the Build Dashboard Readiator that I had posted was not working on the new grease monkey. It’s fixed now!!! :)

To enable that, you have to open firefox config page with about:config and change the property greasemonkey.fileIsGreaseable to true. Thanks Dave for that.

GreaseMonkeyProperty

GreaseMonkeyProperty

Technical

Sustainable Pace - Go Home On Time Day in Australia

November 24th, 2009

As a result of the paper Something for Nothing - unpaid overtime in Australia, the 25th of November is now the “Go Home On Time Day”.

“This paper reveals that Australian workers are ‘donating’ more than their annual leave entitlement back to their employers in the form of unpaid overtime. The typical full-time employee in Australia works 70 minutes of unpaid overtime a day. This equates to 33 eight-hour days per year, or six and a half standard working weeks.” (Something for Nothing - unpaid overtime in Australia)

GoHomeOnTimeDay

Sustainable pace is one of my values… So, IMHO everyday should be a Go Home On Time Day! What do you guys think? :)

Technical

Future Retro Box

November 15th, 2009

We have noticed on our current project that during retrospectives people usually raise good and bad things from the last days only. At the moment we have a 3 weeks iteration and it’s hard to remember what happened on the first days. I have already used from 1 to 4 weeks iteration and each project has its own reasons for choosing this length. To help the team improve around things that happened during the whole iteration, we have a box called the Future Retro Box, where people can all keep adding notes throughout the iteration.

DSC07729

The reason why the box is called Future is because it will be opened during the next retrospective. The items inside the box will bootstrap the retro wall when people can add other ones.

Make sure the box is in a visible point of the work environment.

DSC07731

Another option would be to have an on going retrospective wall, as suggested by my friend Lachlan. However, this might work better for a co-located team, we are distributed. We tried using a wiki for that… It didn’t work… No one adds comments to the wiki… Why? Perhaps the wiki is a Refrigerator as opposed to a Radiator. The box has been working fine so far. The notes are not visible, but the box itself is.

Technical , , ,

Technical Debt Wall Retrospective

September 1st, 2009

Although we should avoid as much as possible Technical Debt, most of the projects end up incurring some of it. However it is important to know “how much” we owe and how much interest we are paying.

Know your debt

Recently on our project we did a Technical Debt Retrospective. Basically we brainstormed on the wall all the Tech Debts we thought we had incurred since the beginning of the project. Then we decided to categorise them by Effort and Pain:

TechDebtRetroEffortVSPain

“The relative effort that the team would have to spend in order to pay this debt.“

Pain is the direct impact on productivity that this debt causes. (interest)”

Keep paying down the principal, not only the interest

If we do not pay down the principal of our debt by refactoring our code we will always be paying just the interest, which means reducing the productivity. The question we asked ourselves was “Which ones should we pay first?”

Looking at the four quadrants of this wall we can identify which ones we can pay so that we can have the highest return.

TechDebtRetroEffortVSPainHighReturnNotWorthOne interesting thing that came out of our retro was that the High Return section was almost empty. We came to the conclusion that this was a good sign, it means that we had already fixed most of the LowEffort/HighPain debt during the normal development. Which is exactly how this type of debt should be paid.

After the retro we kept the Technical Debt Wall next to our Story Wall. From that day on it should become an ongoing wall that we will keep an eye on… Paying whenever possible…

Technical , ,

Roles and Hand-Offs (Jason Yip)

August 5th, 2009

My colleague Jason Yip posted some very interesting thoughts on roles and hand-offs and I thought perhaps I could express them with some images… As I really like images better than words.
Jason mentioned that usually this is what happens:

Waterfall Project

HandOffsWaterfall.png

Some Agile projects

They miss the point by assuming this is enough:

HandOffsSomeAgile.png

Ideally, this is what we want

HandOffsIdeal.png


“We’re not just re-ordering hand-offs, we actually want to remove them.” (Jason Yip)

Technical , , , ,

Principle of Relative Priority

June 29th, 2009

Prioritization is crucial for a project to succeed. We need to make sure that we deliver what’s most important, what adds more value. The interesting and most challenging part of this is when we have to ask the business (client, product owner) to prioritize items. By calling them items I mean they are not necessarily stories, features or a product backlog. Sometimes we want to prioritize needs, purpose, goals and outcomes as well. The way we ask them is the trick…

I’ve seen many different ways of defining the priorities and usually there are ranges involved, sometimes with labels or numbers, like:

  • Very High / High / Medium / Low
  • Must Have / Should Have / Could Have
  • Essential / Important / Not very important
  • 1 - 5

There is nothing wrong with creating the labels, but when we ask the priority of one item only, that’s what happens sometimes:

IsImportant.png

How do we understand business priorities

The most effective prioritization exercise I’ve seen was to give the business a randomized list of items we want to be prioritized, then we ask them to give us the X most important items. And these will be the ones considered during the next timeframe. We should always let the list visible to the stakeholder who is prioritizing… It has to be clear for him that he is giving up on items in favor or others… at least for the next timeframe, which could be the next iteration of release.

It’s like a son’s birthday gift…

Good parents apply this rule with their children. Let’s say it’s close to my son’s birthday, I don’t have a son, this is totally hypothetical :), but my mother used this rule with me… So, I want to buy him a gift, ONLY ONE, of course, because I’m not the kind of dad that gives everything that my son wants. So I have a list of gifts that I know my son wants. Bike and video game are top of the list, but I can give him only one now, because it’s his birthday. We all know It’s close to Christmas (next iteration/release) and I will give him the other one on Christmas, but now it’s his birthday time, only one gift… I, then, make sure that my son understands the one gift per event rule and ask him which one does he want as his birthday gift… As a clever boy, he will think carefully which one really matters more to him because it’s clear that he has to give up on one in favor of the other. He will not give up on it forever though, it’s just until Christmas (next iteration/release), however, he knows that one of them will be bought and received first, and the other will come later…

WhichOneStoriesBikeAtari.png

As I said, there is no problem in defining labels and priority buckets, the only thing we have to bear in mind is that whenever we ask the business to prioritize items, we do not ask them in which bucket he wants to put one single item. And that’s when the principle comes.

Principle of Relative Priority:

All the decisions about item priority have to involve other items which are being traded in favor or the most important one(s). There is no absolute priority, only relative to other items.

One item by itself is usually important, otherwise it would not even be in the wish list… If I ask my son:

  • Dad: “Do you want a bike?”
  • Son: YES!
  • Dad: “Do you want a video game?”
  • Son: YES!

But when they have to CHOOSE… That’s when the most important items are picked… And during times of crisis, like now, with budgets constraints, we don’t even know if we will be able to afford a Christmas gift, so let’s make our kids happy during their birthday…

Technical , , , , ,

How far should we go with estimates

May 4th, 2009

My colleague Dan North facilitated a session today at ThoughtWorks office in Sydney about estimation, creating an MSL (Master Story List), what Scrum calls Product Backlog and which level of granularity should it be.

Dan started the session with a very interesting metaphor: If we want to calculate the area of a country we can always approximate it by comparing it with something that we know how to calculate… A triangle, for example. Dan used the map of the UK, I’m sorry Dan, I couldn’t help myself… I changed it to Brazil… :)

AproxBrazilArea.png

Basically, the area is something in between the areas of MIN and MAX triangles. And it’s very easy to calculate the areas of the triangles, right? How accurate is that? Of course it’s not 100% accurate, but most of the time we don’t need 100% accuracy. We just need to understand the boundaries in order for us to mitigate risks, which have been described as our “fears”.

The estimated range also helps us to make decisions. If a client wants to build an application, for example, and after calculating his current operational manual costs and what the application would make him save, he is willing to pay 1 million. But the estimated range is between 4 and 6 millions, this already helps the client to make the decision of not to proceed with the project.
Always bear in mind what estimates are:

“Estimation is the calculated approximation of a result which is usable even if input data may be incomplete or uncertain.” (wikipedia)

Another pertinent topic during the session was that the Iteration Manager (Scrum Master or XP Coach) should not only be focused on the lower level stories (Product Backlog), but also on the high level project goals and outcomes as well as relating them to the client’s and organization’s needs and purposes.
Stories can be grouped at a A higher level, which we call a theme. Prioritisation and estimation could also be done at these levels.

IMFocus.png

Some other things that I learned:

Technical , , , ,

Dave Coombes and The Essential Architecture Kit

April 24th, 2009

Yesterday was the last day of our so respected, funny, smart, awesome Dave Coombes at ThoughtWorks. He is not only a colleague, but also one of my best friends. So he will be missed a looooot.
We are working together on the same project and our team organised a couple of surprises for him…
Well done guys!!!

Dave will be the architect of a big bank in Australia, so we’ve been joking around because of that… In a very good way, of course. So we gave him The Essential Architecture Kit, which contains:

  • A portable white board
  • A ruler so that he can integrate systems by connecting them with lines
  • Architecture for Dummies (the book)

DaveCoombesTheEssentialArchitectureKit2.jpg
DaveCoombesTheEssentialArchitectureKit1.jpg

Josh posted this photo while we were still at the pub yesterday having lots of fun, but also a bit sad because we will miss this legend! I wish you all the best Dave!

Technical