Lotus Notes: Making mail quotas meaningless

There are at least three good reasons why we’re using Lotus Notes, so mostly this post is just here to make me feel better. Thank you for sharing my pain; please comment with any solutions you’ve found for this problem.

Today, I decided that I would delete all my old Lotus Notes mails that have been building up. This is partly because I’ve been getting warnings for the last three weeks about my quota, and partly because I remember my empty inbox with fondness.

I click my Inbox on the Workspace.

I start at the bottom, with my mail from way back in 2005. I can’t just shift-select a ton of mails – I have to individually tick every single one. I have a preview window; of course, this means that if I accidentally click on something large, Lotus Notes carefully loads the attachment into memory before allowing me to delete it. (I have no idea why it does this, since it loads it all over again if you actually open the mail. And again if you decide to open the attachment.)

I tick a screenful of mail, press delete, and get the “Type Mismatch” dialog:

I don't know whether Lotus Notes still thinks it's being helpful here or not.

All the mails now have crosses against them, but haven’t actually been deleted.

Why does Lotus Notes think this is helpful?

I figure that maybe, just maybe, Lotus Notes will do this if I log out. So, I quit Lotus Notes. When I open it again, all the crosses have gone and the mails are still there.

So, I try again. Tick. Tick. Tick. This time, I just close my inbox. Lotus notes kindly asks me, this time, if I want to delete 77 mails. Absolutely I do! But apparently, Lotus Notes exists in a different timezone to us mere mortals, and it’s too early:

This is Lotus Notes being surreal.

Hm. My mails are still there, and the crosses have gone again.

I have spent hours now trying to delete my mail. Of course, now I remember why they were building up in the first place…

Posted in Uncategorized | 11 Comments

A quick OOPSLA write up

Finally back at my own home.

Highlights were:

Posted in Uncategorized | Leave a comment

Lessons from the Goth Conga* line at Whitby

You can be fast, or have control, but must sacrifice one for the other.
How much of each you can have depends on your platforms.

(*Actual music was the Locomotion. No self-respecting goth would be seen dead dancing to the Conga.)

Posted in Uncategorized | Leave a comment

BDD, Regression Testing and some feature requests

We write scenarios to help us know when we’re done… not

I’ve been quite happily espousing the idea that we write scenarios in order to help us (devs) know when we’re done, which helps drive our design, and everything else is a lucky by-product.

Dan referred in our OOPSLA tutorial to something he calls ‘Beer Driven Development’; how soon can I get down the pub? As a business analyst, it helps to assume that all devs are horribly lazy and want beer, so if you haven’t specified the scope of the problem, you won’t get that bit of the solution you’re after. Conversely, if you do include some behaviour in the scope of a scenario, you’ll most likely get the simplest thing that could possibly work. This is good, because it cuts down the number of bugs.

There are a couple of other reasons for writing scenarios: regression, and documentation. It turns out (from feedback at OOPSLA) that a lot of people care about automated regression tests. It’s a nice way for devs to know that we’re still done, and as long as the QAs have confidence in the automated tests, they don’t have to manually cover that ground. (In practice I’ve found that they usually do, just to make sure that the tests themselves aren’t faulty, but less often than they would.)

BDD, it turns out, lends itself quite nicely to regression testing.

A scenario is a set of steps

Given <some context>, when <some event occurs> then <some outcomes should result>.

There may be more than one context, event and outcome. It may also be useful to exercise the behaviour a few times in the same scenario, so perhaps there will be more than one event-outcome set.

Scenarios are regression tests once the code that makes them run has been written

Sometimes, though, we like to change scenarios or acceptance tests for the specific purpose of regression testing. This is because the frameworks that we have to test the UI are horribly slow.

I’ve worked on one project where, while running the suite of 500 Fitnesse scenarios, the CPU buzzed at 100% and the whole suite took 5 minutes to run. A lot of technical jiggery-pokery was needed to get this to happen, but if you can do it, you don’t need to differentiate between scenarios and regression tests (the one becomes the other as soon as the code that makes it run is in place). There are some frameworks which are faster than others – Simon Stewart’s WebDriver, and the tiny Swing harness packaged with JBehave, which I’m still incredibly proud of – but generally these fast frameworks aren’t mature, or full-featured yet. And, even if they are, once you start getting above 500 scenarios you may still want to think about cutting down the length of time it takes to get feedback from your suite.

Acceptance tests are hard to read, which makes it hard to merge them

I’ve seen (and written) a number of acceptance tests which look something like this (only they weren’t using pretty fluent interfaces, so they were even worse):

I can refund a customer’s purchase

TillScreen.addItem("Panatachi Television 3X").pay("2000").with(new CreditCard("2345123478902468")).done();
int originalNoOfTelevisionsInStock = StockScreen.count("Panatachi Television 3X");
Money originalBalance = FinanceScreen.getBalance();

TillScreen.findMostRecentBill("2345123478902468").refundItem("Panatachi Television 3X").with(new CreditCard("2345123478902468")).done();

assertThat(StockScreen.count("Panatachi Television 3X"), eq(originalNoOfTelevisionsInStock));
assertThat(FinanceScreen.getBalance(), eq(originalBalance - 2000));

I can replace a customer’s purchase

TillScreen.addItem("Panatachi Television 3X").pay("2000").with(new CreditCard("2345123478902468")).done();
int originalNoOfTelevisionsInStock = StockScreen.count("Panatachi Television 3X");
Money originalBalance = FinanceScreen.getBalance();

TillScreen.findMostRecentBill("2345123478902468").replace("Panatachi Television 3X").done();

assertThat(StockScreen.count("Panatachi Television 3X"), eq(originalNoOfTelevisionsInStock - 1));
assertThat(FinanceScreen.getBalance(), eq(originalBalance));

Did you actually read those, or did you just skip to this line? Chances are that you just glossed over them. I would. BDD helps clear this up when the scenarios are written, so instead of this we’d have:

I can refund a customer’s purchase

Given that a customer purchased a Panatachi Television 3X
and a Panatachi Television 3X costs $2000and he paid with credit card number 2345123478902468
When I search for the most recent bill with credit card number 2345123478902468
and I refund the Panatachi Television 3X
Then the stock of Panatachi Television 3X should be unchanged
and we should have $2000 less.

I can replace a customer’s purchase

Given that a customer purchased a Panatachi Television 3X
and a Panatachi Television 3X costs $2000
and he paid with credit card number 2345123478902468
When I search for the most recent bill with credit card number 2345123478902468
and I replace the Panatachi Television 3X
Then the stock of Panatachi Television 3X should be one less
and we should have the same balance.

(If you think it’s impossible to write code this way, take a look at the latest RSpec features, brought to you by David Chelimsky. I’m completely blown away by this, and can’t wait to convert all my breakable toy scenarios to RSpec running on JRuby. Anyway…)

It’s easier to merge scenarios

With BDD, it’s fairly easy to see which contexts, events and outcomes are common between the two scenarios, and we can imagine a situation in which we could exercise both features associated with these stories.

You can see that the context of the scenarios both start with a customer owning a previously-purchased Panatachi television. In most frameworks, this is accomplished by running the scenario in which a customer purchases a television; we’re using a scenario as the context for another scenario. Running scenarios takes time! Wouldn’t it be great if we could just run this once?

To make these into one scenario, we need the outcome from one to resemble the context of the other, then we don’t need to set up that context again. In the same way that we’d refactor code to look similar, we can refactor the context of the first to be identical to the outcome of the second.

Interestingly, as I come to do this, I realise we’re missing a couple of contexts! They’re implicit in both scenarios – what’s the actual balance? and the actual stock levels? I’ve also swapped the scenarios around, because that’s the order they’ll happen in now:

I can replace a customer’s purchase

Given that a customer purchased a Panatachi Television 3X
and our balance is $23150
and we have 10 Panatachi Television 3Xs in stock
and he paid with credit card number 2345123478902468
When I search for the most recent bill with credit card number 2345123478902468
and I replace the Panatachi Television 3X
Then we should have 9 Panatachi Television 3Xs in stock
and our balance should be $23150.

I can refund a customer’s purchase

Given that a customer purchased a Panatachi Television 3X
and our balance is $23150
and we have 9 Panatachi Television 3Xs in stock
and a Panatachi Television 3X costs $2000
and he paid with credit card number 2345123478902468
When I search for the most recent bill with credit card number 2345123478902468
and I refund the Panatachi Television 3X
Then we should have 9 Panatachi Television 3Xs in stock
and our balance should be $21150

So, now we can merge the two scenarios:

I can replace or refund a customer’s purchase

Given that a customer purchased a Panatachi Television 3X
and our balance is $23150
and we have 10 Panatachi Television 3Xs in stock
and he paid with credit card number 2345123478902468
When I search for the most recent bill with credit card number 2345123478902468
and I replace the Panatachi Television 3X
Then we should have 9 Panatachi Television 3Xs in stock
and our balance should be $23150.
When I search for the most recent bill with credit card number 2345123478902468
and I refund the Panatachi Television 3X
Then we should have 9 Panatachi Television 3Xs in stock
and our balance should be $21150

Trying to do this with code, instead of English, sucks. It’s hard to see the difference between the setup of a context and the occurrence of an event. It’s a lot easier if the code is written in English, to the extend that most people will skip that second step and move straight to the third.

Even so, we’ve lost some of the emphasis. We don’t want to know that the balance is $23150. We want to know that the balance is the same. The implicitness of the two missing contexts was actually quite beautiful. Wouldn’t it be lovely if we could bring those back?

I want some new features!

The scenario I really want looks like this:

I can replace or refund a customer’s purchase

Given that a customer purchased a Panatachi Television 3X
and he paid with credit card number 2345123478902468
When I search for the most recent bill with that credit card number
and I replace the Panatachi Television 3X
Then we should have 1 less Panatachi Television 3X in stock
and our balance should be the same
When I search for the most recent bill with that credit card number
and I refund the Panatachi Television 3X
Then we should have 1 less Panatachi Television in stock
and our balance should be $2000 less.

So, as a scenario writer (aka BA for happy paths, or QA for full regression, or some combination with a dev to help turn it into code):

  • I want outcomes to be able to record the state of the world before the events that will result in those outcomes, so that I can verify comparative outcomes and retain meaningful emphasis (This is possible in JBehave, but horribly ugly and ties the Givens to the Outcomes – I don’t want to do that!)
  • I want all scenario steps to be aware of the world in which they are running, so that they can share aspects of the world instead of duplicating them (‘that credit card number’ instead of ‘2345123478902468’. JBehave already does this, but I’m not sure if RSpec does. Will ask…)
  • I want to be able to associate a scenario with more than one story, so that I can change the scenarios for several stories into a single regression test (RSpec lets you tag things; JBehave doesn’t. Yet.)

As a regression tester (aka dev) being asked to save QA some work:

  • I want to be able to run scenarios as well as stories (JBehave doesn’t do this yet).
  • I want to be able to associate a scenario with several features, benefits, etc., so that I can test a feature or check that a benefit is still being provided (see tagging, above.)
  • I want to have the option to check for the outcome of a scenario being used as the context of another scenario, so that I know whether I need to run them or not. (Since a scenario might be used as the context for a scenario that’s being used as a context, etc., at some point we are likely to find ourselves in a world we can use. Dan says this is a ‘backwards-chaining rules engine’ and is quite excited by the idea. He also says this is incredibly dangerous and will only work for Given/When/Then, not Given/When/Then/When/Then, so it should be used with some thought.)

Fortunately, as well as being a scenario writer (at least for my breakable toys) and a regression tester, I’m a JBehave dev, so I have some control over when I get these features. Looks like I have some work to do.

Posted in bdd | 2 Comments

The Game of Life – a kata

I finally got around to putting a simple version of the Game of Life kata on the web.

This is the exercise which we’ll be using to teach BDD at Oopsla. If you’ve never heard of the Game of Life before, Wikipedia have a great explanation, and there’s an even better implementation here, together with some great seeds.

Have a play! And maybe even have a go at implementing it yourself!

Posted in Uncategorized | 1 Comment

When estimates go wrong

Quite often on my current project, I hear conversations like, “That was estimated at three days, and it’s taken five. Why do you think that was?”

This is never asked with any sense of blame; rather, it’s a learning experience. What’s holding people up? Where are the bottlenecks? Was the story more difficult than expected? Was information unavailable? What could we do differently next time?

There’s another question which I hear less often. “That was estimated at five days, and it’s taken three. Why do you think that was?”

Strangely, this isn’t because we never deliver before the estimates. The estimates on our project are balanced, so even when they’re not realistic, there’s about the same amount of underestimation as overestimation. (If you’re always coming in under your estimates, your estimates are too large.) So why concentrate on the shortfall?

I’m not an expert at this, but I can guess. There’s a certain budget allocated to every project, be that time or money. Whenever a task takes longer than was expected, it’s now eating into the contingency (assuming there is any). The funders, who have allocated time and money to the project, want to know where their money has gone, whether it’s in good hands and how much more they might have to dish out. They’re asking uncomfortable questions of the managers, who in turn are asking uncomfortable questions of the devs. You have overspend, and must beg for more funds. How humiliating!

Conversely, when a task takes less time than expected, this adds to the contingency (or creates some, if there wasn’t any before!) Where’s the motivation to report that to the managers? They’ll only expect you to repeat the miracle. Where’s the motivation to report that to the funders? They’ll only take away your budget for next time! So there’s every reason to keep this secret, unless your funders are starting to fret. You have underspend, and until someone finds out, you get to keep it. How lovely!

I can’t think of any way to prevent that game from happening, but concentrating on the overspend produces some interesting results.


1) We game the system to come in under target.

No one likes uncomfortable questions. The estimate was wrong; why? Did my colleague make a mistake when he argued us down to 3 in the planning game? Or was I just slower than expected? Chances are that I’ll try to argue the estimate up next time, to avoid having to answer why.

2) We learn from our mistakes.

We didn’t make the estimate because we tried something out that didn’t work. We didn’t ask for help when we should have. I had a hangover all week. Let’s not do that next time.

3) We’re sorry.

That low-priority feature that you asked for isn’t going to be ready.

4) We’re not as good as we thought we were.

Now I’m sad. What’s the point of working so hard, when it’s so hard to work?


Concentrating on the overspend is at best a learning experience, and at worse demoralising. Let’s try something a bit different. What happens when we concentrate on the underspend, too?


1) We game the system for accuracy.

No one likes uncomfortable questions. Am I too cautious? Did I not believe my colleague when he tried to argue the estimate down? Or am I just faster than I expected? I’ve learnt something about our capacity, and chances are that next time, my estimate will be more realistic.

2) We learn from our success.

Henry cleaned up the code last week, and we were able to add the change in just 10 minutes. We found an excellent manual on writing SQL. Rebooting the cruise server on Monday stopped it crashing on Wednesday. Let’s do that again!

3) Surprise!

You know that story you thought you weren’t going to get? Well, it looks like we’ll have time to do that too.

4) We’re better than we thought we were!

Happy, happy, joy, joy! I believe in myself, and my abilities. I feel like I can take on anything! Even that bug that no one else wants to touch!


So, next time you’re looking at the overspend on a story, take a look at the underspend on other stories too. It will make you smile, you’ll have plenty to talk about in your retrospective, your estimates will be more accurate, and they might even get smaller – along with the real time to deliver.

Posted in Uncategorized | Leave a comment

BDD comes to OOPSLA!

Dan and I will be running a joint tutorial on BDD at Oopsla.

    Participants will get the chance to

  • create executable stories and scenarios from predefined story cards and follow their implementation through to a unit level
  • understand the role of the customer and QA in helping to define and manage the stories and scenarios
  • learn how to define the behaviour and responsibilities of unit-level code in natural language, and understand how this drives better design
  • learn how to use JBehave’s story and behaviour frameworks
  • find out about alternatives to JBehave, support for languages other than Java and how to use existing tools such as JUnit
  • hear about the impact of these techniques on real-world projects.

The emphasis will be on the BDD techniques, with JBehave used as a supporting tool.

If you’ve ever wondered what the fuss is about, this is your chance to find out!

Posted in Uncategorized | Leave a comment

Your horoscope for August*

How people

August’s workload looks easy. This isn’t a good sign. Either you haven’t got enough work scheduled to keep people happy, or reality is about to make its presence felt. On the bright side, a new coffee shop has opened up down the road. This should help to solve the problem.

Your tool of the month is Chatzilla.

Why people

Your friends have been busy helping you out for a while; now they need cheering up and it’s time to return the favour. Don’t schedule anything. You’ll only have to cancel, and spontaneity is more fun anyway. Water the plants, find a cat-sitter and make sure you know where your towel is.

Your word of the month is Onomatopoeia.

Who people

How does something that was so trivial last week become so complex in the space of seven days? Follow your train of curiosity and find out what’s really happening. Beneath the serene surface is a seething mass of wildlife. It’s only when you look closely that you realise how entangled evolution and environment really are! But worry not; a new coffee shop has opened up down the road. This should help pacify them.

