Skip to main content

The Test in Test Match

There are times when getting a stakeholder to agree that there's a problem is not easy. Then there are times where, having found a stakeholder who accepts the existence of an issue, you have difficulty persuading them that it's important to find a solution to it now.  And then there are those times when, having found a sponsor who both recognises and wants to relieve the particular headache you've identified, they can't get past some narrow view of it - either in terms of the problem space or the complexity of the necessary solution or both - and you end up with incomplete fixes that might focus on a particular case or which will fail in logic for some subset of cases and perhaps even compromise the integrity of the implementation to boot.

Limited-overs cricket found itself in this position a few years ago. In this format of cricket the two teams each bat for one innings to try to score runs given a set number of balls bowled to them and within a set number of wickets (the number of players who can be out). When all the balls are bowled or all of the wickets are lost, the innings ends. Whichever team makes the most runs wins.

Unlike many other sports, cricket matches stop during rain and, if the rain lasts long enough, the match is reduced in length to ensure that it still fits into the day.  The cricketing authorities recognised the problem - how to perform that reduction fairly - and knew they needed a solution but, by the account in Duckworth Lewis: The Method and the Men behind it, failed to comprehend the range of scenarios that needed to be considered and were not prepared to think about the problem in anything other than a single dimension.

The case that preoccupied cricket was when it rained after team 1 (the first team to bat) had finished their innings but before team 2 started, or had completed, theirs. In the case where this reduced the number of balls that team 2 could face, they would simply scale the number of runs that team 2 had to make proportional to the number of balls. So, if team 1 made 100 in their innings, and team 2 only faced half as many balls as team 1 then they'd have to make half the total (plus one to win), i.e. 51. Which seems logical enough except that it doesn't take into account that team 2 still have as many wickets as team 1 had and so can take more risks without worrying about running out of wickets.

One key insight required here is that more then one parameter determines a fair rescaling of the total: both runs and number of wickets available are important. A second is that rain could occur at any point in the match, even forcing team 1 to receive fewer balls than they expected when they started their innings, if heavy rain falls during it. The rescaling needs to be fair to both teams and so needs to take into account the point in the innings at which the match was affected: if team 1 were cautious initially to preserve wickets, with the intention of being aggressive at the end of their innings, but then the innings is cut short they will feel aggreived because they could and would have been more aggressive had they known there were fewer balls to face.

Duckworth and Lewis are academics, statisticians and cricket lovers. Their book - which can be quite dry and occasionally petty, but is worth persevering with - details the original problem and a selection of sticking plasters that were applied to it. They show how broken methodologies implemented with apparently little thought or testing resulted in severe embarrassments such as a world cup match where South Africa's innings was reduced in length but their target was not (due to the then-current rules) and so instead of needing 22 runs from 13 balls they were rescaled to 22 runs from 1 ball, which is essentially impossible in the game.

The solution they proposed, the Duckworth Lewis Method, now in operation in cricket worldwide, introduces the notion of resource for a batting team which is generated from historical match data and takes into account the match position, the number of balls still to come and the number of wickets still standing. Under this system, the relative resources available to the teams when play is interrupted are used for scaling. For example, a team with many overs and wickets in hand will have a lot of resource; a team with the same number of overs but few wickets will have less because they would likely have to play more defensively to preserve their wickets.

In the book Duckworth and Lewis demonstrate the problem by highlighting a relatively small number of realistic scenarios in which unwanted results would occur - results which it was clear to the cricketing authorities would be travesties. They use these to enforce the message that a higher level of sophistication (than simply scaling based on number of balls) is required. They suggest a solution and describe it at a high level in terms that should be already familiar to their stakeholders. They, importantly, provide an implementation of the method that would be tractable too. (And over time they have refined the methodology so that its use during a match is now relatively streamlined.)

They discuss clearly and reasonably the relative advantages and disadvantages of their methods compared to others. They explain how some of the secondary stakeholders - the media in particular - seem unwilling to try to get their heads round the principles of the solution and what they've done to try to overcome that. They identify the weak spots that still exist in certain extreme scenarios and they suggest enhancements, some of which are rejected by the cricket authorities to Duckworth and Lewis's clear frustration. They address suggestions from third parties for the application of the method in situations it was not designed for, such as Test Match cricket, where the number of overs is not limited and explore other places it could be applied or extended to. And if that's not enough, they even provide a FAQ.

