- •Contents
- •Preface
- •Acknowledgments
- •About the author
- •About the cover illustration
- •Higher product quality
- •Less rework
- •Better work alignment
- •Remember
- •Deriving scope from goals
- •Specifying collaboratively
- •Illustrating using examples
- •Validating frequently
- •Evolving a documentation system
- •A practical example
- •Business goal
- •An example of a good business goal
- •Scope
- •User stories for a basic loyalty system
- •Key Examples
- •Key examples: Free delivery
- •Free delivery
- •Examples
- •Living documentation
- •Remember
- •Tests can be good documentation
- •Remember
- •How to begin changing the process
- •Focus on improving quality
- •Start with functional test automation
- •When: Testers own test automation
- •Use test-driven development as a stepping stone
- •When: Developers have a good understanding of TDD
- •How to begin changing the team culture
- •Avoid “agile” terminology
- •When: Working in an environment that’s resistant to change
- •Ensure you have management support
- •Don’t make test automation the end goal
- •Don’t focus on a tool
- •Keep one person on legacy scripts during migration
- •When: Introducing functional automation to legacy systems
- •Track who is running—and not running—automated checks
- •When: Developers are reluctant to participate
- •Global talent management team at ultimate software
- •Sky Network services
- •Dealing with sign-off and traceability
- •Get sign-off on exported living documentation
- •When: Signing off iteration by iteration
- •When: Signing off longer milestones
- •Get sign-off on “slimmed down use cases”
- •When: Regulatory sign-off requires details
- •Introduce use case realizations
- •When: All details are required for sign-off
- •Warning signs
- •Watch out for tests that change frequently
- •Watch out for boomerangs
- •Watch out for organizational misalignment
- •Watch out for just-in-case code
- •Watch out for shotgun surgery
- •Remember
- •Building the right scope
- •Understand the “why” and “who”
- •Understand where the value is coming from
- •Understand what outputs the business users expect
- •Have developers provide the “I want” part of user stories
- •When: Business users trust the development team
- •Collaborating on scope without high-level control
- •Ask how something would be useful
- •Ask for an alternative solution
- •Make sure teams deliver complete features
- •When: Large multisite projects
- •Further information
- •Remember
- •Why do we need to collaborate on specifications?
- •The most popular collaborative models
- •Try big, all-team workshops
- •Try smaller workshops (“Three Amigos”)
- •Pair-writing
- •When: Mature products
- •Have developers frequently review tests before an iteration
- •When: Analysts writing tests
- •Try informal conversations
- •When: Business stakeholders are readily available
- •Preparing for collaboration
- •Hold introductory meetings
- •When: Project has many stakeholders
- •Involve stakeholders
- •Undertake detailed preparation and review up front
- •When: Remote Stakeholders
- •Prepare only initial examples
- •Don’t hinder discussion by overpreparing
- •Choosing a collaboration model
- •Remember
- •Illustrating using examples: an example
- •Examples should be precise
- •Don’t have yes/no answers in your examples
- •Avoid using abstract classes of equivalence
- •Ask for an alternative way to check the functionality
- •When: Complex/legacy infrastructures
- •Examples should be realistic
- •Avoid making up your own data
- •When: Data-driven projects
- •Get basic examples directly from customers
- •When: Working with enterprise customers
- •Examples should be easy to understand
- •Avoid the temptation to explore every combinatorial possibility
- •Look for implied concepts
- •Illustrating nonfunctional requirements
- •Get precise performance requirements
- •When: Performance is a key feature
- •Try the QUPER model
- •When: Sliding scale requirements
- •Use a checklist for discussions
- •When: Cross-cutting concerns
- •Build a reference example
- •When: Requirements are impossible to quantify
- •Remember
- •Free delivery
- •Examples should be precise and testable
- •When: Working on a legacy system
- •Don’t get trapped in user interface details
- •When: Web projects
- •Use a descriptive title and explain the goal using a short paragraph
- •Show and keep quiet
- •Don’t overspecify examples
- •Start with basic examples; then expand through exploring
- •When: Describing rules with many parameter combinations
- •In order to: Make the test easier to understand
- •When: Dealing with complex dependencies/referential integrity
- •Apply defaults in the automation layer
- •Don’t always rely on defaults
- •When: Working with objects with many attributes
- •Remember
- •Is automation required at all?
- •Starting with automation
- •When: Working on a legacy system
- •Plan for automation upfront
- •Don’t postpone or delegate automation
- •Avoid automating existing manual test scripts
- •Gain trust with user interface tests
- •Don’t treat automation code as second-grade code
- •Describe validation processes in the automation layer
- •Don’t replicate business logic in the test automation layer
- •Automate along system boundaries
- •When: Complex integrations
- •Don’t check business logic through the user interface
- •Automate below the skin of the application
- •Automating user interfaces
- •Specify user interface functionality at a higher level of abstraction
- •When: User interface contains complex logic
- •Avoid recorded UI tests
- •Set up context in a database
- •Test data management
- •Avoid using prepopulated data
- •When: Specifying logic that’s not data driven
- •Try using prepopulated reference data
- •When: Data-driven systems
- •Pull prototypes from the database
- •When: Legacy data-driven systems
- •Remember
- •Reducing unreliability
- •When: Working on a system with bad automated test support
- •Identify unstable tests using CI test history
- •Set up a dedicated continuous validation environment
- •Employ fully automated deployment
- •Create simpler test doubles for external systems
- •When: Working with external reference data sources
- •Selectively isolate external systems
- •When: External systems participate in work
- •Try multistage validation
- •When: Large/multisite groups
- •Execute tests in transactions
- •Run quick checks for reference data
- •When: Data-driven systems
- •Wait for events, not for elapsed time
- •Make asynchronous processing optional
- •Getting feedback faster
- •Introduce business time
- •When: Working with temporal constraints
- •Break long test packs into smaller modules
- •Avoid using in-memory databases for testing
- •When: Data-driven systems
- •Separate quick and slow tests
- •When: A small number of tests take most of the time to execute
- •Keep overnight packs stable
- •When: Slow tests run only overnight
- •Create a current iteration pack
- •Parallelize test runs
- •When: You can get more than one test Environment
- •Try disabling less risky tests
- •When: Test feedback is very slow
- •Managing failing tests
- •Create a known regression failures pack
- •Automatically check which tests are turned off
- •When: Failing tests are disabled, not moved to a separate pack
- •Remember
- •Living documentation should be easy to understand
- •Look for higher-level concepts
- •Avoid using technical automation concepts in tests
- •When: Stakeholders aren’t technical
- •Living documentation should be consistent
- •When: Web projects
- •Document your building blocks
- •Living documentation should be organized for easy access
- •Organize current work by stories
- •Reorganize stories by functional areas
- •Organize along UI navigation routes
- •When: Documenting user interfaces
- •Organize along business processes
- •When: End-to-end use case traceability required
- •Listen to your living documentation
- •Remember
- •Starting to change the process
- •Optimizing the process
- •The current process
- •The result
- •Key lessons
- •Changing the process
- •The current process
- •Key lessons
- •Changing the process
- •Optimizing the process
- •Living documentation as competitive advantage
- •Key lessons
- •Changing the process
- •Improving collaboration
- •The result
- •Key lessons
- •Changing the process
- •Living documentation
- •Current process
- •Key lessons
- •Changing the process
- •Current process
- •Key lessons
- •Collaboration requires preparation
- •There are many different ways to collaborate
- •Looking at the end goal as business process documentation is a useful model
- •Long-term value comes from living documentation
- •Index
12 Speciication by Example
Not only for agile teams
Collaborating on |
speciications |
isn’t something |
that |
only |
agile |
teams |
can |
ben- |
|||||||
eit |
from. |
BridgingIn |
the Communication Gap,† I |
suggested |
that a |
similar set |
of |
|
|
||||||
practices |
could |
be applied to more |
traditional |
structured |
processes. |
After |
the |
||||||||
book was published, I came |
across |
an |
example of a company |
that |
did |
just that |
|||||||||
while researching |
this book. |
|
|
|
|
|
|
|
|
|
|
|
|||
Matthew |
Steer, |
a |
senior test |
consultant at the Sopra Group in the |
UK, |
helped |
|||||||||
a |
major |
telecommunication |
company |
with |
a |
third-party |
ofshore |
software |
delivery partner implement these practices. The main reason for change was the
realization that projects were sufering from poorly deined requirements. Steer |
|
||||||||||||||||||||||||
compared |
delivery |
in |
|
the |
year |
when |
ideas |
were |
implemented |
|
to the |
costs |
of |
||||||||||||
delivering |
software |
the previous year. Not surprisingly, with |
a |
Waterfall |
|
||||||||||||||||||||
approach these projects did not get |
to a zero-defect |
level, |
|
but |
the |
changes |
|||||||||||||||||||
“increased |
upstream |
defect |
detection |
and |
reduced |
downstream |
|
rework |
and |
|
|||||||||||||||
costs.” |
According |
to |
Steer: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
We |
|
were |
able |
to |
demonstrate |
the |
efectiveness |
of |
this |
|
approach |
|
|||||||||||
|
|
|
|
|
|||||||||||||||||||||
|
by catching |
|
many |
more defects |
earlier in the life |
cycle that |
were- |
tradition |
|
|
|||||||||||||||
|
ally |
found |
|
at |
later |
phases. The volumes of |
defects |
at |
the |
end |
of |
the life |
|||||||||||||
cycle |
signiicantly reduced and the |
pile |
increased |
at |
the early phases |
of |
|
|
|||||||||||||||||
the |
life |
cycle. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
The |
end |
result |
was |
a |
delivery |
cost savings |
of |
over |
1.7 |
million |
GBP |
in |
2007 |
alo |
||||||||||
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
† Gojko |
Adzic,Bridging the Communication Gap: Speciication by Example and |
|
|
|
|
|
||||||||||||||||||
|
Agile Acceptance Testing (Neuri |
Limited, |
2009). |
|
|
|
|
|
|
|
|
|
|
|
Less rework
Generally, frequent releases promote quick feedback, enabling development teams to ind mistakes and ix them sooner. But iterating quickly doesn’t prevent mistakes. Often, teams take three or four stabs at implementing a feature; developers claim this is because customers don’t know what they want until they get something to play with. I disagree. With Speciication by Example, teams generally hit the target in the irst attempt. This saves a lot of time and makes the delivery process more predictable and reliable.
The Sky Network Services (SNS) group at British Sky Broadcasting Corporation in London is responsible for broadband and telephony provisioning software with high business worklow and integration complexity. The group consists of six teams. They have been using Speciication by Example for several years. According to Rakesh Patel, a senior agile Java developer there, “We do tend to deliver when we say we do,” and
Chapter 1 Key beneits |
13 |
the group has a great reputation within Sky. At one time, Patel briely worked with a different organization; he compared the two teams as follows:
Every time they [developers in the other organization] give software to testers towards the end of the sprint, testers ind something wrong and it always comes back to the developers. But here [at Sky] we don’t have that much churn. If we have an issue, we have an issue to make a test go green during development—it either does or it doesn’t. We can raise it there and then.
Several other teams noticed a signiicant reduction of rework, including LeanDog, a group developing an aggregation application for a large insurance provider in the United States. Their application presents a uniied user interface on top of a host of mainframe and web-based services and is further complicated by a large number of stakeholders from across the country. Initially, the project suffered from many functional gaps in requirements, according to Rob Park, an agile coach at LeanDog who helped the team with the transition. He said,
As we started iguring stuff out, we needed clariication, and then we found out that we have to actually do something else.
The team implemented Speciication by Example, which resulted in much better speciications and reduced rework. Although developers continue to have questions for business analysts when they start working on a story card, “The questions have dropped considerably, as has the amount of back and forth we have to have and the questions are a lot different,” said Park. For him, the most rewarding aspects of Speciication by Example is “getting the sense of the story and knowing the extent of the story as you start to build it.”
Many teams have also discovered that using Speciication by Example to make requirements more precise at the start of a development cycle makes it easier to manage product backlogs. For example, being able to spot stories that are too vague or have too many gaps in required functionality early on prevents problems later. Without Speciication by Example, teams often discover problems in the middle of an iteration, which interrupts the low and requires time-consuming renegotiations—in larger companies, stakeholders who decide on the scope are often not readily available.
Speciication by Example helps teams establish a collaborative speciication process that lowers problems in the middle of an iteration. Additionally, Speciication by Example its into short iterations and doesn’t require months of writing long documents.
Less rework is a major advantage for the Global Talent Management team at Ultimate Software in Weston, Florida. Collaborating on speciications had a signiicant impact on focusing the development effort. According to Scott Berger, a senior development engineer in test at Ultimate Software:
14 Speciication by Example
Meeting with our product owners to review our test scenarios prior to the team accepting a story readily allows the working group (product owner, developer, tester) to clarify ambiguous or missing requirements. On occasion, the outcome of the meeting has even resulted in the cancellation of stories, for example, when test scenarios reveal hidden complexity or conlicting requirements within the system. After one such discussion, the decision was made to nearly redesign an entire feature! Product owners are afforded the opportunity to rewrite and reslice the speciications, as opposed to having the development effort begin and halt or cancel the story midstream. By holding these meetings, we ind ourselves being both more productive and eficient, because waste is reduced and vague and missing speciications are minimized. It also allows the team to come to a common understanding of what is expected.
Most teams have signiicantly reduced or completely eliminated rework that occurred as a result of misunderstood requirements or neglected customer expectations. The practices described in this book allowed teams to engage better with their business users and ensure a shared understanding of results.
Better work alignment
Another important beneit of Speciication by Example is the capacity to align different software development activities into short iterative cycles. From my experience and according to the case studies in this book, one of the most common stumbling points for teams moving to Scrum is the inability to fully complete tasks inside an iteration. Many teams hold onto the “old world” concepts: inish development irst, then inish testing, and, inally, polish the product enough for it to be deployable. This fosters the illusion that development is completed in stages, when in fact subsequent testing and ixing are required for completion. One “done” column on the Scrum board means a developer thinks something is inished, a “done-done” column means the tester agrees, and so on (there are even reports of “done-done-done” columns). Work often falls into this pattern, and the results from testing affect the next cycle, causing much variability and making the delivery process less predictable.
Speciication by Example resolves this issue. The practices described in this book enable teams to clearly deine a target that’s universally understood and objectively measured. As a result, many teams ind that their analysis, development, and testing activities became better aligned.
Chapter 1 Key beneits |
15 |
A good example of improved alignment occurred at uSwitch, one of the busiest websites in the United Kingdom. uSwitch implemented Speciication by Example in 2008 because they had dificulty knowing when a feature was completed. “We’d inish something, give it over to the QA department, and they would immediately say to us that we forgot to test it in a certain scenario. This caused a lot of problems for us,” said Stephen Lloyd, a developer who works on the website. By implementing Speciication by Example, they overcame that problem. Lloyd said that they’re now better integrated as a team and have a better understanding of the needs of the business. The process changes also resulted in improved software quality. Hemal Kuntawala, another developer working on the site, had this comment:
Our error rates have dropped signiicantly, across the site. The turnaround of ixing problems is much quicker than it was previously. If a problem does occur on the live site, we can normally get a ix out within a few hours, where previously it took days or weeks to get something ixed.
The team at Beazley, a specialist insurance company, also experienced improved alignment. Their business analysts work from the United States with developers and testers in the United Kingdom. They implemented Speciication by Example primarily to ensure that software is inished when an iteration ends. Ian Cooper, a development team leader at Beazley, said:
We’ve always done unit testing but the problem was that there was a gap around these tests telling us if the software works, not if it does what the customer wanted. We didn’t even use to have testers testing in the same cycle. They were feeding back the information from the previous iteration into the current iteration. That’s gone now. We have a much clearer idea of acceptance.
The team working from New Zealand on AdScale.de, a marketplace for online advertising, had similar experiences. Two years after the project started, increasing complexity of the user interface and system integrations made the code base too large to be effectively managed just with unit testing. Developers would think that something was done, move on, and then have to redo the work after the testers’ review. Because of the disconnect between testers and developers, it took a long time to ind problems. Issues from previous iterations were affecting future ones, disrupting the low of development. After implementing Speciication by Example, development and testing were more closely aligned. Clare McLennan, a developer/tester working on the project, declared: