- •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
72 |
Speciication |
by |
Example |
|
|
|
|
A |
great |
way |
to |
obtain the right scope for |
a goal is to irmly place |
|
responsibility for |
a |
solution on the development |
team. |
If you are fortunate enough to have high-level control of project scope, make sure to involve developers and testers in the discussions about it and focus the suggested solutions on fulilling clearly deined business goals. This eliminates a lot of unnecessary work later on and sets the stage for better collaboration on speciications.
Parts of a user story
A user story describes |
how a |
user |
will |
get |
a speciic |
value out of a system. Use |
||
stories |
are commonly |
used |
by teams |
to |
plan and |
prioritize the scope of short |
||
term |
work. They’re often deined |
in |
three |
parts: |
|
|||
• |
As |
astakeholder |
|
|
|
|
|
|
• |
In |
order achieveto |
something valuable |
|
|
|
||
• |
I want some system function |
|
|
|
|
For example, “As a |
marketing |
manager, so that I can |
market products directly to |
|||||||||
customers, I want the |
system to request and record personal |
information |
when |
|||||||||
customers register for a loyalty program.” |
|
|
|
|
|
|
|
|||||
Diferent |
authors |
suggest diferent ordering |
and |
phrasing |
of |
these |
three |
parts, |
||||
but |
all |
agree |
that |
those three need to be captured. |
For |
the |
purposes of th |
|||||
book, |
variations |
in |
ordering |
or naming in |
parts |
of |
a |
user |
story |
are |
irrelevant. |
Collaborating on scope without high-level control
For most teams I work with, especially those in big companies, scope is something passed to them from a higher instance. Many teams think that it’s impossible to argue about business goals when they maintain only a piece of a large system. Even in those situations, understanding what the business users are trying to achieve can help you focus the project on things that really matter.
Here are some tips for effectively collaborating on project scope when you don’t have a high-level control of the project.
Chapter 5 Deriving scope from goals |
73 |
Ask how something would be useful
Stuart Ervine worked on a back-ofice application for a large bank that allowed business users to manage their counterparty relationships in a tree-like hierarchy—a perfect example of a small piece of a large system. Even then, they were able to push back on tasks and get to the real requirements.
Ervine’s team was tasked with improving the performance of the hierarchy, which sounds like a genuine business requirement with a clear beneit. But the team could not replicate any performance issues on their part, so any serious improvements would require infrastructural changes.
They asked the users to tell them how improved performance would be useful. It turned out that the business users had been manually performing a complex calculation by going through the hierarchy and adding account balances. They had to open and close tree branches in the user interface for a large number of counterparties and add account balances—a slow and error-prone calculation process.
Instead of improving the performance of the hierarchy, the team automated that calculation for the business users. This made the calculation almost instantaneous and signiicantly reduced the possibility of errors. This solution delivered better results and was cheaper than the one originally requested.
Instead |
of |
a technical feature speciication, |
we |
should |
ask |
for |
a high-level |
example |
of |
how a feature would be useful. |
This |
will |
point |
us |
towards the re |
problem. |
|
|
|
|
|
|
|
In Bridging the Communication Gap, I advise asking why and repeating the question until the answer starts mentioning money. I now think that asking for an example of how a feature will be useful is a much better way to get to the same result. Asking why something is needed can sound like a challenge and might put the other person in a defensive position, especially in larger organizations. Asking how something would be useful starts a discussion without challenging anyone’s authority.
Ask for an alternative solution
In addition to asking for an example of how something would be useful, Christian Hassa advises discussing an alternative solution to get to the real business goals. Hassa explains:
74 Speciication by Example
Sometimes people still struggle with explaining what the value of a given feature would be (even when asking them for an example). As a further step, I ask them to give an example and say what they would need to do differently (work around) if the system would not provide this feature. Usually this helps them then to express the value of a given feature.
A good |
strategy |
for |
discovering additional options from a business perspective |
is to |
ask for |
an |
alternative solution. |
Asking for alternative solutions can make whoever is asking for a feature think twice about whether the proposed solution is the best one. It should also start a discussion about alternatives with the delivery team.
Don’t look only at the lowest level
Many teams, inluenced by the need to slim down delivery items so that they can it into an iteration, now break down backlog items to a low level. Although this helps streamline process low, it might cause the team to lose sight of the big picture.
As a |
process, |
Speciication by Example |
works both |
for |
and |
lower-level |
stories. Once we have |
a high-level |
example of |
how something would be useful, we can capture that as a high-level speciication. Such high-level examples allow us to objectively measure whether we’ve delivered a feature.
Ismo Aro worked on a project at Nokia Siemens Networks where his team experienced setbacks because they didn’t have higher-level speciications. He says:
User stories have to it into the sprint. When there is a bunch of those that are done, they’re tested in isolation. The larger user story isn’t actually tested. When the user stories are small grained you can’t really tell from the backlog whether things are really done.
Splitting larger user stories into smaller ones that can be delivered individually is good practice. Looking at higher-level stories is still required in order to know when we’re done. Instead of a lat, linear backlog, we need a hierarchical backlog to look at both levels.
Lower-level speciications and tests will tell us that we’ve delivered the correct logic in parts; a higher-level acceptance test will tell us that all those parts work together as expected.