Bridging The Communication Gap
Bridging The Communication Gap
Have you ever wanted a better way to communicate, clarify and satisfy
business requirements? Wouldn't it be great if those requirements
evolved along with the software, always consistent and clear? And those
requirements helped drive development so that we knew when we were
done? With clarity, Gojko describes an elegance and effective way of
achieving this with the whole team: Inventing, thinking and
communicating with specific, insightful examples that also serve as
acceptance tests.
— Rick Mugridge, www.rimuresearch.com, and lead author of ‘Fit for
Developing Software’, Prentice Hall, 2005.
Whether you’re new to testing, new to agile, or an old pro at one or both,
you’ll experience “aha” moments that will inspire your team as you read.
This book will challenge some of your preconceived notions and make
you think. It paves the way for people in different roles, such as business
analysts, QA engineers and developers, to adapt to a more productive
agile approach. From practical ways to improve communication with
customers, to helpful examples of useful test tools, this book is a major
addition to our agile testing knowledge base.
— Lisa Crispin, co-author, ‘Agile Testing: A Practical Guide for Testers
and Agile Teams’, Addison-Wesley Professional 2009
If you’ve tried agile acceptance testing you’ll know that as well as being
really exciting it’s also incredibly difficult. Luckily we now have a book
that helps guide us through the many tricky choices that we face,
practical and pragmatic advice that even the most experienced agile
developer should be aware of.
— Colin Jack, Senior Software Developer, FNZ
Bridging the Communication Gap will not only bring you up-to-date
with the latest thinking about agile acceptance testing, but also guide
you as you put the ideas into practice. This book is packed with insights
from Adzic’s experience in the field.
— David Peterson, creator of the Concordion acceptance-testing
framework
I’m convinced that the practice of agile acceptance testing, done properly,
can make a dramatic improvement to both the communication with the
customer and the quality of the final product. This book is a solid
introduction to the subject, and represents the first attempt I’ve seen to
survey the practice as a whole without focusing on a single tool or
technology.
— Geoff Bache
Bridging the Communication
Gap
Specification by Example and Agile
Acceptance Testing
Gojko Adzic
Bridging the Communication Gap: Specification by Example
and Agile Acceptance Testing
Gojko Adzic
Copy-editor: Marjory Bisset
Cover design: Boris Marcetic
The author has taken care in the preparation of this book, but makes no expressed or implied warranty
of any kind and assumes no responsibility for errors or omissions. No liability is assumed for incidental
or consequential damages in connection with or arising out of the use of the information or programs
contained herein.
All rights reserved. This publication is protected by copyright, and permission must be obtained
from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission
in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For
information regarding permissions, write to:
Neuri Limited
25 Southampton Buildings
London WC2A 1AL
United Kingdom
ISBN: 978-0-9556836-1-9
Table of Contents
About the PDF edition ............................................................... ix
Acknowledgements ................................................................... xi
About the author ..................................................................... xiii
Introduction ............................................................................. xv
Why should you care? ...................................................... xvi
Who is this book for? ...................................................... xvii
What will you get out of this book? ................................. xviii
What's inside? ................................................................. xix
Giving credit where credit is due ...................................... xxi
How this book is organised ............................................. xxii
I. The Communication Gap ........................................................ 1
1. The next bottleneck in software projects .......................... 3
The telephone game .................................................... 5
Imperative requirements are very easy to misunder-
stand .......................................................................... 8
Are obvious things really obvious? .............................. 9
A small misunderstanding can cost a lot of
money ...................................................................... 14
Fulfilling specifications does not guarantee
success ..................................................................... 15
Requirements are often already a solution ................. 18
Cognitive diversity is very important ......................... 20
Breaking The Spirit of Kansas ................................... 21
2. Finding ways to communicate better .............................. 25
Challenging requirements ......................................... 25
We really communicate with examples ...................... 26
Working together, we find better solutions ................ 28
Communicating intent ............................................. 29
Agile acceptance testing in a nutshell ......................... 31
So what does testing have to do with this? .................. 34
Better names ............................................................ 38
II. Building and Maintaining a Shared Understanding ............... 41
3. Specifying with examples ............................................... 43
How do you brush your teeth? ................................... 43
A practical example .................................................. 45
v
Bridging the Communication Gap
vi
8. Starting with agile acceptance testing ........................... 141
Agile acceptance testing in the context of the develop-
ment process ........................................................... 141
Fitting into iterations .............................................. 144
Igniting the spark ................................................... 148
Don't mention testing ............................................. 150
Adopting in phases ................................................. 151
Choose a facilitator for the workshops ..................... 152
Hire a mentor ......................................................... 154
Avoid the cargo cult mentality ................................. 155
9. Planning with user stories ............................................ 159
User stories in a nutshell ......................................... 160
How are stories different from more traditional
methods? ................................................................ 161
Benefits of user stories ............................................ 162
Three Cs of user stories ........................................... 164
Project planning ..................................................... 165
User stories and acceptance tests ............................. 169
10. Tools of today ........................................................... 173
FIT ......................................................................... 173
Concordion ............................................................ 179
JBehave .................................................................. 181
TextTest ................................................................. 183
Selenium ................................................................ 187
11. Tools of tomorrow ..................................................... 193
Domain-specific languages ...................................... 193
Different user interfaces for different roles .............. 195
Propagating the effects of changes ........................... 196
Direct domain mapping .......................................... 198
Better editors .......................................................... 199
Better test organisation ........................................... 200
Visual workflow descriptions .................................. 201
IV. Effects on all of us ............................................................. 203
12. Effects on business analysts ........................................ 205
Benefits for business analysts .................................. 206
Challenges for business analysts .............................. 209
13. Effects on testers ........................................................ 217
The new role of the tester ........................................ 217
vii
Bridging the Communication Gap
viii
About the PDF edition
If you are reading this book in a print edition, you should know that
there is a PDF version available, and you might find it useful to get
an electronic copy as well. I've decided to make this book available as
a PDF so that the readers can get the most out of it. Judging from the
sales of my previous book, many people today prefer reading technical
texts in an electronic form so that they can search through the content,
copy and paste text and archive the material more easily.
If you are reading this as a PDF, please note that this material is
copyrighted and it is not for free distribution. I have no intention of
chasing people for redistributing the book, but if you have received
this PDF from someone and you found it useful, consider actually
purchasing your own copy. The PDF edition is relatively cheap and
your purchase will support similar efforts in the future.
http://www.acceptancetesting.info
ix
x
Acknowledgements
This book is a result of a small independent publishing effort, and as
such would not be possible without the help of many people.
I'd like to thank Antony Marcano, Bob Clancy, Colin Jack, David
Peterson, David Vydra, Eric Lefevre-Ardant, Gennady Kaganer, Geoff
Bache, Jennitta Andrea, Lisa Crispin, Marisa Seal, Mark Needham,
Melissa Tan, Mike Scott, Phil Kirkham and Rick Mugridge for all the
excellent suggestions, helping me keep this book focused and
providing insight into their views and experiences. Without you, this
book just would not be possible.
Marjory Bisset from Pearl Words again did a great job of copy–editing
this book and ensuring that readers have a much more enjoyable
experience with it.
Finally, I'd like to thank Boris Marcetic from Popular for designing
the covers.
xi
xii
About the author
Gojko Adzic runs Neuri Ltd, a UK-based consultancy that helps
companies build better software by introducing agile practices and
tools and improving communication between software teams, stake-
holders and clients. His programming story so far includes equity
and energy trading, mobile positioning, e-commerce, betting and
gaming and complex configuration management.
xiii
xiv
Introduction
I am getting more and more convinced every day that communication
is, in fact, what makes or breaks software projects. Programming
tools, practices and methods are definitely important, but if the
communication fails then the rest is just painting the corpse. Complex
projects simply have no chance of success without effective commu-
nication.
Ward Cunningham and Ken Auer used the basic ideas behind agile
acceptance testing to nail down what their users wanted in 1999.1
Almost a decade later, the practice is still used only by a small group
of early adopters. However, it has matured considerably. Judging
from recent conferences, magazine articles and blog posts, it seems
to me that interest is growing and the time is right for a wider group
to learn about and adopt it. You probably agree, which is why you
picked up this book.
1
See Don't just break software, make software[1]
xv
Introduction
These are the most important benefits for product owners, business
analysts and project managers:
xvi
Who is this book for?
Although agile teams generally strive for less role-naming than those
practising traditional processes, I use the role names product owner,
business analyst, software developer and tester in this book and discuss
how each of these roles is affected by agile acceptance testing and how
they participate in writing specifications by example. Companies in
transition with teams coming from a more traditional background
will have all these roles clearly defined, sometimes isolated into
different departments, buildings or even countries. Most agile
programming literature is written by software developers for software
xvii
Introduction
As with any other new and relatively radical idea, learning how to
apply it effectively in your own role is only part of the challenge. Agile
acceptance testing requires active participation and affects the jobs
of programmers, business analysts, testers and to some extent project
managers. Because of this, it also raises a lot of concerns and it is
unfortunately subject to many misconceptions. These problems are
typically fuelled by partial information, misunderstandings and fears
of change. One of my primary goals with this book is to dispel these
2
http://download.microsoft.com/documents/uk/msdn/architecture/architectinsight/2007/Life-
cycle/LIF02-The-Agile-Template-for-VSTS.ppt.
xviii
What's inside?
misconceptions and address fears and issues that people often have
about agile acceptance testing.
This book will help you to discover how agile acceptance testing affects
your work whether you are a programmer, business analyst or a tester.
It will help you gain an understanding of this technique and offer
ideas on how to convince other team members and stakeholders to
use it. I hope that this book takes into account the various perspectives
of these different roles. It is intentionally not too technical or suited
only for programmers, because agile acceptance testing is not a
programming technique: it is a communication technique that brings
people involved in a software project closer. I consider myself
primarily a programmer and my personal biases and experiences will
surely show. I have, however, found a much broader perspective on
agile acceptance testing as a result of working with different teams,
consulting, mentoring and giving public talks. Discussing fears such
as losing jobs with testers over coffee, participating in requirements
gathering, working as a product owner and even as a business domain
expert on several projects has hopefully given me the understanding
necessary to represent the needs and views of the other roles.
What's inside?
I am very proud of the fact that I have helped several companies adopt
agile acceptance testing and specification by example and deliver
xix
Introduction
successful software over the last few years. This book is a summary
of my experiences, learnings and ideas from this journey. It is based
on projects that are now happily running in production and a series
of public and private seminars, talks and workshops that I organised
during this period.
This book is not a detailed user manual for any acceptance testing
tool. Although I will describe briefly some of the most popular tools
in Chapter 10, I intentionally want to keep this book relatively non-
technical and absolutely not tool or technology specific. Often I hear
from managers that their teams looked into this or that tool and that
they did not like it a bit, so they rejected the whole idea of agile
acceptance testing. One of the main messages I want to convey with
this book is that the biggest benefit of agile acceptance testing is
improved communication and mutual understanding, not test auto-
mation. There is too much focus on tools today and in my opinion
this is quite wrong.
While you are reading this book, it's important to focus on the ideas
and principles. The process and the tools described in the book are
there just to assist. If you do not like a particular tool, find a better
one or automate things yourself in a way that makes sense for your
team. If you do not like some part of the process, adjust it or replace
it with something that makes more sense for your team. Once you
understand the underlying ideas, principles and practices, applying
them in your environment should be easy. Use the process described
in this book just as a guide, not as a prescription.
This book also does not have all the answers about agile acceptance
testing and specification by example. These two practices are currently
gaining a lot of momentum and generating a lot of new ideas. Because
there is very little published material on them at the moment, you
xx
Giving credit where credit is due
will see many more references to conference talks, blog posts and
online video clips than to books or articles. Apart from the practices
as I use them today, this book also describes some promising ideas
that I want to try out in the near future. It even contains some inter-
esting views of other people that I do not agree with completely. Some
of them might prove to be interesting in the future with better tools
or be applicable in a different environment. In Chapter 11 I speculate
how the tools for agile acceptance testing tools might evolve. Blogs,
mailing lists and sites listed in Appendix A will help you continue the
journey and keep up-to-date with new advances.
xxi
Introduction
Agile acceptance testing is more than the sum of all these ideas and
practices. It is an approach to software development characterised by
a focus on communication and the creation of an understanding of
the domain shared by all implementation team members and
customers.
xxii
How this book is organised
practices do not really solve the problem but only provide work-
arounds. Then I introduce agile acceptance testing as the solution to
these problems.
In Part IV, I deal with the human side of this practice, explaining how
it affects our jobs and the way we work. I analyse the effects on busi-
ness analysts, testers and developers. The chapter on the effects on
business analysts is also applicable to customers or other business
people involved in software projects. In this part we also revisit the
benefits listed in section Why should you care? on page xvi and see
how the principles and practices described this book deliver them.
xxiii
xxiv
Part I. The Communication Gap
Effective communication is the key to successful software projects. In this
part, we set the stage by looking at common communication problems
on software projects, analysing what happens when communication is
impeded and how we can improve the flow of information.
Chapter 1
Of course, this problem is nothing new. Fred Brooks wrote long ago
that “The hardest single part of building a software system is deciding
precisely what to build”[2]. Practices used in the creation of traditional
system requirements documents and specifications have changed
very little over the last decade. Some techniques such as user stories
touch upon what we should do to get better specifications and
requirements, but they fall short of completing the task to the end.
The process of eliciting requirements and communicating them
throughout the process to everyone involved is often just described
in vague terms and left to teams to work out for themselves. With
programming practices and project planning now pretty well sorted,
this issue is becoming more and more apparent and many teams
realise that they struggle with it. This problem is the next bottleneck
to be removed from the software development process.
3
The next bottleneck in software projects
A nice thing about software development the agile way is that we can
easily go back and adjust the system, but making changes is not as
cheap as most programmers would like it to be. It costs a lot of money
and time. For those of you who would now suggest that using agile
practices makes this cheap, don't forget that you are only talking about
the technical cost. Agile practices help us cope with clients changing
their minds for whatever reason, so that in a sense we are hitting a
moving target. There is a huge difference between this and missing
a still target and then going back to have another go at hitting it. Even
if the requirements don't change, there is still a risk that the project
can miss a target if we don't solve the communication problems.
Although agile practices help a lot with reducing the risk of failure,
they should not and cannot be used to cover up for a project that
simply does not deliver what it was supposed to. Disappointing a
client is never good, agile or not agile. Gerald Weinberg and Donald
Gause suggest that the difference between disappointment and delight
is not a matter of delivering software, but how well the delivery
matches what clients expected.1 This was true twenty years ago when
they wrote Exploring Requirements[3], and it still holds true today.
1
See chapter 18 of Exploring Requirements[3]
4
The telephone game
We all need to agree on what the target is, even if it moves, and make
sure that we all have the same understanding. And by we I mean all
participants in the process from stakeholders to domain experts,
business analysts, testers and developers. The path to success is to
ensure that these small communication problems get rooted out
instead of accumulating, so that the message gets delivered correctly
and completely.
In theory, this works just fine and everyone is happy. In practice, this
process is essentially flawed and the usual result is a huge difference
between what was originally requested and what gets actually
delivered. There can be huge communication gaps at every step.
Important ideas fall through these gaps and mysteriously disappear.
After every translation, information gets distorted and misunderstood,
magnifying the degree of wrongness of the delivered system. A tester's
independent interpretation might help to correct the false interpret-
ations of developers, or it might very well be a completely different
misinterpretation of the system requirements.
5
The next bottleneck in software projects
2
http://www.testingreflections.com/node/view/7232
6
The telephone game
Such differences between what was asked for and what was developed
may also come from unclear or inconsistent requirements. Code is
unforgiving with regards to specifying how something should work.
On this level, we have to define exactly how the system should behave.
Once developers start writing code, gaps in functionality become
obvious. Unfortunately, getting to domain experts or business people
who wrote the specifications at this point may take a while. In the
best case, developers need to get the person on the phone or chase
her by e-mail. If the person in charge is an external customer or an
executive project sponsor, they might not be readily available to talk
and it might take a few days to get the right information. In some
extreme cases, it is nearly impossible. During a workshop I organised
for a large media company, one of the developers said that their
business analysts actually refuse to discuss requirements after they
were handed over to development. According to their process, the
job of business analysts was done at that point.
Because developers need to specify how the system works in the newly
identified case and they need to seek out this information, the time
to complete a piece of code increases from several minutes to several
hours or several days. When the gaps are finally cleared up, the
original specification document again may not reflect the full reality.
There is at least some new functionality not covered by the document,
or it may even conflict with the original requirements.
Later on, when requests for changes and improvements start coming
in, especially if the product has several clients with different require-
7
The next bottleneck in software projects
The problem is, of course, that not even the brightest among us can
keep track of all the previous requirements and all the changes in
their minds for a long period of time. Realistically, it's not sane to
expect someone to remember all 500 pages of a specification document
and instantly spot that a new change request might break an earlier
rule. This becomes even harder when the people involved in the
original project move on to other things and are replaced. With big
requirements documents, consistency can be a problem even in the
initial phase, since they might be the result of several days of discus-
sions with different people, and are sometimes written by several
people.
8
Are obvious things really obvious?
3
http://www.au.af.mil/au/awc/awcgate/milreview/shattuck.pdf
9
The next bottleneck in software projects
4
http://gojko.net/2008/08/29/how-many-points-are-there-in-a-five-point-star/
10
Are obvious things really obvious?
the same place. The two votes for fifteen are still a mystery to me.
Bob Clancy suggested that this might be a classic example of the
original problem being restated by the individual and than the restated
problem solved: if the star is drawn with lines crossing in the inside
of the star and then a point counted wherever two lines intersect,
people might count the points in the inner pentagon twice (although
they are the same as the five inner points).
Some readers are now probably asking themselves what is the right
answer. In general, there is no right answer. Or more precisely, all of
these answers are correct, depending on what you consider a point.
In software projects, on the other hand, there is a single correct answer
in similar situations: the one that the business people thought of. And
for the project to turn out just the way that customers want, this
answer has to come up in the heads of developers and testers as well.
This is quite a lot of mental alignment. Forty cards are not a sample
large enough for statistical relevance, but this experiment has
confirmed that even a simple thing such as a familiar image and a
straightforward question can be interpreted in many different ways.
11
The next bottleneck in software projects
Imagine that you are part of a software project that calculates prices
for gold-plating various metal pieces. This may be a contrived
example, but let's keep it simple for now. One of the requirements,
in its classical imperative form, states that “the system shall let the
users enter a diameter and the number of points of a star-shaped
metal piece and calculate the price of gold-plating based on materials
(total piece surface area using prices in appendix A) and complexity
(number of edges using prices in appendix B)”. We have the prices
and formulas precisely defined in imaginary appendices and the
business analyst has spent a lot of time getting these absolutely clear
with the customers, because this is where the money is. Developers
should be able to work out the rest easily from the number of points
in the star and the diameter and testers should be able to compare
the test results to expected results easily. After all, everything is
specified precisely and we only have to do a bit of elementary
geometry. Right? Well, not exactly.
12
Are obvious things really obvious?
ness person making the request, but I would not bet on it. Work out
the probabilities from the experiment, and you'll get about a 39%
chance for this to happen. A tester will need to verify the result which
asks for another mind alignment and brings down the probabilities
to 20%. Again, I don't claim that this number is statistically significant
and describes a general success ratio, but whatever the precise figures
the probability falls exponentially with the number of participants
that need to have their minds aligned. Problems like this often don't
come to light before development because they are subtle and hidden
behind things perceived as more important such as the price of gold-
plating per square inch. We think that we don't have to be precise
about things that everyone understands during analysis, because it's
common sense how to draw a star with a number of points. The rules
for the surface area should be clear from basic geometry. Let's
disregard all the weird answers and consider just the fact that some
people in the experiment counted only outer points, and some counted
both outer and inner points. How would you test whether the system
works correctly if 12 was given as the number of points? Is the correct
star the one on the left or one on the right in Figure 1.3?
Things like this, where we feel familiar with the concept and implicitly
think that others have the same understanding of it as we do, are one
of the core causes of missing the target in software projects.
13
The next bottleneck in software projects
This worked fine until one day someone found out how to make
money out of it. For the sake of the story, let's say that the exchange
rate was 0.54 pounds to a dollar. So 0.01 pounds would convert to
0.02 dollars, but a single cent would convert to a single penny – 0.0054
rounded to two decimals is 0.01. Because of the rounding, you could
convert a single penny into two cents, then convert the first cent back
14
Fulfilling specifications does not guarantee success
to a penny, then convert the second cent into another penny and end
up with twice the money you started with. Yes, it is just one penny
more, but the guy who worked this out wrote a script to do the dirty
job and apparently took more than ten thousand pounds before the
fraud was discovered.
When the news about this broke, business people argued that the
amount should have been rounded down and that the developers
should have known this, but the developers argued that they received
a request to round to two decimals without any specifics. The
requirement to round to two decimals sounds obvious and unambigu-
ous, just as did the question about the number of points in the star.
In any case, the blame game does not solve the problem. We need to
prevent problems like this by ensuring that developers and business
analysts have the same understanding of ‘rounding to two decimals’.
The question needs to be raised before the development starts, not
after it is in production, when someone finds a hole in the system.
15
The next bottleneck in software projects
of the story, if you don't know what a product owner is, think of it as
a business analyst.) There were two sets of construction bricks and
dominoes, placed on two halves of a large table with a large white
paper screen blocking the view in between, as shown in Figure 1.4.6
A person sitting at one side of the table could not see anything on the
other half. The aim of the workshop was to demonstrate how the
requirements and testing processes fail when communication is
impeded, even with something as simple as a domino construction.
At the start of the workshop, the product owner, the developer and
the tester left the room. Mantel put together a simple construction
on one half of the table with the customer, aligning the dominoes so
that they all fell when a small lead ball was rolled down one of the
bricks and bounced against another brick then the first domino. There
were lots of other bricks in the construction, but the primary business
goal was to make all the dominoes fall when the ball was rolled.
The product owner then walked into the room, looked at the
construction and discussed it with the customer. Then the developer
and the tester walked into the room. The developer was placed at the
other half of the construction table, unable to see the original
construction. The tester was placed on a different table, facing the
construction table backwards and unable to see what was going on.
This was intended to simulate the situation where a product owner
acts as a customer representative and testers have no influence over
development.
6
The photograph is © Eric Lefevre, used with his permission
16
Fulfilling specifications does not guarantee success
The interesting thing was that the product owner never asked the
customer about the goal of the construction, so he was not able to
communicate anything in this respect. This was not forbidden by the
rules of the game, it just never happened. When the exercise ended,
the customer said that the ordering of dominoes, alignment of bricks
by colour and all the extra bricks on the table were not really
important and that he would have accepted the construction if these
were different providing the dominoes fell after the ball was rolled.
17
The next bottleneck in software projects
The tester was just asked to approve or reject the release without really
understanding what the project was about, based just on the
specification put together by the product owner. So her contribution
was left to pure chance as well. She did reject the release, but for the
wrong reasons. In this case, it was lucky that the developer did not
build the construction exactly as the product owner required, other-
wise the tester would have approved the release. The result would
have been correct in terms of the specifications, but would have
completely missed the business goal.
Describing how and what but not why left the success of the project
to pure chance. Instead of producing traditional specifications and
requirements, we should really focus more on getting the communic-
ation right. Involving developers and testers from the start,
communicating business goals to everyone and removing communic-
ation obstacles is the way we can take control of projects, and not
leave success or failure to pure chance.
18
Requirements are often already a solution
rules and user interfaces and not on the infrastructure to support it.
Because business people lack deeper technical understanding of
implementation details, their proposed solution is sometimes much
more complicated than it needs to be. It it is not uncommon for a
technical person to suggest a much simpler solution once they know
what the problem is.
19
The next bottleneck in software projects
7
http://en.wikipedia.org/wiki/Groupthink
20
Breaking The Spirit of Kansas
the picture more, moving around to measure the lines again. About
70% of the subjects changed their answer at least once and one third
of the subjects went along with the group at least half the time. Asch
repeated the experiment with at least one of the collaborators selecting
the correct answer. This immediately encouraged the experiment
subjects to say what they really thought and “the rate of conformity
plummeted”. This experiment demonstrates the effects of peer pres-
sure and how people are generally reluctant to state their opinion if
it is contrary to all the other opinions in the room. It also demon-
strates that the situation changes dramatically even when a single
different opinion exists.
Surowiecki also states that even small groups of five to ten people can
exhibit what he called the wisdom of the crowds, reaching a state
where the group together is smarter than any individual in the group.
Cognitive diversity and independence of opinion are key factors in
achieving this. People should think about the problem from different
perspectives and use different approaches and heuristics. They should
also be free to offer their own judgments and knowledge rather than
just repeating what other people put forward. By getting different
people involved in the specification process, we can get the benefits
of this effect and produce better specifications.
8
http://edition.cnn.com/2008/US/06/06/crash.ap/index.html
21
The next bottleneck in software projects
Stuff to remember
• The traditional specifications and requirements processes
now established in the software industry are inadequate
and essentially flawed.
• Specifications do not contain enough information for
effective development or testing, they are prone to
9
See A Measurable Proposal by Tom Davenport[7].
22
Breaking The Spirit of Kansas
23
24
Chapter 2
Finding ways to
communicate better
In order to bridge the communication gap, we need to work on
bringing business people and implementation teams together rather
than separating them with formal processes and intermediaries. Ron
Jeffries said, during his session on the natural laws of software
development at Agile 2008, that the most important information in
a requirements document are not the requirements, but the phone
number of the person who wrote it. Instead of handing down
incomplete abstract requirements, we should focus on facilitating the
flow of information and better communication between all team
members. Then people can work out for themselves whether the
information is complete and correct and ensure that they understand
each other.
Challenging requirements
Since requirements, however clearly expressed, may contain gaps and
inconsistencies, how do we fight against this problem before develop-
ment rather than discovering it later? How do we ensure that
requirements, regardless of their form and whether or not they are
built up incrementally before every iteration, are complete and
correct? Donald Gause and Gerald Weinberg wrote in Exploring
Requirements[3] that the most effective way of checking requirements
is to use test cases very much like those for testing a completed system.
They suggested using a black-box testing approach during the
requirements phase because the design solution at this point still does
not exist, making it the perfect black box. This idea might sound
strange at first and it definitely takes a while to grasp. In essence, the
idea is to work out how a system would be tested as a way to check
25
Finding ways to communicate better
26
We really communicate with examples
This close link between requirements, tests and examples signals that
they all effectively deal with related concepts. The problem is that
every time examples show up on the timeline of a software project,
people have to re-invent them. Customers and business analysts use
one set of examples to discuss the system requirements. Developers
come up with their own examples to talk to business analysts. Testers
come up with their own examples to write test scripts. Because of the
effects illustrated by the telephone game, these examples might not
1
Many thanks to Jennitta Andrea for pointing this out to me
27
Finding ways to communicate better
describe the same things (and they often do not). Examples that
developers invent are based on their understanding. Test scripts are
derived from what testers think about the system.
2
http://www.infoq.com/presentations/Fowler-North-Crevasse-of-Doom
28
Communicating intent
If we help each other understand the goal better, then we will come
up with better solutions. This is why building a shared understanding
of the goal is one of the key practices in software development.
Communicating intent
The communication of goals was at the core of Prussian military
tactics as a response to the dangers posed by Napoleon's invincible
army. The Prussian leaders figured out that they did not have a single
person capable of defeating Napoleon's genius, so they focused on
allowing the individual commanders and their troops to act collect-
ively to better effect. They made sure they told the commanders why
something needed to be done and they put this information into the
perspective of overall goals, rather than just passing down a list of
imperative commands. The resulting military doctrine was called
Auftragstaktik, or mission-type tactics, and it was key to the great
successes of Prussian and later German armies. Today it survives as
Mission Command in the US Army.
29
Finding ways to communicate better
I was recently involved in a project where the clients said that they
wanted real-time reporting on transactions in a highly distributed
system. The system was being developed for batch reporting and
introducing real-time reporting required a huge redesign, possibly
even a major change to the infrastructure. Instead of challenging this
requirement, the CTO of the company started to design a solution
on the spot, immersing himself in a tough technical problem which,
for him, was a pleasure to play with. I asked what the clients wanted
to achieve with real-time reports and we came to the conclusion that
they wanted to present up-to-date information to their partners during
the working day, not just overnight. A delay of one hour was perfectly
acceptable for this, without the need to redesign the system from
scratch or invest a lot of money in real-time infrastructure, especially
since real-time reporting on live transactional data would have seri-
ously impacted the performance of the transaction processing service.
In this case, the issue was with the meaning of word ‘real-time’. For
the customers, it meant ‘updated several times per day’ but for
programmers it meant ‘millisecond correctness’.
The moral of this story is that requirements should not really be taken
at face value, especially if they come in the form of a solution that
does not explain what the intent is (see the section Requirements are
often already a solution on page 18). Teams often consider require-
ments as something carved in stone that has to match exactly what
the customers demand. In fact, customers will often accept a different
3
See page 225 of [4] and http://handle.dtic.mil/100.2/ADA225436
30
Agile acceptance testing in a nutshell
31
Finding ways to communicate better
32
Automate verification of the acceptance tests
33
Finding ways to communicate better
examples to describe all the edge cases. When all the examples are
implemented so that the system works as they describe, the job is
done. To developers this might sound similar to unit testing, because
it essentially tries to do the same thing on a higher level (but accept-
ance tests are not a replacement for unit tests). I talk about this step
in more detail in Chapter 6.
And repeat
These steps are continuously repeated throughout the project to
clarify, specify, implement and verify small parts of the project iterat-
ively and incrementally. In Chapter 8 I explain how this fits into the
overall development process in more detail.
34
So what does testing have to do with this?
The practice of unit testing was so useful that it was only logical to
ask whether the same could be applied to business rules and drive
whole phases of projects rather than just code units. Unit tests focus
on code so they are completely in the domain of software developers.
Business rules, on the other hand, should not be defined by developers.
They have to be defined by domain experts and customers. But busi-
ness domain experts rarely understand programming languages, so
using the same tools to drive implementation of business rules and
code units typically fails. Developers could write business rule tests
with unit test tools, but these tests would only reflect what developers
understand and they would still be affected by all the communication
problems presented in Chapter 1. In order to get the best specifica-
tions, customers and implementation teams have to work together.
There is simply no way for a business person to verify that a
developer's test describes the end goal correctly with unit test tools.
So, in theory, the ideas behind unit testing could be applied to business
rules as well, but in practice the tests are impossible to communicate.
To solve the problem, better ways for specifying and automating tests
for business rules were needed that could also be used to communicate
with business people. Such tools would have to focus on capturing
the customers' view of what the system should do when it is finished,
effectively the functional acceptance criteria for the project. Then we
35
Finding ways to communicate better
could apply unit testing ideas by developing code to satisfy tests and
running these tests to verify that the code is on target, then repeating
the process until all tests go green. This is where the name agile
acceptance testing comes from. This practice started by expanding
the unit testing ideas to business rules, effectively specifying the
acceptance criteria in a form that could be executed as tests on the
code.
Today, the name of this practice itself has become a major obstacle
to its adoption. The chief business analyst of a company I recently
worked with just rejected getting involved in the practice, with the
explanation “I do not write tests”. The word testing unfortunately
bears a negative connotation in the software development world. In
all the companies I worked for, testers were among the least well-paid
employees, right down there with the support engineers. Starting a
discussion on testing somehow seems to give business people the
green light to tune out. It is like a signal that the interesting part of
the meeting is over and that they can start playing Sudoku or thinking
about more important things. After all, testing is not something that
they do.
36
So what does testing have to do with this?
programmers and testers. They are also the ones that need to make
decisions about edge cases and answer tough questions about business
rules. So they very much have to ‘do tests’.
4
http://www.exampler.com/old-blog/2003/08/21/
37
Finding ways to communicate better
Better names
Dan North suggests using the word ‘behaviour’ instead of ‘test’,5 as
a way to clear up a lot of misunderstandings. Instead of test-driven
development, he talks about behaviour-driven development to avoid
the negative connotation of testing. This trick has solved the problem
of keeping business people awake quite a few times for me as well.
Behaviour-driven development (BDD) is just a variant of agile
acceptance testing, in my opinion. Some people will disagree, pointing
out the differences in tools and format of test scripts. For me, the
underlying principles are the same and BDD tools are just another
way to automate tests. BDD also promotes a specific approach to
implementation,6 but this is not really important for the topic of this
book. Again, I consider tools and tests to be of less importance than
communication and building a shared understanding.
5
http://dannorth.net/introducing-bdd
6
See http://behaviour-driven.org/ for more information
38
Better names
In any case, I want to point out that there are a lot of different names
and ideas emerging at the moment, but they are all effectively different
versions of the same underlying practice. This book is about the
underlying values, practices and principles that all these names and
ideas share.
Stuff to remember
• Realistic examples are a great way to communicate, and
we use them often without even thinking about it.
• Requirements, tests and examples all talk about the
same thing – how a system will behave once it is
delivered.
• We can use examples consistently throughout the project
to avoid the effects of the telephone game.
• Building a shared understanding of the problem is one
of the key practices in software development.
• Business intent is one of the most important things that
a customer or a business analyst should pass on to the
developers and testers.
• Cross-functional teams create much better specifications
and requirements than business people in isolation.
• Agile acceptance testing uses these ideas to solve
communication problems on software projects.
• The name agile acceptance testing is misleading but has
been generally adopted.
• Agile acceptance testing is very different from user
acceptance testing, and in general it is not about testing
at all. It is about improving communication and building
a shared understanding of the domain.
• Implementing agile acceptance testing can be a real
organisational challenge.
39
Finding ways to communicate better
40
Part II. Building and Maintaining
a Shared Understanding
Using examples as specifications consistently throughout the project helps
to avoid the effects of the telephone game and enables us to truly build a
shared understanding of the system. In this part, we look into the roles
of examples from specifications through development and testing to
becoming a live documentation on the system. We also look into practices
that enable us to get the most out of those examples.
Chapter 3
Specifying with
examples
The first stage of agile acceptance testing is to make sure that we all
know what we are talking about and more importantly to agree on
this. Before a phase of development, be it an iteration, a mini-project
or simply a chunk of software whose time has come, we specify what
we expect out of it. We specify this in the form of real world examples,
not with abstract requirements. The examples demonstrate how the
system should act and how it should help users do their jobs. These
examples are created by the whole implementation team, not by a
single domain expert as in the traditional model. We use the examples
to discuss the domain and make sure that there are no misunderstand-
ings.
1
http://www.solutionsiq.com/agile2008/agile-2008-domain.php
43
Specifying with examples
look similar to the picture in Figure 3.1 to someone who has never
seen a toothbrush before.
44
A practical example
with images and even some videos – I have not found a single site in
the first few result pages that does it only with words.
A practical example
One of the best ways to ensure that people understand each other is
to demonstrate various differences in possibilities with realistic
examples. In the poker example in the section A small misunderstand-
ing can cost a lot of money on page 14, if there had been a discussion
between developers and business people including the case where a
cent is rounded to a penny, the business analysts would have spotted
the issue straight away. Abstract requirements and specifications are
not a good tool for communication. Real-life examples are much
better.
45
Specifying with examples
about such an issue. This is a question for the business people because
it is a manifestation of their business model. Maybe they want to pay
a pound, maybe they want to wait for people to accumulate 1000
clicks. Both options are valid from a technical perspective, but there
is only a single valid option from the business perspective. If we leave
this question to developers to decide, there is a big chance that they
will not select the same option as the customers did.
Problems like this one are not really bugs in the classical sense – they
are caused by misunderstandings of business rules. The code might
be completely correct from the unit testing perspective, but still miss
the business target. This is where real-world examples come in. Instead
of an abstract requirement such as ‘pay 2 pounds per 1000 clicks’, we
need to identify interesting realistic cases and then discuss what
happens in these cases.
For a start, it is very rare for a web site to get a nice round number of
clicks. So a much more realistic case would be to have something like
7672 clicks during a day. What do we do with this number of clicks?
Do we round it down and pay 14 pounds, or do we round it to 8000
clicks and pay 16 pounds? Maybe just scale it and pay 15.34 pounds?
I like to throw in edge cases as well. Should we pay anything for 999
clicks? What happens with just one click? Discussing edge cases like
these would have pointed out the problem with 1 cent in the foreign
exchange story.
46
A practical example
We then get the customers to give us values that they expect to pay
in these situations:
Discussing cases like these often raises more questions and reveals
other interesting examples. Because we don't pay anything for 999
clicks, it is not really fair to the affiliates to simply ignore their total
if they are missing a single click. In this case, the next question might
be should we let the the 999 clicks roll over to the next day or do we
reset the counter to zero for tomorrow? Maybe the clients are not too
bothered with small web sites, they only want to focus on big advert-
isers who will have several thousands of clicks per day, so discarding
this small remainder is not a big issue. Or maybe they also want to
please the small advertisers, who will rarely have more than a thousand
clicks on a day, but would appreciate being paid for the accumulated
clicks. So we can create a few more examples on the whiteboard and
discuss them:
47
Specifying with examples
48
Realistic examples make us think harder
Realistic examples contain precise information and they ask for precise
answers. This often makes people think harder and not just brush the
question off. It is not uncommon for people to disagree on edge cases
during the discussion and actually fine-tune their business processes.
I remember a situation where we discussed selling media clips online
and asked what should happen if a customer wanted to buy a $10 clip
but only had $9.50 in his account. Although the first response was
that the sale should be refused, the CEO of the client company decided
that it made more sense to allow the purchase to go through and to
put the account into negative balance by 50 cents. This would increase
sales and the customer would have to top up the account anyway
before the next purchase. Developers and testers can sometimes
provide a completely different perspective on a business problem.
49
Specifying with examples
2
in a private e-mail
50
Identifying important examples
1. normal use
2. abnormal but reasonable use
3. abnormal and unreasonable use
Team members often know about edge cases and potential problems
and even know how to resolve them, but they need to communicate
them effectively. Had the team members communicated their prob-
lems and concerns effectively, the plane described in the section
Breaking The Spirit of Kansas on page 21 might still be flying. To
avoid expensive crashes like these in our software, we should all focus
on flushing out as many of these important examples as we can.
Testers in particular are expected to suggest examples that demon-
strate problems which they would typically check in later testing. In
the next chapter, I introduce the specification workshop, which
facilitates such a discussion.
51
Specifying with examples
first whether they are realistic or not. Keep in mind that there is a
difference between unreasonable and unrealistic. We don't want to
waste time discussing imaginary cases that are not important for the
system.
Consider these few examples for an online flower shop that offers
reusable free delivery vouchers to VIP clients when they make a single
purchase over $50:
52
Differences in similar examples
The workflow steps and user names are not really important for these
rules. Instead of writing down each scenario as a separate example,
we could just have a single list that specifies something like this:
Writing things down like this makes it easier to spot some other
interesting cases that need to be discussed. Obviously, we could write
an example for a VIP customer from the UK that has only $30 worth
of flowers in the cart. But there are some specification gaps that are
less easy to spot, and the table uncovers them as well. For example,
what do we do when someone has an unused free delivery offer, but
they are a VIP customer and have more than $50 of flowers in the
shopping cart? Do we keep the free delivery offer for the next time?
What if they don't decide to use free delivery this time as well – do
we allow them to keep two offers of free delivery for later or just one?
What happens if for some reason a UK customer has a free delivery
offer? How can this happen (perhaps we let someone change their
address but keep a free delivery offer), and should we disable this
option in this case? Ideally we want to flush out these important
examples while we have business experts available to discuss them
immediately.
53
Specifying with examples
54
Dealing with processing workflows
55
Specifying with examples
Seeing the big picture is also important from the aspect of identifying
functionality gaps. If three out of four decision points consider
whether someone is a VIP customer or not, just ask whether the fourth
decision point should be concerned with this as well. Maybe yes,
maybe no, but let's make sure.
3
http://gojko.net/2007/12/04/waterfall-trap/
56
Working with business workflows
1. Given preconditions
2. When actions or triggers
3. Then consequences
1. Given the customer has a balance of $0, and the customer has a
deposit transaction for $10 and the transaction is in the authorisa-
tion state
2. When an AUTH-8440 message comes from the bank
3. Then the transaction is accepted and the customer has a balance
of $10
I find that tables are more useful for expressing specifications, state
machine transitions and calculation-based rules. The expressiveness
of natural language and the sequential style of writing help to get a
better understanding of the process for workflows. Again, this format
may seem familiar to people who use BDD tools, but this is irrelevant.
Even if you do not plan to use a BDD-style tool, try to write business
workflow examples in this format because it will enable you to have
a more meaningful discussion about them. Each flow example should
57
Specifying with examples
focus on a single rule, so that the discussion can focus on this as well.
If larger flows are written as a single example, it's often hard to keep
track of the context and it becomes easy for ambiguity and hidden
complexities to pass undetected.
Stuff to remember
• Instead of abstract requirements, use realistic examples
to demonstrate differences in possibilities.
• The whole team should be involved in working through
edge cases and resolving ambiguities.
• Discussing realistic examples makes people think harder
and they are less likely to just brush questions off.
• Watch out for small differences in examples, as they
might indicate that a business rule is not directly
expressed.
• Write specifications down as tables to make it easier to
grasp the content and spot gaps and inconsistencies.
• With processing workflows, discuss rules for each
decision point separately.
• For genuine workflows, write down examples so that
preconditions, processing steps and verifications are
clearly separated.
58
Chapter 4
Specification
workshops
Just writing the specifications or requirements as realistic examples
instead of abstract sentences is not enough. To get the most out of
realistic examples, we need to put them to an open discussion and
give everyone a chance to review them and ensure that we all under-
stand the same thing.
All these people have different views of the system and ultimately
different mindsets. This is why examples have to be put to discussion
and analysed by the whole team. To facilitate this process, I like to
gather customers, business domain experts, developers and testers
around a whiteboard or a wall that we can write on and discuss
interesting examples. If the team is small, then the whole team gets
involved in this. With larger teams this might be a challenge because
it is hard to keep ten or more people focused on a single thing. For
larger teams, get at least one person from each of these groups in the
room. At the start of an iteration, this turns into an intensive, hands-
on problem and domain exploration exercise, driven by examples. I
59
Specification workshops
Running a workshop
The workshop starts with a business person, typically the product
owner, business sponsor or an analyst, briefly describing a piece of
software that needs to be developed. He then explains how the code
should work once it is developed, providing realistic examples. Other
workshop participants ask questions, suggest additional examples
60
Keeping one step ahead
that make the functionality clearer or expose edge cases that concern
them. One of the main goals of the specification workshop is to flush
out these additional cases before the development starts, while busi-
ness people are immediately available to discuss them.
61
Specification workshops
examples for the next month's work. This is absolutely fine, but it
must not be an excuse to skip the workshop at the beginning of this
next iteration. The examples that the business analysts have written
will be a good starting point for the workshop, but developers and
testers need to understand them, identify and suggest missing cases
and get a chance to discuss and critique the initial set of examples.
If you are at all unsure about the answer, just write the case down and
discuss it with business domain experts later. If a customer represent-
ative is not available, make sure to communicate the results with them
and get their opinion on all the examples as well after the workshop.
Try to elicit more interesting examples from them by asking whether
you have covered all the important cases.
62
Workshop output
Workshop output
The primary output of the workshop is a tangible set of realistic
examples that explain how the system should behave once the next
phase is complete. Key examples for every story or use case for the
next iteration should be discussed, including the main success scen-
ario and key edge cases. They should be explained and written down
in enough detail so that all participants agree on what the story is,
what are the deliverables and how to verify that they are correct. To
keep the flow going, you might just take photos of whiteboards or
have someone write down examples into text documents as you discuss
them. It is not really important to have them in any specific format
or tool, as there will be a time to clean them up later (we discuss this
in the next chapter).
The key feature of these examples is that they should provide enough
information for developers to implement and for testers to verify the
stories planned for the iteration. The workshop should answer most
of the questions about the specification that developers or testers
would normally ask during the next few weeks of work. It is OK to
leave some edge cases for later as long as the discussion during the
workshop provides a framework to understand these cases. Make sure
to discuss success scenarios and exceptions, but don't waste time
specifying examples for all possible permutations of parameters. One
example for each important case is enough.
63
Specification workshops
To keep the workshop focused and keep the flow going, it is best to
keep the examples and discussion on a fairly high level. We want to
discuss what the software does, not how it does it. The discussion on
how software implements something should take place later and does
not necessarily need to involve project stakeholders or domain experts.
Although possible implementations sometimes need to be considered
during the workshop because they limit what can be done, as a general
rule of thumb try to avoid talking about implementation or infrastruc-
ture details. This will save time and keep the flow going.
64
Feedback exercises
Feedback exercises
Donald Gause and Gerald Weinberg suggest using ambiguity polls to
spot places where people disagree because of hidden assumptions and
help them reach an agreement ([3] Ch. 9). Their ambiguity poll idea
consists of selecting a metric that requires a solid understanding of
the domain to estimate. This can be, for example, performance, cost
or time to complete a task. The participants in the poll are asked to
estimate the metric independently and then discuss the variations in
results to grasp the reasons behind them. With a larger number of
participants, these polls often have clustered results where clusters
denote differences in understanding and variations in a cluster often
relate to observational differences. Although most specification
workshops I am involved in do not have nearly the number of parti-
cipants required for numeric power laws to kick in, this idea is
applicable to smaller groups as well. In fact, it is already used in agile
planning and is known as planning poker. In planning poker, members
of the implementation team are asked to secretly select a card that
represents their estimate of how long it would take to develop a task.
All cards are then shown at the same time and the people who had
the highest and the lowest estimates explain their reasoning to the
group. This often leads to the discovery of sub-tasks or constraints
that the group was not aware of, or shortcuts that only a few people
in the group know. The process is then repeated until the estimates
converge. (Mike Cohn explains this in more detail in [12] Ch. 6)
65
Specification workshops
66
Building a domain language
It is often much easier for the developers to speak the business jargon
then to teach business people about programming abstractions and
techniques, so we should start creating this language by using the
names that business people normally use for concepts. After all, the
goal of software is to solve a business problem so it makes a lot of
sense to use the current business language. This does not mean that
we are limited to existing words and phrases. The ubiquitous language
is not dead, it is a living language and evolves with the project. To use
it effectively, we will need to expand it with new concepts. The active
67
Specification workshops
use of the ubiquitous language will reveal gaps and awkward phrases,
and we then need to create new phrases in the language to cover these
cases and simplify the discussion. As we develop the model and
implement more and more functionality, new concepts will be intro-
duced into the system and we will expand the language with names
for these concepts as well. But the important thing is to consistently
use the same language. There must be no business jargon and technical
jargon – just a single project jargon, the ubiquitous language.
68
The workshop is not a presentation
I've organised workshops with a dozen people involved that were very
effective, but it was a real challenge to keep everyone focused on the
task in hand and not discuss other problems. This is why I think that
smaller workshops are better. Two developers, two testers and a few
business people should be enough to get the thing right. The
developers can then use the examples that come out of the workshop
to pass the knowledge on to other developers. Testers can do the same
with other testers.
Effective design workshops look further into the future and explore
different possibilities and ways to achieve the end-result when you
know what you are building. They require the participation of domain
experts and senior developers. Specification workshops help you to
decide what exactly you want to build, and they should really be
focused just on the upcoming iteration. They should include domain
69
Specification workshops
This list of topics is a very nice reminder for the discussion that needs
to take place during an specification workshop, and it might be really
useful to you if you are trying to act as a facilitator. The steps do not
have to happen in the sequence described above and they should not
happen by a single person lecturing or commanding the rest. We want
to promote a collaborative discovery and learning effort, but we should
cover all of them in the workshop so consider the list just as a good
reminder of what to talk about.
70
Here's what I think we face
Here's why
Applied to the specification workshop, this asks for the business
reasons behind a business case to be clearly communicated, discussed
and explained to everyone. This will provide a better framework for
understanding and may launch a series of challenges and questions
ultimately resulting in a better overall solution than the basic set of
examples would have.
71
Specification workshops
Now, talk to me
The specification workshop should not be a lecture or a talk, it should
be an open discussion. We need to make sure that everyone voices
their concerns and has their questions answered (or written down
and chased later). If some are not participating in the discussion, the
facilitator should encourage them to join in.
72
Dealing with open issues
Stuff to remember
• Examples should be put to an open discussion and
reviewed by all members of the implementation team.
• At the start of an iteration hold a specification workshop
to discuss examples, iron out ambiguities and functional
gaps and build a shared understanding.
• Developers and testers should suggest examples of edge
cases or important issues for discussion.
• Make sure that domain experts and subject authorities
answer questions. Don't make up answers yourself.
• Business people should explain their answers to make
sure that others understand them correctly.
• The discussion that happens during the workshop is
itself very valuable, because it teaches people about the
domain.
• Organise feedback exercises to ensure that all parti-
cipants share the same understanding.
• Create and use an ubiquitous language consistently in
the workshop and all examples. Use the workshop to
evolve the ubiquitous language.
• Keep the workshop focused, don't let it become just
another meeting.
• Selecting a facilitator for the workshop can help to keep
it focused.
• If a customer representative is not present at the work-
shop, make sure that they review and approve the
examples.
73
74
Chapter 5
Choosing acceptance
criteria
One very useful feature of realistic examples is that they are often
easily verifiable. They have precise starting values and precise expected
results. Once the software has been developed, we can actually check
whether the system pays out 14 pounds after 7672 clicks or not.
75
Choosing acceptance criteria
76
Choosing the right set of examples
1
http://gojko.net/2006/10/22/magic-of-goals
2
http://www.slideshare.net/nashjain/acceptance-test-driven-development-350264
77
Choosing acceptance criteria
The script describes how something is tested. But it is not really clear
what exactly is being tested here. A fairly good guess would be that
this script verifies rules for free delivery, but what are those rules? Is
free delivery offered for the first order to the new users? Or is it offered
when people buy more than two books at the same time? Maybe it is
offered to the customers from the UK? Or is it a combination of those
three things? Maybe this example does not describe free delivery rules
at all, maybe it demonstrates the general flow of activities in our online
store. Now compare the script to the following statement:
This is the same example, restated better and focused on the really
important pieces of information. It is much shorter and easier to
understand. It does not leave so much space for misunderstanding.
If a developer was given the first test as a target for implementation,
78
Distilling the specifications
Adding more examples to the story, such as another order for the
same customer from the UK, or first orders of customers from the
US or France, will only make the first test script harder and harder
to understand. The second test stays fairly easy to comprehend:
This example is a bit simplistic and the difference between these two
approaches is often much greater on real projects. Test scripts span-
ning a few pages might be easily summarised in a sentence or two
without losing any of the important details. Instead of having to read
and understand dozens of pages, developers and testers can focus on
a paragraph of text. That makes it much more likely that they will hit
the target when they implement or verify the functionality.
79
Choosing acceptance criteria
3
http://www.concordion.org/Technique.html
80
Specifying business workflows
It is very important not to just take and copy acceptance tests for
individual steps and create a monster test that is unreadable and
unmaintainable. The goal of these few overall workflow tests is just
to specify how parts are connected and verify that they are connected
properly. The overall test should not be used to specify how individual
parts work in all possible cases. Individual acceptance tests or test
suites should be written to specify the functionality of individual
parts. The workflow process itself will probably be complicated, so
don't make it even harder to comprehend by complicating it more
with unnecessary details. Just take a really simple case and explain
how the system should handle it overall. The test should fit into the
given-when-then template, with all the relevant actions in the ‘when’
part. Resist the urge to verify the results of individual actions. This
functionality should already be specified and verified by more focused
business rule acceptance tests, so you don't actually need it in the
overall flow test.
81
Choosing acceptance criteria
The second step in this example continues the first one, but verifies
a different rule. In essence, completing the purchase or the total cost
in the first step are not really important for the second step. The only
important thing is whether someone has an unused free delivery offer.
So we can rewrite this as several independent verifications:
82
Converting scripts to specifications
83
Choosing acceptance criteria
4
in a private e-mail
84
Remember to investigate parameterisation
ing a special bonus rule that is applied to shopping carts with more
than 50 products, but the details of these products are irrelevant for
the rule, then do not list 50 products by name in the test. Write a
single step that will populate the cart with a number of random
products, in this case 50. Even in cases when you do want to list all
the products, keep the attributes actually being set in the test to a
minimum. Leave out everything that is not relevant for a particular
test. This will make tests easier to read and easier to maintain. If you
later remove an attribute from the product class, you will not have to
go through 50 examples and clean them up manually. The more
irrelevant information you strip from a test, the longer it will stay
valid because change requests and modifications of the parts that
were removed from the test will not affect it.
85
Choosing acceptance criteria
Automating tests
Toyota spearheaded the success of the Japanese motorcar industry,
changing the image of Japanese cars from cheap junk to reliable high-
quality vehicles. One of the major forces behind this success was their
innovative production system, which included a specific attitude
towards product quality called zero quality control, described by
Shigeo Shingo[15]. Zero in this case applies not to ‘quality’, but to
‘quality control’. In the Toyota Production System, quality was
something that was created from the start and planned in, not
controlled at the end. The point of testing in zero quality control is
to ensure that items are produced correctly – to prevent defects, not
to discover them at the end. This is how we should look at the tests
in agile acceptance testing. They are there to prevent us from doing
something wrong in the first place rather than to catch mistakes at
the end.
86
Keep tests human-readable
There are lots of test automation tools available today, and your choice
of automation tools will dictate how the tests are written, what you
can automate and how to automate them. I discuss some of the more
popular tools for automating agile acceptance tests in Chapter 10. In
this chapter, I focus more on the general constraints of automated
acceptance tests. If you are browsing through this book and not
reading pages in sequence, you might also want to read an argument
against automation in the section Adopting in phases on page 151 after
reading this chapter.
87
Choosing acceptance criteria
don't repeat yourself. This is why I really prefer using tools that allow
us to write acceptance tests so that business users can understand
them.
Every automation tool has its own way of specifying and automating
tests, so programmers need to translate the examples chosen for tests
into code or some form of scripting. As I've mentioned before,
translation often causes problems because things get lost or become
less precise. Ideally, we want to avoid translation as much as we can.
Some automation tools allow us to write the description of a test
separately from the code automation part. When using tools like this,
it is possible to skip the translation from examples into tests alto-
gether. For example, the test in Figure 5.2 could be automated with
FIT.
The automation part of this test may post actual orders or just update
a field in the database that says how many orders a customer has had
this year, depending on the design and implementation of the system.
But at this point we really don't care about how something will be
88
Automating examples with unanswered questions
The tool that you choose will drive the format of the test, so you should
ideally try to write examples in a format that the tool can directly
understand or be very close to this format, so that the chances of
introducing problems during later test automation is minimised. This
also removes the need to maintain two separate records of the same
tests.
For example, if the test description contains ‘John has 50 chips in his
account’, the automation code stays the same even if the user is not
called John or if he has more money at his disposal. The automation
part for the discount eligibility example in Figure 5.2 won't change
even if the customers change their minds about the case with 19
previous orders.
89
Choosing acceptance criteria
90
Dealing with user interfaces
91
Choosing acceptance criteria
With current tools, user interface tests run too slowly to be executed
often, making them a lot less effective as a guide for development.
User interfaces also tend to change a lot, at least on the projects that
I am involved in, so tests that involve a user interface are brittle and
the effort to maintain them in the long term often negates the benefits
of automation.
92
Domain-specific languages for user interface tests
This idea does have some appeal, but I believe it is still much better
to avoid user interfaces when describing business rules at the moment,
at least for the kind of projects that I am involved with. If the
5
http://www.solutionsiq.com/agile2008/agile-2008-domain.php
93
Choosing acceptance criteria
Tools such as Selenium (see the section Selenium on page 187) allow
us to automate browser actions and implement user interface tests.
As I mentioned in the section Distilling the specifications on page 78,
describing a test using low-level workflow steps and actions is not the
best idea, so you might want to abstract it a bit and make the tests
easier to understand and maintain.
94
Who should write acceptance tests?
Simon Stewart suggests using the Page Object6 pattern to make user
interface tests easier to maintain. In this approach, we describe web
pages and the logical operations they support with Java objects and
a fluent interface, hiding the complexity and details of user interface
commands in their methods. Tests are then written against the page
objects, not directly against the APIs of the test automation tool. This
approach makes it possible to write tests before the user interface is
ready, because we can work with page objects and logical methods
that will later be connected to a web site. It also means that tests are
less affected by user interface changes, since we only need to change
the page object when a particular page changes. Page objects are
essentially another version of the domain-specific testing language
idea, but in this case the ‘domain’ is the workflow of a particular web
site that we are building.
6
http://code.google.com/p/webdriver/wiki/PageObjects
95
Choosing acceptance criteria
away so that they can be automated and connected to the code more
easily. For example, if FIT or FitNesse is used as the automation tool,
a developer should think about fixture types that can be used to
automate test steps and may suggest rewriting some parts to make
the automation easier. Customers, business analysts and testers are
there as a safety net to prevent developers from going too far and
making the tests too technical.
If you do assign a single person to write the tests, make sure that you
know what you are doing and why you are doing it. This person is
put into a position of significant power and responsibility, as accept-
ance tests are the specification of the system. If you would not trust
someone to write the specifications, don't trust them with writing
acceptance tests either.
I heard about a case where the task of writing acceptance tests was
assigned to a junior external tester, just because he had some previous
exposure to FitNesse. A specification workshop was not held. A
developer with no previous experience of writing FIT fixtures was
told to automate and review the tests. These two guys just wanted to
get the job done, so they wrote the tests the best way they could,
making up the content themselves. I have a hard time imagining a
worse way to write acceptance tests. Without any domain knowledge
or understanding of the problems and requirements, they had abso-
lutely no chance of capturing the real rules and constraints. They
made up their own theoretical examples, so the chances of identifying
any functional gaps were very thin. Introducing agile acceptance
testing in this way can only lead to disappointment, because all the
additional work will bring absolutely no benefits. Acceptance tests
written by people who do not understand the business and don't have
any influence on the scope are completely useless and your team is
actually much better off without them – programmers will at least
not receive wrong specifications.
If a single person is charged with writing the tests, this person must
understand that her job is to research realistic examples and interview
domain experts on expected behaviour, not to make up theoretical
examples and definitely (and this is of crucial importance) not to
96
What acceptance tests are not
97
Choosing acceptance criteria
This means that, with agile acceptance testing in place, there will be
far fewer changes than with a traditional process, but we have to
permit changes to happen to achieve complete customer satisfaction.
A large majority of changes after workshops are typically driven by
business people changing their minds (‘I thought about the thing that
we had on the whiteboard yesterday, and I actually think that it should
be like this...’ or ‘I talked to Steve about the edge case, he does not
agree’ ). Tests are a live specification of the system and they can change
after workshops. Don't just take the approved set and hold on to it as
if it was set in stone.
98
They are not mechanical test scripts
It is easy to fall into this trap if any single person is charged with
writing and maintaining acceptance tests, because different roles have
different concerns about tests and benefit from them in different
ways. Many testers, especially if they come from a record-and-replay
testing background, don't really care about the inner details of a test
script, they mostly worry about the result being green when it
completes. Business people want to describe the system as precisely
as they can, using a template that developers understand. Developers
want a detailed specification, but they frown on duplication and
having to maintain hard code to integrate acceptance tests. This is
why acceptance tests should ideally be owned by the whole team.
This does not mean that complex tests that cover a full range of
different permutations are not worth writing, just that they should
not be included in the basic acceptance test suite. Nothing is
preventing you from creating an automated test that verifies hundreds
of permutations and checking the specification of this test with your
customers. Such a test can be a very useful functional regression
testing tool but it is not a good choice for an acceptance test.
The weird thing about this and the problems described in the previous
two sections is that where the problems exist, acceptance tests can
still be functionally correct and executable, we can still run them and
get a green or red result, but they are absolutely useless as a commu-
nication device. So they miss the main goal – facilitating communic-
ation. Remember that acceptance tests only work when you can use
99
Choosing acceptance criteria
Stuff to remember
• Select a set of representative examples to be the
acceptance criteria for the next phase of the project.
• Clean up and formalise these examples as acceptance
tests.
• Write tests collaboratively, ideally at the end of the
workshop.
100
They are not a complete verification of the system
101
102
Chapter 6
Focusing development
With traditional abstract requirements, many details are often left to
developers to work out. Although business analysts would probably
not agree with me at this point, from the perspective of a developer
who was typically charged with the task of digesting 500-page docu-
ments and then working out what actually needed to be implemented,
I can assure you that this is true. Agile acceptance testing helps a lot
in this respect, because it gives us acceptance tests that were collabor-
atively produced to tell developers exactly what is needed. Once the
acceptance criteria for the next phase of the project are captured in
acceptance tests, the expected result of development is clearly specified
in a measurable and verifiable form. From this moment, the actual
development can focus on fulfilling these requirements.
103
Focusing development
1
in a private e-mail
2
http://tech.groups.yahoo.com/group/testdrivendevelopment/message/24125
104
Suggesting new features
The list of examples that are chosen for the formal set of tests at the
end of the workshop should be complete in the sense that it should
cover all the required differences in possibilities, so if something is
not on the list we do not need it in this phase of development. As you
get more accustomed to acceptance testing, ideas about features will
be flushed out more and more during the workshop and not during
development.
105
Focusing development
during the iteration. If the change is small and you have enough time
to include it in the current iteration, you can just add to the examples
and do it. If the customer representative or a business analyst is not
readily available, or the change is too big to include it in the current
iteration, it is better to leave the discussion for the next workshop. In
any case, you should try to understand together why this example was
not spotted during the workshop and try to make sure you identify
all the examples next time. This discussion can take place during the
iteration retrospective.
106
Acceptance tests provide design hints
107
Focusing development
This workflow test hints that the service would most likely have a
method to place chips on the table, with a player, amount and selected
field as arguments. It also hints that there should be a method to spin
the roulette and a method to check how much a player won.
Just make sure not to take these hints as design requirements. For
example, it would be false to assume from the fact that the acceptance
test specifies the roulette table field Odd that the Spin() method for
the roulette business service takes the result field as an argument.
Code using the roulette table should not be able to specify the outcome
of the game, but we need exactly this in a test. The link between the
test specification and the business code for this step would have to be
implemented using a test system instead of a real random number
generator, for example, but not through the business service.
Tests should be focused on the behaviour under test and they often
do not provide the full precise context. For example, if a special bonus
should be applied to shopping carts with more than 50 products, the
108
Design does not have to be feature-driven
acceptance test for this should specify a case where the cart has 50
products (as described in the section Focus the test on the rule being
tested on page 84). It would be wrong to assume that this implies a
business method which randomly generates a number of products to
fulfil the test workflow. On the other hand, this test hints at the need
to count the products in the cart, which should most likely be imple-
mented as a domain method.
You can look at the stories for the whole delivery milestone and discuss
some of them with the business experts in order to get enough
information to build and verify your model design. These examples
should not be put into acceptance tests at the start – they can be
included later when the time actually comes to develop them. You
might want to capture them in order to kick-start a later specification
workshop, but you do not have to do this.
109
Focusing development
110
Use the project language consistently
Because the glue code is a link between domain code and acceptance
tests that business people can understand, it often ends up being very
ugly from a coding point of view. This sometimes bothers developers
because it is contrary to what they are normally expected to do.
Changing the glue code often requires changing the test descriptions
as well. If you decide to change test descriptions, make sure that the
new descriptions are still easily understandable to business analysts
and customers.
Most tools will allow you to extract common parts of acceptance tests
into a set-up or a tear-down section, so that you can reuse them across
several tests. Re-organising tests like this to improve reuse is a good
thing, because it makes them easier to maintain. However, make sure
that you don't go too far. Resist the urge to fix the glue code and
refactor tests so that they are aesthetically nice from the coding point
of view but require big changes in test descriptions.
I have no perfect solution for this problem. I would only say that while
the glue code might be ugly and a bit of a pain to maintain, it provides
improved direction during development as part of the agile acceptance
testing practice. The trade-off delivers.
111
Focusing development
for the concepts in our code and avoid creating a technical jargon for
the project.
Concepts in the code should be given the same names as the respective
concepts in test descriptions and in other documentation. During the
implementation of the tests, you may notice some inconsistencies in
naming. This is perfectly normal especially in the early stages of the
project, since the language is still being formed and we do not use
anything to enforce formal naming conventions during specification
workshops. In two different tests we may refer to the customer's
address as ‘mailing address’ and ‘home address’. When you start
implementing those two tests, you will notice the difference because
code compilation enforces formal naming. When things like this are
found, developers should communicate with the business people and
decide which name to select, and then consistently use this name.
This also means adjusting one of the test descriptions to make it
consistent with the code.
112
Unit tests vs acceptance tests
When acceptance tests are used in the project, large parts of the
production code are covered by these tests. Some people tend to skip
unit tests because acceptance tests already check the functionality.
Although this practice does save some time, it may make it harder to
pinpoint problems later. Failed acceptance tests signal that there is a
problem, but do not locate the source as accurately as unit tests do.
Acceptance tests also rarely check purely technical edge cases, so unit
tests should be written to cover these issues at least. Infrastructure
parts of the code, not specifically related to any user story, are also
not properly covered by acceptance tests.
3
http://tech.groups.yahoo.com/group/fitnesse/message/10115
113
Focusing development
For example, an acceptance test for a search system might specify that
a user can enter multiple search phrases separated by commas in the
same line. Somewhere under the hood, this big search criterion needs
to be split into multiple criteria. Splitting the search string should be
a responsibility of a distinct code unit which is purely technical. The
overall acceptance test is not a particularly good target for develop-
ment of this code unit. It will give us a green or red result, but it will
be difficult to know whether the problem is in the code that splits the
string into pieces or the code that executes the search. It will also not
give us quick feedback while we develop the functionality, as the search
needs to be developed as well in order for the acceptance test to run.
In cases like these, I prefer to write a few unit tests for the required
string manipulation functionality. These tests will allow me to develop
and test the string manipulation code unit in isolation and ensure
that the unit is correct before I include it in a wider context. Dividing
the code up like this also allows us to split the work. One developer
can work on string manipulation, another can work on executing the
search. The overall acceptance test verifies that both code units
cooperate correctly to give the correct business result at the end.
Some duplication between unit tests and acceptance tests is not really
a problem because it does not introduce a large management overhead,
and you should not drop legitimate unit or acceptance tests because
the same thing is already verified in the other groups.
114
To mock or not to mock
This is why acceptance tests must connect to a real database, use real
services if possible and in general provide us with as much assurance
as possible that the thing really does what the customers want. Because
of this, acceptance tests often run much slower than unit tests.
Mocking external systems that have no real test APIs is unavoidable,
such as in the example of a random number generator described in
the section Acceptance tests provide design hints on page 107. Mock
objects are sometimes the best solution to verify time-dependent
processes or isolate very slow systems. Although they are sometimes
unavoidable, I really think that we should keep mock object usage to
a minimum with acceptance tests.
115
Focusing development
run all unit tests as we want to catch technical bugs before the code
goes into the central repository. For unit tests to be effective, they
have to run quickly and execute from the integrated development
environment. For acceptance tests, it is much more important that
they are easily understandable by business people and that they can
verify the system in a state as close as possible to the production
system.
Acceptance tests tend to be slower than unit tests, because they connect
to real databases and external services. Depending on external
dependencies, acceptance tests might not really be executable at all
on developer machines. Whereas this would be a huge problem with
unit tests, it is relatively fine with acceptance tests.
116
Running manual tests
The same applies to other types of tests that cannot easily be auto-
mated or cannot run on development hardware, such as security
probing and usability testing. Instead of leaving these to the end, it
is much better to examine the system several times during the project
and incorporate the knowledge into further development to promote
continuous improvement.
Stuff to remember
• In practice, acceptance tests provide a very good
specification for required functionality.
117
Focusing development
118
Chapter 7
Facilitating change
Once the entire set of acceptance tests for a project phase is green,
the development work is almost done. At this point, developers might
improve the design of the system with some new insights acquired
during the current iteration and re-execute the tests to confirm that
the system is still working as it should be. After this, we can continue
with the next phase of the project. The role of the set of acceptance
tests for the previous phase now changes from that of a target for
development to that of a utility that facilitates future change. It
becomes a live record of what the system does and a set of regression
tests that can be executed to verify that the system still does what it
was supposed to do.
A live specification
The executable code is often the only thing that we can really trust in
software systems. Other artefacts such as specifications, requirements,
even API documentation, quickly get out-of-date and cannot be
trusted completely. On the other hand, executable code is unusable
as the basis for a discussion with business people. Source code is no
better, since business people cannot read it. Even if they could read
it, source code has too many details to facilitate an efficient discussion
about business rules and features. It is too low-level and it prevents
us from seeing the wood for the trees.
119
Facilitating change
Having a live and relevant specification of the system helps new team
members to get started and understand the project. It also protects
us from the ‘bus effect’, whereby we lose important knowledge if the
only person who knows what the system does gets hit by a bus (or in
a more realistic scenario leaves the team for a different job).
Keeping it live
During development, we expect acceptance tests for the current iter-
ation to fail most of the time, since the functionality is not yet there.
But once the functionality is implemented, previous tests should
always pass. After a phase of development is done, it is of crucial
importance to promote related acceptance tests into the suite of
regression tests. These tests can be used to verify that the system keeps
doing what it is supposed to do.
1
See http://video.google.co.uk/videoplay?docid=-7227306990557696708 and
http://www.rimuresearch.com/RickMugridgeGoogleConference.pdf
120
Keeping it live
If one of the tests fails, it means the system stopped doing something
that it is supposed to do and this should raise an alarm. A failing test
that was previously running is a clear signal that the code is no longer
synchronised with the specification, so one or the other needs to be
modified. This may be due to a bug being introduced with new code,
or because of a change that conflicts with some of the previously
implemented business rules. Unless it is completely obvious that the
problem is due to a bug (in which case the code should be fixed
straight away), customers have to decide whether the example is
obsolete or still valid. If the team has a dedicated business analyst,
then it is her job to explore this issue and discuss it with customers
and stakeholders.
A continuous integration system should run the tests and tell someone
if any of the tests fail – this will protect against problems creeping
into the system. Automated alerts keep the problems small, since we
can catch issues as they appear and solve them, and not allow them
121
Facilitating change
Broken window
Making sure that previous acceptance tests are always valid is also
important from the aspect of keeping the specification relevant.
Because all tests are passing correctly, we know that the specification
is still live and we can trust it in discussions. The periodic execution
2
See [17] and http://www.theatlantic.com/doc/prem/198203/broken-windows
122
Introducing changes
Acceptance tests are a good start for the regression suite, but don't
take this as a suggestion to stop there. Testers should use other tools
and methods for supplemental regression testing as they see fit. I want
to make this explicit so that there is no misunderstanding. Agile
acceptance testing just gives you a good starting point, because it
ensures that the business rules are covered. (Comprehensive regression
testing is outside the scope of this book.)
Introducing changes
With a live, relevant specification in the form of acceptance tests that
business people can understand, we can introduce changes to the
system much more easily. The live specification facilitates discussion
about change requests, and we can use existing tests to analyse how
the requested modifications would affect system behaviour. Existing
examples provide a good framework in which to discuss the changes
and make sure that we do not forget important edge cases. When we
start changing the existing tests and adding new information to them,
123
Facilitating change
Solving problems
With domain knowledge and understanding shared among team
members and a comprehensive acceptance test suite based on realistic
examples, the quality of the resulting software is much higher than
with more traditional specifications and requirements. This does not
mean that you will never get any bugs. Nobody is perfect and unfor-
tunately bugs will still happen.
When a bug is found, the key questions to answer are: ‘why was it not
caught by the tests in the first place?’ and ‘which set of tests should
have caught it?’ This will provide insights for future specification
workshops. Mike Scott recommends3 that we should treat defects as
evidence of missing tests. If an existing feature is incorrect, then the
case was overlooked by the team so we need to add a new test and
ensure that similar cases are covered next time. Another possibility
is that the case was specified incorrectly, which means that real domain
experts did not participate in the workshop and did not review the
tests afterwards. To solve similar problems in the future, we need to
identify people who should participate in the workshops or review
tests for each part of the system. If the system is not doing something
that it should be, then a new feature should be put into the develop-
ment plan and specified when the time comes for implementation.
There is also the possibility that the bug is not a domain problem at
all and should have been uncovered by unit tests or integration tests,
not by acceptance tests.
3
in a private e-mail
124
Keeping the software flexible
125
Facilitating change
Acceptance tests should facilitate change, not impede it. If you find
yourself in the position of resisting changing the system because it
will take a long time to fix all the tests, then the tests have to be
simplified and made easier to change too. This is why, like code,
acceptance tests need periodic housekeeping and clean-up so that
they remain flexible.
126
Common symptoms of problems
A similar problem can occur with a test that describes a state machine
or a calculation with a large number of parameters. This often ends
up as a table with a large number of columns. Most likely some of
these parameters do not really affect the calculation or the state. They
might have been important earlier but became obsolete, or maybe
they were just copied from a similar test, but never really affected the
behaviour specified by the test.
In any of these cases, you should look for ways to make the test shorter
and simpler. If it specifies several business rules, split it into smaller
and more focused tests (see the section Each test should specify only
one thing on page 82). If it contains extra parameters that are not
important for this particular test, delete them. If it is too technical or
detailed, try to specify the test from a higher level of abstraction. In
particular, move any implementation or scripting details from the
127
Facilitating change
If the value is really important for the calculation, it can be set globally.
For example, instead of a table that verifies tax calculation on products
with 50 rows with only two types of products mentioned in these 50
rows, we can split the test into two tests of 25 rows, each with a globally
specified product type, and remove the product type column from
the tables.
128
Common symptoms of problems
steps that are not necessarily relevant for the thing being described.
Changes in these seemingly unrelated steps will affect all the tests as
well.
This might happen because we started with a single story and then
added similar stories as change requests came in. Alternatively, the
stories might have initially started off as different but become similar
after code refactoring or test clean-ups.
This does not mean that tests with a low level of detail focused on
implementation should not be written. But these tests should be in
129
Facilitating change
Tests that sometimes pass and sometimes fail are a huge warning
signal. How do we know that the same thing is not going to happen
in production? Many causes of unreliability in tests, such as timing
issues, dependencies on database contents and reliance on random
values, can be fixed. If the issue is caused by an asynchronous process,
we can focus on testing the synchronous parts in isolation for
acceptance and then just have a simple overall test to check
connectivity. If tests depend on database contents or constraints, they
should be wrapped in transactions which are rolled back after the
test.4 Tests that depend on random values might need to be rewritten,
or the random value generator might need to be abstracted to make
tests easier to write (this is a rare exception where a test mock is useful
in acceptance testing – see the section To mock or not to mock on page
115).
Regardless of what the cause is, tests like these have to be investigated
and fixed, otherwise they will undermine the reliability of regression
tests in the future. As a consequence, these tests also undermine
confidence in the code under test.
4
http://gojko.net/2008/01/22/spring-rollback/
130
Common symptoms of problems
A much better solution is to copy only the details that are really
needed, or to extract the preparation phase into a common set-up for
the old and the new test.
Interdependent tests
Tests that depend on the order of execution are just a special case of
the previous problem – though this is not as visually obvious as in
the previous case – and they suffer from the same problems. If a test
requires some other test to be executed beforehand to prepare the
data or initialise some external dependencies, then a change in the
first test might cause the second to start failing with no obvious reason.
131
Facilitating change
Cleaning up tests
Acceptance tests have to be maintained throughout the software life-
cycle. Knowledge gained during development often provides new
insight into the domain and helps to implement, explain or define
things better. This knowledge should be incorporated into existing
tests in the following iterations. Here are a few tips for housekeeping
that you can apply to keep tests flexible and easy to change.
132
Cleaning up tests
133
Facilitating change
Some test automation tools allow you to bind the test descriptions
directly to your domain objects, making it easier to spot language
inconsistencies since tests will start failing after a change on only one
side. In any case, a change in the domain language should be agreed
and communicated to everyone involved – developers should not be
changing the language on their own.
134
Keep tests in a version control system
Some acceptance testing tools allow you to set up links in the hier-
archy, so that the same test appears effectively in two places but you
need to update it only once. With a tool like this, you can actually
have both strategies for test organisation in parallel.
Even if the tool that you choose for acceptance testing allows you to
keep the tests separately from the code, resist this urge. It might not
be very intuitive, but storing acceptance tests separately from the code
will cause huge consistency problems when new versions are intro-
duced or existing code branches are merged. Remember that accept-
ance tests are a live specification. If you keep the specification and
the implementation separate, they will evolve separately. It will not
be easy to determine which version of the code relates to the
specification, or how to verify a particular version or branch of the
code. When the code and the tests are kept in the same version
structure, under the same version control system, then the connection
between the two is obvious.
Keeping tests in the same version structure as the code also helps if
you need to resurrect parts of the system that were modified or deleted
by mistake. Recovering both the specification and the implementation
135
Facilitating change
at the same time is then easy, as is verifying that they are still
consistent.
Stuff to remember
• Acceptance tests are an authoritative description of what
the system does.
• We can have the same level of confidence in acceptance
tests as in executable code.
• We can use existing acceptance tests to discuss future
changes.
• Once the functionality is implemented, previous tests
should always pass.
• If an earlier test fails, immediately discuss with customers
whether it specifies obsolete functionality. If yes, take it
out. If not, you found a bug.
• Regression tests in doubt should never be disabled.
• Automate periodic execution of regression tests using a
continuous integration tool.
• Acceptance tests should not be the complete regression
testing suite. They are only a good start.
• If you find yourself resisting changing code in order not
to have to fix tests, you need to simplify the tests and
make them easier to maintain.
• Efficient organisation of tests is crucial to keeping them
easy to maintain.
• Keep tests in the same version control repository as
domain code.
136
Keep tests in a version control system
• Tests that reflect the way code was written or tests that
mimic code
• Tests that fail intermittently even though you haven't
changed the code
• Parts of tests or even complete tests used as set-up for
other tests
• Interdependent tests
137
138
Part III. Implementing agile
acceptance testing
In this part, we take a look at some more practical aspects of agile
acceptance testing, how it fits into the wider project plan and individual
iterations and how to implement it in an organisation. I also briefly
present the most popular test automation and management tools and
suggest what you can expect from them in the future.
Chapter 8
141
Starting with agile acceptance testing
Jim Shore gave one of the best summaries of agile acceptance testing
in the wider development context in his article How I use FIT.1 He
called the process ‘describe-demonstrate-develop‘.
Agile acceptance testing has much more to say about what happens
before development than during it. John von Neumann, the father of
modern computing, said: “There is no sense being exact about
something if you don't even know what you're talking about”. The
first two steps make sure that we know what we are talking about
before the real development starts.
1
http://jamesshore.com/Blog/How-I-Use-Fit.html
142
Agile acceptance testing in the context of the development process
143
Starting with agile acceptance testing
This does not mean that you cannot use agile acceptance testing if
you are not agile by the book. People are often scared when too many
buzzwords arrive together, so for those of you that are thinking about
migrating to agile, I'd like to point out that you do not have to eat the
whole elephant at once (or ever finish that meal). Doing unit testing
or pair programming or any other popular agile practice is not a
prerequisite for agile acceptance testing, and you definitely do not
have to learn all these ideas and apply them at once. Agile program-
ming techniques certainly help, not because agile acceptance testing
somehow specially depends on them, but because they are generally
useful practices. An iterative development model is, however, a
prerequisite for effective agile acceptance testing.
144
Fitting into iterations
145
Starting with agile acceptance testing
Acceptance test clean-up and review (N): Not all acceptance tests that
we have prepared for this iteration will be perfect straight away, so a
business analyst chases open questions and gets remote domain
specialists to review the tests, while the project manager can get any
sort of sign-off required for tests, and testers, developers or business
analysts simplify, clean up and organise acceptance tests. We expect
this activity to span the first few days of an iteration. Changes might
be introduced into the acceptance tests later, but we expect the bulk
of the work to be done in the first few days and for the tests to stabilise
after this. The diagram shows that this should end by Thursday, but
this is not a fixed deadline, it is an estimate. Clean-up ends when it
ends, sometimes it may not be needed at all, sometimes it will end
sooner, sometimes it will spill over to the next week.
Preparing examples (N+1): Once the bulk of the acceptance test clean-
up for the current iteration is done, the business analyst can start
working with the clients and the testers on the examples for the next
iteration, preparing a good starting point for the workshop. The
146
Fitting into iterations
147
Starting with agile acceptance testing
Planning (N+1): Once everyone knows what the potential scope is,
we organise estimations, play planning poker and confirm the final
scope for the next iteration. This becomes the official plan. Everyone
is involved.
148
Igniting the spark
Once this project starts delivering, the ideas will simply spread virally
through the organisation. Boosted by fresh ideas on how to improve
communication and collaboration, business analysts will start talking
to other business analysts, testers with other testers and developers
with other developers in your organisation, spreading the word.
Management will notice that there is something different about this
particular project because suddenly there are fewer problems in
development. People from other teams will phone you to ask how
this testing thing works.
149
Starting with agile acceptance testing
150
Adopting in phases
After a while, the benefits of this practice should become obvious and
then you should be able to tell everyone the full story and start using
the name ‘acceptance tests’.
Adopting in phases
Brian Marick wrote an article called An alternative to business-facing
TDD2 in March 2008, challenging the effectiveness of automation for
acceptance tests. Arguing that test automation by itself does not help
clarify the design, that live demonstrations can show continuous
progress and that automated acceptance tests cannot detect user
interface bugs, he concluded that test automation for business facing
(acceptance) tests does not pay off as much for code-oriented (unit)
tests. He suggested that it might be more effective not to convert the
examples into automated tests and perform exploratory testing for
acceptance:
2
http://www.exampler.com/blog/2008/03/23/an-alternative-to-business-facing-tdd/
151
Starting with agile acceptance testing
you are not close to a computer, make sure you remember to read it
later.
152
Choose a facilitator for the workshops
The best person to be a facilitator is someone who has the right people
skills and an overall understanding of the domain, possibly not in
full detail. This person should be able to speak both to technical and
to business people, and help them find a common language. If the
team includes a full-time business analyst, she is probably the best
person to facilitate the workshop. The facilitator does not have to be
a domain specialist. A ScrumMaster or a team leader might also be a
good choice. By team leader, I mean someone with personal leadership
skills who spends a lot of time communicating with people, not
someone who has the role because of great technical knowledge. A
key thing to remember is that instead of translating between business
and technology the facilitator must help other workshop participants
to find a common language.
153
Starting with agile acceptance testing
Hire a mentor
It always helps to have someone who has gone through the transition
to lead the way, answer questions and train project team members.
If you can hire someone like this and get him on the initial team, this
will help to establish best practices for acceptance testing in your
organisation much more quickly. The mentor can act as a facilitator
during workshops, help to choose tools, train people to use them and
help automate tests better.
154
Where to look for a mentor
out examples and produce tests for one iteration themselves, joining
towards the end of it to review the outcome and help them solve any
open issues before the specification workshop for the next iteration.
As the project progresses, the mentor should join for shorter periods
of time and leave for longer, making the team more and more self-
reliant. After a few such visits, the mentor can just occasionally visit
the team to discuss progress. He can be available for phone or e-mail
consultations throughout. A good mentor will pass the knowledge
on to the initial team in a few visits, so the entire experiment should
not take more than two or three months.
155
Starting with agile acceptance testing
business people. This might seem like a good start, but it is actually
as wrong as it can possibly be.
Cargo cults
During World War II, Allied forces and Japan invaded isolated
islands in the Pacific where the natives had had no contact with
the rest of the world before. They arrived with modern equip-
ment, built airfields and delivered supplies by cargo drops. Some
of the supplies were shared with natives, drastically changing
their way of life. When the war ended, the soldiers and their
supplies were gone. Religious cults developed on the islands
calling for the cargo to start falling from the sky again. Islanders
built elaborate models of airplanes and air control towers out
of straw and wood and imitated soldiers, hoping to summon
the presents from the gods. Needless to say the presents never
arrived.
3
[20] and http://stevemcconnell.com/ieeesoftware/eic10.htm
156
Avoid the cargo cult mentality
In the introduction, I said that you should use the process described
in this book as a guide rather than something carved in stone. You
will probably want to modify some parts to make it fit your organisa-
tion better, but make sure that you follow the core ideas and underly-
ing principles. Otherwise you will end up following a cargo cult.
Stuff to remember
• Agile acceptance testing is not a development methodo-
logy.
• Iterative development is a prerequisite for effective agile
acceptance testing.
• Start out small, with a team of enthusiastic people.
• Think about assigning a facilitator for the initial work-
shops.
• Don't take practices as carved in stone, adjust them to
your needs but keep to the basic principles.
• Avoid mentioning the word test to get the buy-in of
people who think that testing is beneath them.
• Developers should not write acceptance tests themselves.
157
Starting with agile acceptance testing
158
Chapter 9
I have intentionally placed this chapter towards the end of the book,
because I wanted to emphasise the communication benefits of
acceptance testing and avoid focusing too much on general software
development practices and techniques. How you plan your project
depends very much on the type and size of the project and the period
available to you to develop it, so please don't interpret this chapter
as something that is carved in stone or prescribed as the only way to
do things. You do not have to base your plans on user stories, although
there are significant advantages to using them if you are introducing
acceptance testing. If you understand the underlying principles and
ideas of user stories you will be able to see more easily how to fit agile
acceptance testing into your planning process, and you might even
find that you can improve it.
159
Planning with user stories
From a more traditional point of view, user stories describe the scope
of a project, but not the specification. At a very high level, they answer
what and why. There are no details because we want to avoid paralysis
by analysis, getting lost in the details and not seeing the wood for the
trees. Leaving the details for later also allows us to keep the initial
scoping discussion short and efficiently use the time of project spon-
sors and key stake-holders who need to be involved in building a high-
level delivery plan and scope.
I like to use one-liners as user stories; any more is probably too much
detail. The classic template for user stories is:
1. As a role,
2. I want functionality,
3. So that benefit.
1. In order to benefit
160
How are stories different from more traditional methods?
2. As a role
3. I want functionality
The worst case of people not understanding the point of user stories
that I have seen was a project plan that included product CRUD
(Create, Read, Update, Delete, typical data entry screen capabilities)
as a user story. A user story might include product maintenance, but
it should also specify for what purpose and by whom the maintenance
is performed and it should describe something that will deliver some
real business value to the customers. When you understand who needs
to create, update and delete products and why, the scope of the story
is often a lot less than in a generic case. A generic product CRUD case
would typically include everything required for product maintenance
in the whole system. A true user story includes only what is needed
1
http://www.artima.com/weblogs/viewpost.jsp?thread=74230
161
Planning with user stories
I do not think that there is any specific benefit to user stories over
more traditional planning methods if you want to deliver everything
in one big chunk, you are sure that the requirements and the
specifications will not change during the project and your developers
are domain experts. But most of my projects are not like that. Plans
change, requirements are thrown in or out and clients want staged
deliveries. Developers often make wrong assumptions about the
problem domain and misunderstand requirements and they learn
about the domain while developing the software. If your projects are
like this, you will find that user stories use your time efficiently, reduce
waste and provide a very good framework for discussing, planning
and prioritising with key stakeholders. They also help to flush out
wrong assumptions and help developers make better decisions.
162
Benefits of user stories
Another great feature of user stories is that each story brings a clear
immediate customer benefit. If you build your delivery plan with user
stories, each deliverable brings direct value to the customer. If the
plan is built on a purely technical basis, infrastructure components
163
Planning with user stories
• Card: User stories should be written on small index cards. The card
allows you to write down only so much information, so nobody
can mistake it for a complete requirement. The card is just a
placeholder for discussion and a tool for planning.
• Conversation: the card is used just as a token for discussion,
reminding people what to talk about. The conversation is where
we flush out all the details and get to real requirements.
• Confirmation: each user story should be verifiable, and we should
have a clean way of deciding whether it was implemented correctly
and completely.
2
http://www.xprogramming.com/xpmag/expCardConversationConfirmation.htm
164
Project planning
Connextra pioneered the index story card format that is now more
or less considered standard. The Connextra story card has the story
title and priority at the top, followed by the story description, and
then the story author, submission date and implementation estimate
at the bottom. An example is shown in Figure 9.1.
Project planning
I like to use a brainstorming session with key stakeholders at the
beginning of a project to create the first cut of user stories, writing
them down on index cards or sheets of paper that are then put up on
a wall. We first discuss very high-level stories (sometimes called epics)
and then break them up into smaller stories later. The way that the
stories are gathered is not really important for the topic of this book
– see the recommended books on user stories for some good tech-
niques for that. What is important is that each story should have
something to say about how the system will help users do their job
when it is complete, and why this particular functionality is important.
165
Planning with user stories
166
Grouping into deliverables
There is more than one way to skin a cat, so you should try reshuffling
stories and deliverables a few times looking for the plan that brings
customers the most important benefits the fastest and makes sense
from a technical perspective. Once everyone is happy with the plan
for deliverables, a high-level project plan is more or less already in
place – it's on the wall! Although there are no details in the stories,
technical experts should be able to give rough estimates for how long
the development will take and how many people they need for the
project based on the list of stories.
167
Planning with user stories
The user stories method does not give you detailed estimates of how
much something will cost or how many months it will take to develop.
On the other hand, I would argue that even a seemingly precise
traditional method based on detailed requirements would just produce
an educated guess that would not necessarily be closer to the actual
outcome than the suggestion of an experienced team leader. And such
detailed methods take a lot more time and effort from key stakehold-
ers, whereas planning with user stories makes sure that their time is
used efficiently. Senior stakeholders are often quite busy and working
on a number of other projects, so it is really important that they focus
on the plan and give real feedback. In my experience, it is much easier
to get people's full attention for one afternoon than to chase them
around for endless meetings until all the details are flushed out.
168
Changing the plan during a project
169
Planning with user stories
170
User stories and acceptance tests
for this phase of development and which should be left for later. This
helps a lot to eliminate ‘just-in-case’ code.
In essence, user stories are the scope for the project, facilitating long-
term planning and helping us get the big picture of what needs to be
done. Acceptance tests are the detailed specifications that are ironed
out only before the implementation of a particular story or a set of
related stories. With regard to ‘three Cs of user stories’, the specifica-
tion workshop is the conversation and acceptance tests coming out
of the workshop are the confirmation.
Stuff to remember
• Agile acceptance testing and user stories complement
each other incredibly well.
• You do not have to plan projects with user stories, but
there are significant benefits if you intend to introduce
agile acceptance testing.
• User stories focus on customer benefits, so it is easier
for customers to plan based on them.
• Group stories into deliverables by business goals and
make sure that each deliverable can go to production.
• User stories are the scope. Acceptance tests are the
specification.
171
172
Chapter 10
Tools of today
Agile acceptance testing relies on test automation, so much so that
the tools that we use for automation dictate the form in which tests
are recorded and guide us in development. In this chapter, I describe
several tools that you can use for test automation while still keeping
tests in a form that can be understood by both business people and
software implementation teams.
Tools and technologies come and go, but ideas and practices stay with
us. In fact, the incompleteness of today's tools is one of the major
obstacles to the adoption of agile acceptance testing. I expect tools to
improve considerably in the near future, so giving you detailed
instructions on how to use them in this book would not be effective.
You will be able to find more complete and more up-to-date user
manuals for tools online.
FIT
Framework for Integrated Testing (FIT) was the first popular accept-
ance testing framework, originally developed for Java by Ward
Cunningham in 2002. At that time, Ward Cunningham called it “a
tool for enhancing collaboration in software development”.1 One of
the central ideas of FIT was to promote collaboration and allow
customers, testers and programmers to write and verify acceptance
tests together.
1
http://fit.c2.com/
173
Tools of today
FIT works with a tabular model for describing tests. A typical FIT
test is shown in Figure 10.1. Test inputs and expected results are
specified in a table, with expected outcomes ending with a question
mark in the column headings. This tabular form makes it very easy
to write and review tests. Results are presented in the same format.
If a particular expected value does not match the actual outcome, FIT
marks the cell red and prints out both the expected and actual value.
FIT simply ignores everything outside of the tables, so additional
documentation, project notes, diagrams and explanations can be
easily bundled with acceptance tests, providing deeper insight into
the problem domain and helping people understand and verify test
results. All this helps to evolve tests with the code more easily.
These tabular tests are excellent for calculation rules, but they are not
really good for describing workflows or stories. Rick Mugridge has
developed an extension to FIT called FitLibrary that allows us to
specify flow tests as stories in a format similar to English prose (see
Figure 10.2). Although it is technically a separate extension, FitLibrary
is now considered by most people to be part of the standard set of test
types. FIT and FitLibrary together provide about ten different ways
to specify tests with tables, including lists, sets, stories and calculations
based on column and row headings. This makes FIT very flexible and
174
FIT
because of this it remains the most popular tool for acceptance testing
despite much recent competition.
FIT tables connect to the domain code using a very thin glue code
layer. These layers are called fixtures. A fixture is effectively more an
integration API then a testing API. The fixture tells FIT how to
interpret a particular table, where to assign input arguments, how to
execute a test and where to read actual test outputs. The example in
Figure 10.3 is a Column Fixture, which maps table columns to public
fields, properties and methods of the fixture class. In general, FIT
requires very little extra code for testing – just enough to provide a
sanity check for the underlying interfaces. Often, FIT fixtures
constitute the first client of our code.
175
Tools of today
Figure 10.3. FIT fixtures are the glue between tables and
domain code
FitNesse
FIT makes it easy to run tests, but does not provide a way to create
or manage them. The original idea was to write tests in Word, Excel,
or any tool that can output HTML. FitNesse (see Figure 10.4) is a web
wiki front-end to FIT developed by Robert C. Martin and Micah
Martin of Object Mentor in 2005. Today it is the most popular choice
for running FIT tests. It provides an integrated environment in which
we can write and execute tests and speeds up the job with quite a few
useful shortcuts. Although FitNesse is also written in Java, it is not
heavily integrated with FIT, but executes it as an external program.
This is very useful, as it enables us to plug in different test runners.
After the FIT-FitNesse combination became popular in the Java world,
test runners were written for other environments including C++,
Python, .NET and SmallTalk. FitNesse is a web-based server, allowing
easy collaboration. Business analysts and other non-technical people
do not have to set up any software in order to use FitNesse. Any
browser will do just fine. FitNesse also allows us to organise tests into
176
FitNesse
test suites, reuse a shared set-up or tear-down for the entire test suite
and include test components, making tests easier to manage and
maintain long-term.
177
Tools of today
Alternative tools
A number of alternative test runners and test management tools for
FIT have emerged in the last several years. FitClipse by DoubTech2
is an Eclipse plug-in that manages FitNesse tests. BandXI also offer
an Eclipse plug-in3 that enables developers to start and stop FitNesse
from Eclipse and execute tests. Jeremy D. Miller has written
StoryTeller,4 which provides a way to run and manage tests in Visual
Studio. Rick Mugridge is working on ZiBreve,5 a Java IDE for story
tests with WYSIWYG editing and support for refactoring tests. Jay
Flowers has written a plug-in6 for TestDriven.NET that runs FitNesse
tests from Visual Studio.
FIT, FitNesse and most of the supporting tools are open source. For
people requiring commercial support and integration with commercial
tools, there is Green Pepper7 by Pyxis Software. Green Pepper is built
on similar concepts to FIT and FitNesse, but it integrates nicely with
Confluence and JIRA from Atlassian, providing a more integrated
way of managing tests and relating them to development tasks and
issues. An interesting feature of Green Pepper is that it supports
multiple versions of a single test, so that you can mark which version
is actually implemented and which version is being implemented for
the next release, allowing you to manage more easily the transition
from acceptance tests to regression tests and back.
More information
For more information on FIT and FitNesse, see FIT for developing
software[9] by Rick Mugridge and Ward Cunningham and my book
Test Driven .NET Development with FitNesse[22]. The Fixture Gallery8
2
http://www.doubtech.com/development/software/projects/?project=1
3
http://www.bandxi.com/fitnesse/index.html
4
http://storyteller.tigris.org/
5
http://www.zibreve.com/
6
http://jayflowers.com/WordPress/?p=157
7
http://www.greenpeppersoftware.com/en/products/
8
http://sourceforge.net/projects/fixturegallery
178
Concordion
is a free PDF guide that explains all the most popular test (fixture)
types, offering advice on when to use them, when not to use them and
how to save time and effort when writing tests. For more resources,
see the main FitNesse web site http://www.fitnesse.org and the
community-maintained public wiki http://www.fitnesse.info.
Concordion
Concordion, developed by David Peterson and released under the
Apache open source license, is an interesting alternative to FIT. Like
FIT, Concordion uses HTML documents as executable specifications
and requires some glue code (also called fixture code) to connect the
executable elements of the specification to the domain code. Unlike
FIT, Concordion does not require the specification to be in any
particular format – you can write examples as normal sentences,
without any restrictions.
179
Tools of today
180
JBehave
will not ruin hidden test instrumentation, but I would still like to see
a proper test management tool for business people and testers.
Exposing tests in an IDE is great for developers, as they can debug
and troubleshoot tests easily, but testers and business people need to
view tests at a higher level.
Concordion has a really good web site with a helpful tutorial and lots
of examples. For more information on this tool, and to download
links and examples, see http://concordion.org.
JBehave
JBehave is the original behaviour-driven development tool, written
for Java by Dan North, Liz Keogh, Mauro Talevi and Shane Duan.
Behaviour-driven development uses a specific format of test scripts
specified in the given-when-then format (see the section Working
with business workflows on page 57). Here is a typical JBehave test
script, taken from the JBehave source code repository:
181
Tools of today
JBehave test scripts are in plain English, making them really easy to
understand. There is no hidden test instrumentation, which means
that test scripts are easy to maintain and that business people can use
any text editor or word processor to maintain the scripts. This also
means that there is no way to specify lots of related specifications in
a compact format such as a FIT table. I find that the given-when-then
format is better for describing workflows and unique cases, whereas
FIT tables are better for describing calculations and state-machine
changes with lots of related rules.
JBehave feels much more like JUnit than any other tool described
here, so if you are a programmer and want to start diving into
acceptance testing, it might be the easiest one to learn. Compared to
JUnit, it has test scripts externalised into text files and changes the
182
TextTest
language from tests and assertions to what the domain code should
do, emphasising the fact that a test in this case is a specification. Unlike
Concordion, the test script instrumentation is in the fixture class.
This means that test scripts are unaffected by code refactoring, but
it also means that you have to write a lot more code than with
Concordion. Unlike Concordion, there is no standard way to specify
lots of related examples with table attributes. You can, however, extend
the way JBehave parses scenarios by implementing your own converter
to handle such cases. Currently JBehave developers are working on
a standard extension that would allow you to specify related examples
as a table under the ‘other examples include’ heading.9
TextTest
TextTest is a tool for ‘managing system behaviour changes’ written
by Geoff Bache, and it stands out from all the other tools mentioned
here because of its way of working and its unique feature set. Geoff
Bache explains10 it as a move away from trying to write a sequence
of assertions that entirely describes the correct behaviour of the
program:
9
http://www.testingreflections.com/node/view/7339
10
in a private e-mail
183
Tools of today
Systems change over time and so does their behaviour: why not
have a testing tool that assumes this as normal? This view seems
to me entirely in line with an agile view of software
development, though it is a bit of paradigm shift if you're used
to testing with assertions and APIs [...] I don't see this as
different or mutually exclusive to testing in development (if a
program isn't in development, there isn't so much point testing
it). My attitude is that however incomplete the program, it does
something today that is better than nothing: so we manage the
changes in its behaviour and make sure that we always move
forwards, never backwards, when we change the code.
TextTest also supports multiple active versions of the same test and
integrates with xUseCase tools for recording and replaying user
interface tests. xUseCase libraries differ from standard UI recorders
because they associate recorded actions with use case command names
rather than captured UI system events. Use case commands are named
in domain terms, as suggested by business people, testers and
developers. Test scripts can then be written using these domain-
specific names, not by capturing system events. This allows us to focus
user interface test scripts on what the system is intended to do in
terms of the domain, without getting involved in implementation
details. The result is that xUseCase scripts are much easier to under-
stand and manipulate and are much closer to the domain. This is
similar to the domain-specific testing language approach of Mickey
Phoenix and SolutionsIQ, explained in the section Don't describe
business rules through the user interface on page 91. TextTest integ-
184
TextTest
To get the most out of this approach to testing, the key is to create
logs with an appropriate level of detail. Geoff Bache recommends that
good logs should be:
• as readable as possible for someone who knows the system but not
the code
11
http://sourceforge.net/projects/pyusecase/
12
http://jusecase.sourceforge.net/
185
Tools of today
This ultimately leads to much more focus on designing the log files
and having logs that are understandable to non-programmers. I find
this side-effect very interesting, as it should make log files much more
usable for support and troubleshooting in production as well.
186
Selenium
Selenium
Selenium is a web browser automation tool that can manipulate and
validate HTML document object model elements. The three most
common uses of Selenium are automating web user interface tests,
verifying web site compatibility with various browsers and platforms
and periodically checking whether a site is online and works correctly.
In the context of the topic of this book, Selenium is interesting as an
engine that drives acceptance tests through the user interface.
Selenium test scripts are written as tables, with table rows representing
test steps. The first cell in a row contains a command keyword, the
second and third cells contain command arguments. This test language
is known as Selenese. For an example that submits a search form and
validates the output, see Figure 10.8. Selenese has many different
keywords to simulate clicks, type text into fields, load pages, evaluate
text in elements, check for alerts and manipulate and inspect HTML
187
Tools of today
13
see http://selenium-core.openqa.org/reference.html for more information
188
Selenium
189
Tools of today
190
Tools based on Selenium
WebTest fixtures are a library of additional FIT fixtures for Java and
.NET which I wrote to allow business analysts and testers to specify
Selenium tests without actually learning the Selenese language. The
fixtures convert English sentences such as ‘user clicks on Cancel’ and
‘Page contains text Hello Mike’ into Selenium Remote Control
commands, enabling non-programmers to write and maintain user
191
Tools of today
Stuff to remember
• There are many different acceptance testing tools today
on the market.
• Start by evaluating FIT–FitNesse, Concordion and JBehave
for business domain testing.
• Selenium, CubicTest and StoryTestIQ might help you with
UI tests.
• To maintain UI tests more easily, use page objects or
domain-specific keywords to describe actions in a busi-
ness language.
• TextTest can be an interesting choice for inspecting
workflows and building up regression test suites for
existing systems.
192
Chapter 11
Tools of tomorrow
Tool support for agile acceptance testing is today good enough for
us to get our work done, but not good enough for our work to be
really efficient. Early adopters of the practice were forgiving and ready
to overlook problems with tools, working around them or implement-
ing their own solutions. However for this practice to become wide-
spread, we need better tools that give us a shorter learning curve and
allow us to do our jobs more efficiently. As the practice evolves, the
tools need to evolve too. Here are some ideas that I would really like
to see in our tools in the near future.
Domain-specific languages
The idea of domain-specific languages (DSL) seems to be gaining a
lot of momentum currently. The basic idea is to create a specific mini-
programming language, often based on some action-oriented
keywords, focused on a particular business domain and even tailored
to the needs of a particular customer. We then use this mini-language
to describe business processes and constraints. Business people and
domain experts can then effectively participate in programming –
even if they don't want to write in the language themselves, they will
at least be able to read and understand it. So domain-specific
languages can improve communication in a project. Another rationale
behind this idea is that domain-specific language constructs allow us
to describe the business problem more efficiently than with general-
purpose languages. The mini-language is ultimately implemented in
a general purpose language such as Java or C#, so that process defin-
itions written in the business language can be integrated with the
infrastructure.
193
Tools of tomorrow
194
Different user interfaces for different roles
Adam Geras held a talk during the second Agile Alliance Functional
Testing Tools workshop, during which he suggested that instead of
a testing tool or framework a good future base for acceptance testing
using domain-specific languages would be a new virtual machine.1
The virtual machine would provide support for different testing
contexts, including test-first, test-after and exploratory testing. Such
a virtual machine would give us full flexibility to write tests and
specifications in domain-specific languages, but would not impose
any specific functional form or limitations.
1
http://video.google.com/videoplay?docid=-6298610650460170080&hl=en
2
See [23]. Also see http://www.jennittaandrea.com/wp-content/uploads/2007/04/envision-
ingthenextgenerationoffunctionaltestingtools_ieeesw_may2007.pdf.
195
Tools of tomorrow
concerned just with the current state of tests, not so much about the
previous test runs. Testers are typically interested in the results of
earlier test executions and previous versions of tests as well.
I'm not so sure that all these roles can be reconciled in a single user
interface, and I'd like to see multiple user interfaces that focus on
providing the best individual benefits for particular roles. For example,
I would expect better integration with traditional integrated develop-
ment environments for programmers, so that they can debug and
troubleshoot code under test while they are implementing parts of a
specification or bug-fixing. Testers, on the other hand, should not
have to run tests from a programmer IDE, but from an interface that
gives them a quicker global overview with fewer details. Business
people should be able to write and review tests in a visual WYSIWYG
environment similar to a word processor or spreadsheet. I would like
future tools not to attempt to be all things to all men, but to provide
all the features that a particular user needs to do his job efficiently,
while allowing others to use different tools.
Even though some IDEs such as Eclipse offer a rich client application
development framework, I still think that applications based on IDE
frameworks are too technical for business people to use, and that we
need a proper business view of the tests. After all, this is why FitNesse
is still the most popular test management system for FIT tests in spite
of all its problems.
196
Propagating the effects of changes
With tools that skip the fixture part and hook test scripts directly to
domain objects or analyse the raw unprocessed output of domain
classes, refactoring domain code breaks the tests.
I expect that future tools will have much better support for refactoring,
plugging into the integrated development environments and automat-
3
http://sourceforge.net/projects/profit
4
http://studios.thoughtworks.com/twist-agile-test-automation/
197
Tools of tomorrow
Both FIT.NET and Java FitLibrary have started to move towards using
a rich domain model that is more effective than the traditional
mapping of each step into a fixture or a DoFixture method. Domain
fixtures and domain adapters in FIT.NET and Java FitLibrary utilise
rich domain objects without the need to write boiler-plate fixtures.
These mappings are still in the early stages of development and are
not comprehensive – adapters still have to be written for specific
domains. During the Agile 2008 conference, Mike Stockdale organised
a mini-session where he and Rick Mugridge presented some new
features and ideas that they were working on at the time. The session
led to a very interesting discussion on whether we could produce types
of domain adapters and domain fixtures that would allow FIT to
connect directly to most domain services and objects without the need
for any fixtures.
198
Better editors
Better editors
During the second Agile Alliance Functional Testing Tools workshop,
Elisabeth Hendrickson called for better editor tools rather then just
support for refactoring.6 Her idea was that future tools must reduce
the cost of changing tests, allowing us to efficiently reconcile new
expectations with those already expressed as acceptance tests. Better
editors will reduce the cost of change and facilitate change in tests
rather then impede it. Elisabeth Hendrickson pointed out two key
features that future editors should have:
With better editors like these, the lack of support for carrying through
refactoring into acceptance tests would not be such a problem, because
5
http://gojko.net/2008/08/12/fit-without-fixtures/
6
http://video.google.com/videoplay?docid=8565239121902737883&hl=en
199
Tools of tomorrow
200
Visual workflow descriptions
Rick Mugridge has started work to implement test tags for SuiteFix-
ture in FitLibrary. Test tags are arbitrary categories that can be
assigned to tests so that we can list, execute and group tests, providing
a more flexible mechanism to manage tests then the traditional file-
system-based hierarchy. I would really like to see this implemented
in test management tools such as FitNesse rather then in a library-
specific test runner like FitLibrary. Test tags woule meet Jennitta
Andrea's requirement that related tests should be easy to locate.
One of the areas where acceptance testing tools will probably evolve
in the future is visual workflow exploration and specification. Some
tools for this already exist. CubicTest, described in the section Tools
based on Selenium on page 190, has a visual page transition model to
specify web workflows. Brian Marick has written a library that reads
OmniGraffle graph documents and converts them into executable
Ruby on Rails tests.7
7
http://www.exampler.com/blog/2007/07/13/graphical-workflow-tests-for-rails/
201
202
Part IV. Effects on all of us
In this part, I try to answer the most common questions I get from busi-
ness analysts, testers and developers on how agile acceptance testing will
affect their roles. I also dispel common misconceptions and address fears
and issues that people often have about agile acceptance testing because
they have been misled by partial information.
Chapter 12
Effects on business
analysts
During the QCon 2007 conference in London, Martin Fowler and
Dan North organised a session called The Crevasse of Doom,1 to
discuss the communication gap between business users and software
developers. Martin Fowler called this gap the biggest difficulty we
face in software development today. He divided the strategies for
crossing the gap into two groups: the ferry and the bridge.
1
http://www.infoq.com/presentations/Fowler-North-Crevasse-of-Doom
205
Effects on business analysts
206
They will understand the specifications correctly
207
Effects on business analysts
208
You'll save time on acceptance and smoke testing
209
Effects on business analysts
helps significantly to discover the real business rules and to root out
incorrect assumptions, so the customers will be less likely to change
their minds later.
Not only is ‘doing tests’ part of a business analyst's job, but it makes
the rest of your job much more effective.
210
But they will only look at the tests and not read the requirements...
211
Effects on business analysts
Although they will not openly admit this, some business analysts
intentionally leave ambiguity in formal documents as a sort of a
manoeuvering space for later. This allows them to change their mind
or pass on the blame. Being able to pass on the blame is especially
important in bureaucratic organisations, so ambiguity in requirements
is actually a safety net for these people. I consider that using ambiguity
as a safety net is a very bad and unfair practice that has no place in a
good team. As the cost of later change is not large, there is no need
for the safety net. This approach prepares for the failure of the project,
not for success. If you as a business analyst, with a key role in a project,
are preparing from the start for it to fail, what chance does it have of
success?
In most cases, I find that the fear of blame is unfounded and that we
can be much better off if everyone focuses on doing their job properly.
If you work in an organisation that has a blame culture and you need
to start covering your back even before the development starts, then
you have much bigger organisational problems then those addressed
by agile acceptance testing. If you recognise your own company in
212
I won’t understand user stories and tests, I’m used to use cases
213
Effects on business analysts
214
There is no big picture
There is no traceability
When a single person acts as a gateway for all the requirements and
everything is put into a single document, it is relatively easy to keep
track of who ordered what and when, especially if the document is
signed off before development starts. Because of the collaborative
model of agile acceptance testing and because a single phase of
development can be broken down into hundreds of small examples
and tests, some people are concerned about the traceability of
requirements and specifications. After all, implementing a require-
ment costs money and someone ultimately has to approve and pay
for it.
I don't like sign-offs and prefer to work closely with the customers
on building the system that they need. However, if you need to get
official approval, treat the formal set of acceptance tests as the
specification and get a sign-off on it. Most test automation and
management tools allow you to put arbitrary comments on tests, so
you can include the name of the person who approved a particular
test and the date when it was approved. If you implement strict
ownership, which anyway I think is a bad idea, you can list the name
of the person who owns a particular test as well.
215
Effects on business analysts
When user stories are used for project planning, acceptance tests are
derived from stories and you can implement traceability by linking
individual tests to a story, then linking stories to customer benefits
and project goals. You can track who requested a story and when on
individual story cards, or you can put this information into an
acceptance test hierarchy.
Stuff to remember
• The role of the business analyst is changing from that
of a conveyor of information to that of a facilitator who
enables people to share knowledge directly.
• The business analyst is a great choice for the facilitator
of the specification workshop.
• Working with acceptance tests makes the rest of the
business analyst's work easier and more effective.
• You can still keep your traditional documents, but use
acceptance tests as the authoritative specification.
• You can modify the specification (acceptance tests) when
the development starts without causing great problems
for anyone.
• There should be no handover of tests from business
analysts to developers or testers.
• Tests don't have to be perfect from the start.
• Getting it right is not your sole responsibility. Developers
and testers share responsibility for the specifications.
216
Chapter 13
Effects on testers
In 2005 I worked with a development organisation that had a remote
testing department. The testing team was considered completely
ineffective since many problems passed undetected through them,
and developers generally considered talking to the testing department
as a waste of time. To be fair to the testers, they were expected to grasp
instantly whatever the developers produced and test it without
knowing the first thing about it. Nobody wanted to spend any time
explaining anything to them and there was simply no feedback in the
whole process. I think that having a detached testing team simply
does not work, nor does getting testers involved at the end. In the
words of Philip Crosby, “Quality has to be caused, not controlled”.
This does not mean that there is no place for testers in agile processes
– far from it – but that the role of the tester has to change. Agile
acceptance testing is a great manifestation of this.
1
http://video.google.com/videoplay?docid=-5105910452864283694
217
Effects on testers
218
You will have a much better understanding of the domain
As you can add tests for any bugs found in production to the accept-
ance test suite, you can be sure that the bugs will not resurface, or at
least that the developers will find out about resurrected bugs and fix
them before you need to get involved.
219
Effects on testers
This is one of the key contributions that testers should make to the
project. Developers and business analysts think about the system from
the perspective of making it work and they usually don't try to use
the system in unexpected ways or go down unpredictable paths.
220
Better relationships in the team
Testers, on the other hand, are specialised in this. By giving you more
time to do this, agile acceptance testing empowers you to perform
better exploratory testing and provide much better feedback from
your experiments.
Having more time for experimenting also allows you to refine and
expand the suite of regression tests based on what you learn during
exploratory testing and to suggest more possible problems in work-
shops for iterations to come. So acceptance testing, test automation
and exploratory testing are linked together in a positive reinforcing
loop.
221
Effects on testers
Agile acceptance testing gives testers much more influence over the
project – the testing department can finally have a say in what gets
produced, not just what gets fixed. It also allows you to be more
productive in testing, because you will run into fewer blocking issues
as key concerns will have been communicated before development
starts.
It's cheating
A very strange argument I have heard on a few occasions against agile
acceptance testing is that it is effectively cheating. The argument goes
that with agile acceptance testing, testers are required to tell the
developers exactly what they are going to check, so the developers can
implement the software to pass the tests upfront.
222
Will I lose my job because of this automation?
competition. If the developers don't put the problem into the system
in the first place, it's more efficient than you catching the problem
later and returning it back to them for fixing. It does not matter who
put the bug in, who caught it and who fixed it. Agile acceptance testing
asks us to not create the bug in the first place.
223
Effects on testers
224
Will I lose my job because of this automation?
If you are worried about your job, learn all you can about the business
domain. With a testing mind-set and business knowledge, you can
help developers and business people see their blind spots. This will
make your contribution much more visible and your position much
more important. Specification workshops help you do this because
you will be right there with the experts, getting the chance to learn
about the domain and discuss the software before it gets developed.
Mike Scott wrote2 that he had noticed the blending of analyst and
tester roles: “when we start recognising the tests as executable
specifications you rapidly realise that the role is practically the same”.
He gives the example of a client organisation that makes no distinction
between testers and business analysts, and just has a single analyst
role. According to Scott the only problems with this are personal, as
business analysts tend to think of a test role as a demotion. I noticed
the same thing in an organisation that I provided consultancy to in
early 2008, where one of the business analysts was really enthusiastic
about acceptance testing but her superior rejected the idea. The analyst
was given permission to participate in acceptance testing provided
her role was renamed to test analyst. Her boss insisted that she was
no longer a business analyst if she was involved in anything related
to testing.
2
in a private e-mail
225
Effects on testers
In any case, agile acceptance testing practices can help you on this
path as well, as it encourages you to work closely with developers.
Pair up with a developer and learn how they write fixtures and auto-
mate tests, then start taking over these parts of the role.
3
http://skillsmatter.com/podcast/home/understanding-qatesting-on-agile-projects
4
http://members.microsoft.com/careers/careerpath/technical/softwaretesting.mspx
5
http://www.testingreflections.com/node/view/7280
226
Acceptance tests will not catch all problems
Some things cannot be easily automated and every tool that you decide
to use will have its good and bad sides. But applying agile acceptance
testing does not prevent you from running any other tests or using
different tools. It even gives you more time to focus on things that
cannot be caught by acceptance tests. Instead of verifying every single
business rule, you can be confident that they are correct and spend
more time sanity testing or running exploratory tests.
Also, while a team is learning how to use agile acceptance testing and
getting buy-in from their business users or customers, it is likely that
some things will still fall though the communication gap. Instead of
using this to point out flaws in agile acceptance testing, I urge you to
work out why things were missed in the first place and help improve
the specification workshop for the next iteration. As a tester, your
job is to come up with bug prevention strategies, not to find bugs at
the end.
Stuff to remember
• The new primary role of testers is to help people avoid
problems, not to discover them.
227
Effects on testers
228
Chapter 14
Effects on developers
Although the role of developers changes with the introduction of agile
acceptance testing, I find that they are generally enthusiastic about
the idea and do not put up any resistance. From a technical
perspective, most developers see it just as an extension of test-driven
development principles, and TDD is now becoming well established
among software developers. However developers are sometimes overly
enthusiastic and forget about the requirement to collaborate. They
take over more responsibility than they should, losing the benefits of
shared understanding and communication.
229
Effects on developers
230
Business analysts will really understand special cases
231
Effects on developers
all the tests pass, we know that the work is done. If a previously passing
test fails, we have broken something.
Having this kind of live documentation is also very useful when you
need to hand over the code to another team or organisation.
232
Acceptance tests turn out to be incomplete
code and maintain it. On the other hand, this should produce a much
more accurate and clear target for development, reducing later rework
caused by misunderstandings or incomplete specifications. From my
experience, the overall result is much less work for developers rather
then more work, although in the beginning this new work does seem
to be additional.
One potential issue with this is that the benefits of agile acceptance
testing are not that obvious or instant. You won't necessarily notice
straightaway that you have less rework to do, since there is usually a
time lag between delivery of code and requests for rework arriving.
The reductions in bug numbers and change requests are also hard to
spot when you are looking only at the current iteration. To truly
evaluate the benefits of agile acceptance testing, you have to look at
the way you work from a wider perspective and compare the whole
process after the introduction of acceptance testing with the way it
was before.
233
Effects on developers
234
There is too much duplication
Rather than waiting for a phase of the project to end and then
discovering parts of the code that are not covered by tests, chase your
business people to help you with defining how the system should
behave before developing these parts. Once you have some experience,
you will identify most of these cases in the specification workshop
anyway, so you should not have such a big problem with code test
coverage.
If there is no buy-in from the business side and they do not want to
discuss examples, I would suggest that you are better off without the
acceptance tests than with acceptance tests that you make up
yourselves. At least you will not have a misleading specification.
This does not mean that developers cannot write functional tests at
all. Unit tests, component tests and integration tests can and should
all be written to reflect the developer's view of the system and concerns
with a particular piece of code or way of working. They might even
be automated using the same tools as acceptance tests, but they are
not a replacement for them, and neither do they in any way make up
for the communication benefits obtained through specification
workshops.
235
Effects on developers
Resist the urge to restructure and reorganise tests so that they are
easy to maintain but no longer easy to understand. Acceptance tests
are not code. They need to be used for communication with business
people over the life of the project, so they have to be able to read and
understand them. If you reformat a test so that only a developer can
understand it, you might as well throw it away.
236
Unit tests give us better feedback
The only thing I can offer as a consolation is that tools are evolving.
One of the most important areas where tools need to improve is to
provide multiple views for different people, so that developers can
keep working from an IDE and business people can use something
more convenient for them. For the time being, tools are a big problem
for everyone, but the point of agile acceptance testing is not in tools
but in the conversation.
You need to understand that acceptance tests are not really there to
provide feedback on the code, so expecting them to do so is a mistake.
Acceptance tests are primarily a communication tool for people.
Comparing them to unit tests, even from a developer perspective,
does not make any sense. Use normal unit tests to drive the develop-
ment of small pieces of code, use acceptance tests to guide the overall
effort.
237
Effects on developers
Stuff to remember
• You cannot write acceptance tests yourself.
• You need to participate in domain discussions.
• Specification workshops give you a good chance to
discuss edge cases and inconsistencies with domain
experts before development.
• Acceptance tests do not provide instant feedback as unit
tests do. This is because they deal with the overall picture
and business rules, not code units.
• You need both unit tests and acceptance tests.
• Acceptance tests exist to facilitate communication
between people.
238
Appendix A.
Resources
Books and articles
[1] Tracy Reppert. Copyright © 2004. Software Quality Engineering.
Better Software Magazine: Don't just break software, make
software. July/August 2004.
[4] Gary Klein. Copyright © 1999. The MIT Press. Sources of Power:
How People Make Decisions. 0262611465.
239
Resources
[10] David Lorge Parnas, Ryszard Janicki, and Jeffery Zucker. Copy-
right © 1996. Springer Verlag. Relational Methods in
Computer Science:Tabular representations in relational
documents . pages 184-196. 978-3-211-82971-4.
[12] Mike Cohn. Copyright © 2005. Prentice Hall PTR. Agile Estimat-
ing and Planning (Robert C. Martin Series). 0131479415.
240
Online resources
[22] Gojko Adzic. Copyright © 2008. Neuri Limited. Test Driven .NET
Development With FitNesse. 0955683602.
Online resources
Here are the links to all the online resources mentioned in the book.
You can find all these links and more on the accompanying web site
http://www.acceptancetesting.info.
241
Resources
Presentations
• Gilles Mantel: Test Driven Requirements Workshop from Agile
2008. http://testdriveninformation.blogspot.com/2008/08/material-
of-tdr-workshop-at-agile-2008.html
• Michael Phoenix: Domain Specific Testing Languages from Agile
2008. http://www.solutionsiq.com/agile2008/agile-2008-
domain.php
• Naresh Jain: Acceptance Test Driven Development.
http://www.slideshare.net/nashjain/acceptance-test-driven-devel-
opment-350264
Articles
• Brian Marick: An Alternative to Business-Facing TDD.
http://www.exampler.com/blog/2008/03/23/an-alternative-to-
business-facing-tdd/
• Brian Marick: My Agile testing project.
http://www.exampler.com/old-blog/2003/08/21/
• Dan North: Introducing BDD. http://dannorth.net/introducing-
bdd
• Gojko Adzic: Fitting Agile Acceptance Testing into the development
process. http://gojko.net/2008/09/17/fitting-agile-acceptance-test-
ing-into-the-development-process/
• Jennitta Andrea: Envisioning the next generation of functional
testing tools. http://www.jennittaandrea.com/wp-
content/uploads/2007/04/envisioningthenextgenerationoffunction-
altestingtools_ieeesw_may2007.pdf
242
Tools
Tools
• Concordion: http://www.concordion.org
• Cubic Test: http://www.cubictest.com
• FitNesse main web site: http://fitnesse.org
• FitNesse community site: http://www.fitnesse.info
• Green Pepper: http://www.greenpeppersoftware.com/en/products/
• JBehave: http://jbehave.org
• JUseCase: http://jusecase.sourceforge.net/
• PyUseCase: http://sourceforge.net/projects/pyusecase
• Selenium: http://selenium.openqa.org/
• StoryTestIQ: http://storytestiq.solutionsiq.com
• Twist: http://studios.thoughtworks.com/twist-agile-test-automa-
tion/
• Text Test: http://www.texttest.org
Mailing Lists
• Agile acceptance testing (the companion mailing list to this book):
http://groups.google.com/group/agileacceptancetesting
• Agile Testing: http://tech.groups.yahoo.com/group/agile-testing
243
Resources
244
parameterisation 85
Index running 115, 121
saving time 209
self-explanatory 84
Symbols trust 93
.NET tools 176 what they are not 97
who should write 95
written by developers 129, 156,
A 235
A-7 project 54
action-oriented tests 129
abnormal use 51
affiliate advertising example 45, 59
abstract requirements 103
Agile 2008 15, 25, 27, 43, 93, 183,
acceptance criteria 75
186, 198
acceptance test-driven development
agile acceptance testing
37
defined 31
acceptance tests
introducing 148
and refactoring 110, 197
not a development methodology
and user stories 169
141
as business resource 120
not a silver bullet 227
as documentation 119
testing 34
as focus for development 33, 211
Agile Alliance Functional Testing
as specification 75, 103
Tools workshop 195, 199
as workflows 79
agile development 4, 142
changing 106
agile testing xxii
code coverage 104, 235
Amazon EC2 Cloud 189
common problems 126
ambiguity
communication technique 234
manoeuvering space 212
compared to unit tests 110, 113,
polls 65
115
Andrea, Jennitta 195, 200, 201
converting examples to 87
anti-goals 71, 105
customer-specific 85
API documentation 119
design hints 107
architectural vision 107
executing 115
Arnold, Ken 161
facilitating changes 34
Asch, Solomon 20
handover 98
Atlassian 178
incomplete 233
Auer, Ken xv
maintaining 126, 210
Auftragstaktik 29
not complete verification 100
245
Index
246
cleaning up tests 132, 133 Crispin, Lisa xxii
code coverage 104, 235 Crosby, Philip 217
code sharing 232 CRUD example 161
cognitive diversity 20 Cruise Control 123
Cohn, Mike xxii, 62, 65, 159, 213 CubicTest 190, 201
collaboration 141, 229 Cucumber 183
Column Fixture 175, 179, 183 Cunningham, Ward xv, xxii, 54, 80,
combinatorial explosion effect 56 173, 178
commander's intent curly braces 161
effectiveness 30 customer acceptance testing 34, 37
modified template 70 customer benefits 163
common parts of tests 111 customer representatives
communication 133, 141, 234 not domain experts 62
bridging the gap 25 not present during workshops
effects of problems 4 72
facilitating 99 customer-specific acceptance tests
gaps 5 85
of intent 18, 29 customer tests xxi
of requirements 3
problem 36 D
strategies 205 Dassing, Andy 113
with examples 26 database dependencies 130
completeness of code 104 Davenport, Tom 22
complexity of tests 133 defects 124
Concordion xxii, 80, 179, 194 deliverables 166
conflicts between business rules delivery plan 168
121, 208 describe-demonstrate-develop xxii,
Confluence 178 142
conformity experiment 20 design
Connextra story card format 165 domain-driven 109
continuous integration 116, 121, evolving 109
123 feature-driven 109
costs hints 107
due to misunderstandings 14 improving 119
of changes 4, 212 model-driven 109
Crain, William 30 detail in tests 84
credit card transaction example 57 developers
Crevasse of Doom presentation 28 benefits 230
247
Index
248
search system 114 F
shopping carts 84 facilitators 70, 152
string tokenisation 114 fake objects 115
toothbrush 43 fear of blame 212
video tour 19 feature-driven design 109
VIP customers 49, 52 feedback exercises 65
Windsor knot 44 feedback from tests 237
example-driven development 38 ferry communication strategy 205
examples FIT xxii, 36, 54, 88, 96, 173, 194,
as acceptance tests 32 196
building a shared understanding table 214
32 user interfaces 91
choosing right set 76 FIT.NET 198
communicating with 26 FitClipse 178
converting to tests 82, 87 FitLibrary xxii, 174, 198, 201
differences in similar 52 FitNesse xxii, 36, 96, 176, 196
extending 131 user interfaces 91
hard to automate 90 version control system 200
identifying important 50 web sites 179
realistic 48 five-pointed star 10
real-world 32 Fixture Gallery 178
relationship with tests and fixtures 110
requirements 27 Concordion 180
reviewing 72 domain 198
sign-off 76 domain-specific languages 194
executable code 119 FIT 175, 179
executable specifications 38, 113 WebTest 191
experiment flexibility during development 125
conformity 20 Flowers, Jay 178
five-pointed star 10 flower shop example 52, 82
line length 20 foreign currency exchange example
peer pressure 20 14
US Army 9 Fowler, Martin 28, 109, 205
exploratory testing 152, 220 Framework for Integrated Testing
extending examples 131 (see FIT)
Extreme Programming xxii fraud detection example 49, 166
free delivery example 52, 82
249
Index
250
line length experiment 20 numerical edge cases 51
live specification 76, 119
log files 184, 185 O
long tests 127 Object Mentor xxii, 176
obviousness 9
M OmniGraffle 201
mailing lists 155 Ono, Taichi xxii
Mantel, Gilles 15 open issues
Marcano, Antony xxii, 226 at workshops 72
telephone game 6 automating tests 89
Marick, Brian xxi, 37, 151, 201 order of execution 131
Martin, Micah 176 organising tests 134, 200
Martin, Robert C. 26, 176
McConnell, Steve 156 P
media clips example 49 Page Object 95
Melnik, Grigori 26 paralysis by analysis 160
mentors 154 parameterisation of acceptance tests
metrics 223 85
Microsoft tester-developers 226 parameters with same values 128
Miller, Jeremy D. 178 Parnas, David 54
Minesweeper Kata screencast 186 Pearl Harbor 20
Mission Command 29 peer pressure experiment 20
mistake-proofing 86 performance tests 90, 117
misunderstandings 8 not automated 214
costs 14 Peterson, David xxii, 80, 84, 179
mock objects 115, 130 phased implementation 151
model-driven design 109 Phoenix, Mickey 43, 93, 184
Mugridge, Rick xxii, 54, 80, 120, placeholders 169
174, 178, 198, 201 planning poker 65
multiple active versions 200 Platt, Lew 22
poker example 14
N Poppendieck, Mary xxii, 105, 170,
Neumann, John von 142 217
neutral facilitators 153 Poppendieck, Tom xxii, 105
new features 105 pre-planning 146
normal use 51 processing workflows 54, 79
North, Dan xxi, 28, 38, 181, 205 product owners xvii, 15
251
Index
252
Selenium 91, 94, 187 sign-off 75
Grid 189 traditional 7
IDE 188 specifications over scripting xxii
Remote Control 189 specification workshops 104, 150
self-explanatory acceptance tests 84 compared to design workshops
set-up section 111, 132 69
shared understanding 44, 60, 64, 66 domain language 68
Shattuck, Lawrence G. 9 facilitating discussion 207
Shingo, Shigeo xxii, 86 facilitators 70, 152
shopping carts example 84 feedback exercises 66
Shore, Jim xxi, 142 for user stories 170
showstopper bugs 125 implementation issues 64
sign-off 75, 161, 212, 215 in iterations 144
similar tests 128 introduced 60
Smalltalk tools 176 keeping focused 70
SMART acronym 77 open issues 72
smoke testing 209 output 63
software design engineer in test 226 preparing for 61
software developers (see reviews 72
developers) role of customers and business
software in production blocks 167 analysts 61, 64
SolutionsIQ 184, 191, 194 running 60
source code 119 what they are not 68
source tests 86 who should attend 60
specification by example xxi speed cameras 223
specifications spine stories 50
acceptance tests 103 Spirit of Kansas, The 21
compared to business goals 15 state machines 127, 128
compared to scope 160 steps in JBehave 182
distilling 80 Stewart, Simon 95
executable 38 Stockdale, Mike 198
flexible 126 StoryTeller 178
live 119 storytest-driven development xxi,
maintaining 210 37
out-of-date 119 StoryTestIQ 191
prefer to scripting 128, 133 string tokenisation example 114
read by developers 206 stub objects 115
reviews 97 style wars 161
253
Index
254
Thomas, David 122 unreasonable use 51
ThoughtWorks xviii, 123, 187, 197 unreliable tests 130
three Cs of user stories 164, 171 usability
time testing 117
business analysts 209, 210 usability tests 90
developers 232 not automated 214
freeing up 220 US Army xxii, 9, 29
timing issues 130 use cases
tools compared to user stories 161
current 173 verifying 50
future 193 user acceptance testing 34, 37
IDE integration 236 user interfaces 214
Toyota Production System xxii, 86 bugs 152
traceability 215 tailored to roles 195
training 155 testing through 91
transactions 130 test robots 220
translation layer 198 workflows 94
translation of tests 88 user interface testing 91, 227
trust 93 record-and-replay 184
Twist 197 recorders 194
web 187
U user stories xxii
UAT (see user acceptance testing) and acceptance tests 169
ubiquitous language xxii, 66, 67, as placeholders 169
134, 199 benefits 162
consistent use 111 business goals 167
UML 56 cards 164
unanswered questions compared to use cases 161
at workshops 72 easily understood 213
automating tests 89 first cut 165
understanding the domain 44, 60, introduced 160
64, 66 verifying 50
unit tests 35, 129, 234 US Naval Research Lab 54
compared to acceptance tests
110, 113, 115 V
effective 116 version control systems 135, 216
feedback 237 video tour example 19
purpose 114 VIP customers example 49, 52
255
Index
X
xUseCase 184
compared to domain-specific
languages 93
Y
Yahoo groups 155
256
The story continues
online
You can find more about agile acceptance testing and specification by
example on the companion web site http://www.acceptancetesting.info,
where you can also register your copy of the book to get free PDF updates.
257
258