Your pub of the month is the Coach and Horses in Farringdon.

When people

Light at the end of the tunnel only throws your current plight into contrast. The train is stalled; nothing is moving and it looks like your plans will have to wait. Bring a good book and plenty of water. You’re going to be there a while.

Your quote of the month is:

The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man.

* July didn’t happen, at least in the UK.

What’s my sign?

Posted in Uncategorized | 2 Comments

BDD – TDD done well?

Someone on the XP thread suggested, “BDD is just TDD done well with different words.”

Here’s my take.

An application is the end-product, and the value of the application is delivered through its behaviour, as perceived through its user interface.

BDD uses descriptions of behaviour and executable examples (or exemplars; examples carefully chosen to illustrate a particular behaviour). These exemplars, whether in code or plain English, are an aid to communication, to driving a clean, simple design, to understanding the domain, to focusing on and delivering the business value, and to giving everyone involved clarity and confidence that the value is being delivered.

Is doing the above merely ‘doing TDD well’? Maybe it is, but I think that the words do help to change the focus; also, my experience (amongst others) is that some people who struggle to do TDD well find BDD relatively easy.

Here are some of the practices I use in BDD.

A story is a narrative from a customer in a particular role, describing a particular feature and a value that will be delivered through the use of that feature. Scenarios associated with the story will be executable, either manually or through automation, once the feature delivers the value.

(This isn’t a practice; it’s just how stories and scenarios work.)

Making the scenarios and examples executable allows us to know when the value has been delivered, at each level of code. Maintaining those examples allows us to continue to have that certainty as other features are developed.

(This isn’t a practice; it’s just how good tests work. But without using the word ‘test’.)

Each level of code in the application delivers value to some other piece of code, through its own behaviour and its own interface (which could just be the externally visible methods, or an actual java-style Interface). Eventually the sum of those values is delivered to the user interface, which delivers the value to the customer.

(This isn’t a practice; it’s just how software works.)

Describing these stories and behaviours in English allows more people to understand the code and talk about it than otherwise might. For developers, it encourages the use of English in place of Geek. This aids communication.

Driving behaviour from the user interface downwards, and focusing on each unit of code, its responsibility to deliver its value to another, and its ability to use other code to deliver value to itself, minimises non-valuable code and allows developers to split responsibilities easily. This results in a clean, simple design.

Capturing common contexts, events and outcomes, and using these as part of the (coded) domain language, helps us to understand the domain.

Coding the story and scenarios (exemplars at the user interface level, automated at the closest possible level to that interface) helps us focus on, and deliver, the desired value.

Using English for executable scenarios and examples means that everyone, including the customer, can understand which values are delivered, which have been lost (either deliberately or otherwise), and which are yet to come. This helps to give everyone clarity and confidence.

(These are some things I practice as part of BDD.)

I believe this is more than just ‘doing TDD well’. I think it’s ‘doing TDD and a number of other practices related to professional software development well’. The five practices above might conceivably be done in addition to TDD, but they’re not part of any definition of TDD I’ve seen.

Posted in bdd | 2 Comments

Agile house building

Next time you hear someone compare software engineering to building a house, point them at this:

http://www.touregypt.net/featurestories/snefrubentp.htm

“The Bent Pyramid, though largely intact, owes its preservation to the builder’s realization of their errors soon enough to make changes to their initial building plans.”

Even the ancients didn’t get it right first time.

Imagine a future in which all buildings are constructed from component modules. These modules can be easily adapted to fit one another. Walls, doors, windows, stairs and structural elements can be moved from one module to another, and are easily repainted to match your colour scheme. Each module also has a bar which flashes red when they’re in danger of structurally failing, either due to the stresses of the building* or of human habitation.

Halfway through the building process, you realise that there’s room for a swimming pool in the lounge. Your friend has one and it’s great for parties. So you change the design. The builders are quite happy to slap it together for you, content in the knowledge that the red bar keeps things safe.

After two years, you find you need an extra bedroom. It’s quite easy to extend the lounge and bolt the bedroom on top. You need to move another room to create room for the extra door, but that’s easy too. While you’re there, you move the swimming pool to the roof.

A year later, you are able to work from home, so you port your entire house to the wilds of Scotland, where you have a great view of the sea.

Why would you not want to build a house that way?

*I love checkstyle

Posted in Uncategorized | 1 Comment