Let's not get into the is testing (a) science debate  here (although if you're interested...) but instead look at some relevant parallels with a testing role and the way that Duckworth and Lewis went about their business:
  • they analysed approaches using thought experiments and real data searching for the anomalous cases - cases not presented to them as problems by the stakeholders 
  • they communicated with their stakeholders and others in their own language to a relevant and realistic level of detail
  • they were and are open about their own approach and to other approaches, wanting to judge them all on a level playing field.


Popular posts from this blog

Notes on Testing Notes

Ben Dowen pinged me and others on Twitter last week , asking for "a nice concise resource to link to for a blog post - about taking good Testing notes." I didn't have one so I thought I'd write a few words on how I'm doing it at the moment for my work at Ada Health, alongside Ben. You may have read previously that I use a script to upload Markdown-based text files to Confluence . Here's the template that I start from: # Date + Title # Mission # Summary WIP! # Notes Then I fill out what I plan to do. The Mission can be as high or low level as I want it to be. Sometimes, if deeper context might be valuable I'll add a Background subsection to it. I don't fill in the Summary section until the end. It's a high-level overview of what I did, what I found, risks identified, value provided, and so on. Between the Mission and Summary I hope that a reader can see what I initially intended and what actually

Why Do They Test Software?

My friend Rachel Kibler asked me the other day "do you have a blog post about why we test software?" and I was surprised to find that, despite having touched on the topic many times, I haven't. So then I thought I'd write one. And then I thought it might be fun to crowdsource so I asked in the Association for Software Testing member's Slack, on LinkedIn , and on Twitter for reasons, one sentence each. And it was fun!  Here are the varied answers, a couple lightly edited, with thanks to everyone who contributed. Edit: I did a bit of analysis of the responses in Reasons to be Cheerful, Part 2 . --00-- Software is complicated, and the people that use it are even worse. — Andy Hird Because there is what software does, what people say it does, and what other people want it to do, and those are often not the same. — Andy Hird Because someone asked/told us to — Lee Hawkins To learn, and identify risks — Louise Perold sometimes: reducing the risk of harming people —

Enjoy Testing

  The testers at work had a lean coffee session this week. One of the questions was  "I like testing best because ..." I said that I find the combination of technical, intellectual, and social challenges endlessly enjoyable, fascinating, and stimulating. That's easy to say, and it sounds good too, but today I wondered whether my work actually reflects it. So I made a list of some of the things I did in the last working week: investigating a production problem and pairing to file an incident report finding problems in the incident reporting process feeding back in various ways to various people about the reporting process facilitating a cross-team retrospective on the Kubernetes issue that affected my team's service participating in several lengthy calibration workshops as my team merges with another trying to walk a line between presenting my perspective on things I find important and over-contributing providing feedback and advice on the process identifying a

Testing is Knowledge Work

  The Association for Software Testing is crowd-sourcing a book, Navigating the World as a Context-Driven Tester , which aims to provide responses to common questions and statements about testing from a context-driven perspective . It's being edited by Lee Hawkins who is posing questions on Twitter ,  LinkedIn ,  Slack , and the AST mailing list and then collating the replies, focusing on practice over theory. I've decided to contribute by answering briefly, and without a lot of editing or crafting, by imagining that I'm speaking to someone in software development who's acting in good faith, cares about their work and mine, but doesn't have much visibility of what testing can be. Perhaps you'd like to join me?   --00-- "We need some productivity metrics from testers" OK. I'd like to help you meet your need if I can but to do that I'll need to ask a few questions. Let's start with these: Who needs the metrics? Is there a particular pr

Risk-Based Testing Averse

  Joep Schuurkes started a thread on Twitter last week. What are the alternatives to risk-based testing? I listed a few activities that I thought we might agree were testing but not explicitly driven by a risk evaluation (with a light edit to take later discussion into account): Directed. Someone asks for something to be explored. Unthinking. Run the same scripted test cases we always do, regardless of the context. Sympathetic. Looking at something to understand it, before thinking about risks explicitly. In the thread , Stu Crook challenged these, suggesting that there must be some concern behind the activities. To Stu, the writing's on the wall for risk-based testing as a term because ... Everything is risk based, the question is, what risks are you going to optimise for? And I see this perspective but it reminds me that, as so often, there is a granularity tax in c

Agile Testing Questioned

Zenzi Ali has been running a book club on the Association for Software Testing Slack and over the last few weeks we've read Agile Testing Condensed by Janet Gregory and Lisa Crispin. Each chapter was taken as a jumping off point for one or two discussion points and I really enjoyed the opportunity to think about the questions Zenzi posed and sometimes pop a question or two back into the conversation as well. This post reproduces the questions and my answers, lightly edited for formatting. --00-- Ten principles of agile testing are given in the book. Do you think there is a foundational principle that the others must be built upon? In your experience, do you find that some of these principles are less or more important than others?  The text says they are for a team wanting to deliver the highest-quality product they can. If we can regard a motivation as a foundational principle, perhaps that could be it: each of the ten pr

The Great Post Office Scandal

  The Great Post Office Scandal by Nick Wallis is a depressing, dispiriting, and disheartening read. For anyone that cares about fairness and ethics in the relationship that business and technology has with individuals and wider society, at least. As a software tester working in the healthcare sector who has signed up to the ACM code of ethics through my membership of the Association for Software Testing I put myself firmly in that camp. Wallis does extraordinarily well to weave a compelling and readable narrative out of a years-long story with a large and constantly-changing cast and depth across subjects ranging from the intensely personal to extremely technical, and through procedure, jurisprudence, politics, and corporate governance. I won't try to summarise that story here (although Wikipedia takes a couple of stabs at it ) but I'll pull out a handful of threads that I think testers might be interested in: The unbelievable naivety which lead to Horizon (the system at th

Testing and Semantics

The other day I got tagged on a Twitter thread started by Wicked Witch of the Test about people with a background in linguistics who’ve ended up in testing. That prompted me to think about the language concepts I've found valuable in my day job, then I started listing them, and then realised how many of them I've mentioned here over the years .   This post is one of an occasional series collecting some of those thoughts.  --00-- In this series so far we've looked at words and syntax. In both cases we've found that natural language is an imprecise medium for communication. We might know the same words and grammar as others ... but they will have their own idea about what they mean ... and even where we agree there is ambguity ... and all of us, the world, and the language are evolving ... all the time. Today we'll add semantics which, in a pleasing twist, is itself ambiguo

Leaps and Boundary Objects

Brian Marick  recently launched a new podcast, Oddly Influenced . I said this about it on Twitter: Boundary Objects, the first episode of @marick's podcast, is thought-provoking and densely-packed with some lovely turns of phrase. I played it twice in a row. Very roughly, boundary objects are things or concepts that help different interest groups to collaborate by being ambiguous enough to be meaningful and motivational to all parties. Wikipedia  elaborates, somewhat formally:  [boundary objects are] both plastic enough to adapt to local needs and constraints of the several parties employing them, yet robust enough to maintain a common identity across sites ... The creation and management of boundary objects is key in developing and maintaining coherence across intersecting social worlds. The podcast talks about boundary objects in general and then applies the idea to software development specifically, casting acceptance test

Personal Development

The other day I got tagged on a Twitter conversation between a couple of my colleagues, Ben Dowen and Dan Ashby , which ended with Ben citing me as an example: But there is a trap, in that a Dev who Tests, or Tester who codes both risk becoming Test Automators ... The counter argument is Testers who code can do as @qahiccupps does, and use and build tools to explore. A jumble of thoughts tumbled out as I read it and here they are, in no particular order. It is flattering to be mentioned but I'm far from the only person doing this. Maaret Pyhäjärvi   and Rob Sabourin are vocal about the value it can bring and go out of their way to tell and teach others how to get it. Ben is right when he says I use coding as a tool, and as a tool factory. It's a means to an end. Coding itself doesn't give me a lot of pleasure. Having created a useful thing gives me an enormous amount of pleasure. I am not a great developer. But then I rarely need to be.   Yes, I have made bug fixes that