Showing posts with label user stories. Show all posts
Showing posts with label user stories. Show all posts

Specification by Example and Card-Conversation-Confirmation

By Alex Yakyma. 

Recently I happened to encounter a lack of specificity in a purportedly trivial situation. I was at a restaurant in Longmont, CO and wanted to start in my rather typical way, having tea with honey. Given that it was snowing, seems like a quite natural thing. I ordered "black tea with honey", the waitress asked "why black?", to which I answered that, in some countries, unless you say "black tea" or "black coffee", you will receive it with milk. Also, I noted that, this way, one could distinguish it from green tea, which is an entirely different thing. She smiled and, in a minute, I got my... you guessed it... glass of ice tea (actually with a lot of ice in it) and a little vessel with honey on the side.
 I was speechless, and she disappeared before I recovered. I felt like Eric Cartman with his funny-fuse, when he wasn't able to laugh any more :) Anyways, to make a long story short, I knew what I wanted, and we even had a chat about it. I thought we had even defined everything clearly, but turns out we didn't. Sound familiar?

I think XP folks impacted on the software development industry much more significantly than we may have otherwise thought. In fact, user stories aren't a Scrum invention; this was institutionalized in XP. In particular, Ron Jeffries, defined what we know as the "3C":  Card, Conversation and Confirmation - three important aspects of user stories (actually any stories, not just user ones). The "triad" actually means physical card, on which the story is written – a conversation between those who define and those who implement – to clarify detail and, finally, the acceptance criteria by which it is decided whether a job is done. This is a great conceptualization of what is necessary to keep in mind for teams. Nevertheless, the 3C itself is dependent on how effective a conversation is in terms of identifying detail; otherwise... you may get your ice tea with honey.

A useful technique to make the 3C work efficiently is Specification by Example - a collaborative approach to defining requirements based on concrete examples, instead of abstract statements. The "Second C" in this case gets recurrently supplied by examples, which become a natural way for requirements’ disambiguation for the team and stakeholders. What's important is that the "examples" are goal-driven and thus, the Conversation continues to be meaningful. So, had I said that, to warm up in such cold weather, I would need a cup of good Earl Grey tea with honey, then there likely would never have been such confusion in the first place. By the way, there indeed happens to be waiters and waitresses that have a good facilitation skill for thing like Specification by Example. But these are as rare as good facilitators among people in the software domain. Nevertheless, here's a set of simple recommendations that I give during ATDD coaching:
  • Refine requirements collaboratively as a team, involve external stakeholders as much as possible; keep in mind that your co-dependent agile team is just another "stakeholder", so invite some representatives.
  • Include the Specification Workshop (where Specification by Example actually comes into play) into every backlog grooming and sprint planning session.
  • Actively use BVIRs (whiteboards, flipcharts, etc.).
  • Use tables to represent the variations in data, flow conditions - virtually everything. Table format is the most powerful collaborative tool for refining requirements. Regardless of whether it happens later, it may or may not be represented in a table format in your ATDD tool.
  • Do not allow any abstractions in the examples. Avoid those "X"s and "Y"s etc. at all cost. You will be surprised how much your team will learn about the seemingly familiar user story once they replace all Xs and Ys with real values.
  • Stay timeboxed story-wise and move to the next story every 10-15 minutes. If not done with the story, no worries - you can return to it. Just don't let it go too deep and consume too much time.
  • Capture all agreed upon examples - these are your acceptance tests. Capture all open questions (to stakeholders or otherwise) and resolve them first.
  • Have Specification Workshops at every iteration - team self-discipline is key here. Scrum Masters can find this a real challenge for their facilitation, coaching and mentoring skills, which assist their team in adopting and sustaining Specification by Example as an effective cadence based activity.

 It is amazing how much a team can achieve when they know what they are building. User stories, as "containers" of value, in conjunction with concrete examples, represent an extremely powerful tool that makes a team extremely productive in delivering business value incrementally.

Story Splitting Kata

Last Friday we had a beautiful kata on splitting user stories. This skill is extremely important for agile teams as they have to be able to reliably:

a) Split user stories into smaller stories that fit into a sprint. And more so, good if they take few days, not a whole duration of a sprint, to keep the sprint outcome more predictable, and...

b) Split these smaller stories in even smaller cuts (which still are user stories), not necessarily explicitly, so that one cut will be the result of a single "Define-Build-Test" cycle.

We had six people + me, this is max to have kata exercise going really efficient. Especially this group was really and quite concentrated on the effort entire 90 minutes period. In the beginning the group comes up with the idea of a product that everyone can understand (in our case that was online currency converter supporting multiple different sources of exchange rates). Then we write first big epic and split it to as many user stories as we can. Eventually quantity translates into quality as we use different methods to split stories and acquire deeper and deeper understanding of the functionality and bounded context.

Alex Ginda was assisting me along the process, agile master and the photographer :) I appreciate his effort and grateful to Luxoft training center for providing us with the facilities.



Specification by Example: Simple Questions to Understand a User Story

By Alex Yakyma

Specification by Example is an extremely powerful technique of requirements gathering and much more. But it is sometimes difficult for teams to start reliably using it during their specification workshops, at sprint planning, product backlog refinement etc. In this post we propose 7 simple and yet very useful questions that help you build your conversations around.

Once you got your next user story, ask the group (which should apparently include Product Owner as a minimum; as maximum - user expert, subject matter experts, other stakeholders) the following:

Give me an example of...

...what is the simplest successful flow? (1)

...what objective can I achieve as a user? (2)

...what conditions change the flow? (3)

...what is the alternative flow? (4)

...what is the unsuccessful flow? (5)

...what does the input look like? (6)

...what output looks like? (7)


Let's see how it works on example of the following user story:

As a user I can search for contacts of my contacts
that work for the company of my interest
so I could establish useful connections.

...in context of a professional social network.

Before we start let's just stress again on the importance of the keyword "example" here. Each of the 7 questions should be answered in the form of examples. Otherwise we will not be able to effectively understand what is supposed to be implemented as well as immediately spot inconsistencies. So...

* * *

1) Facilitator: "Give me an example of the simplest successful flow"

Product Owner: "I, Alex Yakyma, enter Yahoo! Inc and click 'search' and get Richard Melnik, connected to Sergei Ivanov, who is my connection."

Tester: "We need to update our 'Golden Test Data Collection' to ensure we have these transitive test cases..."

Developer 1: "What kind of validation should we use for 'Company name'?"

Developer 2: "Same as we have for companies when you add them to your profile..."

2) Facilitator: "ok, now give me an example of what do I achieve with this function?"

Expert User: "If I'm a sales person, I can find leads. If I'm a head hunter, I can approach good job candidates. If I'm..."

Developer: "So if I'm a sales person, and if I even got these results, how do I then efficiently use them? Sounds like we need some basic CRM functionality to make it useful at least with respect to lead management. For instance, saving those search results, allowing to add data fields to contacts??"

Product Owner: "...good point. Very good point. Let me put some notes and elaborate this part as a candidate for the next sprint, maybe. We'll talk about it this PBR, I believe. But apparently the objective is to turn them into reliable contacts."

3) Facilitator: "what could change the flow?"

Tester: "I guess I know. Wrong or ambiguous input of the company name. Am I right?"

Developer: "What if I enter company name 'Data'? Would that also count for 'Data Inc' and 'Data Software Inc' and 'M-Data.com'?"

Expert User: "I think, yes! I may not remember full name of the firm or just use part of it because I'm lazy, and I still have to get the results".

Product Owner: "But obviously, if I search for 'Data', then exact match should be first on the list"

Tester: "Good point, we haven't talked about the result set at all so far"

Facilitator: "We can talk about it right now, or in few minutes when we discuss more flows, it's up to you guys..."

Product Owner: "I think now's better, as we see the end picture, we may find out more flows."

(and so on...)

* * *

It is very good to use whiteboard or flip-charts easily accessible and put those examples down, model them as flows, screen layouts etc. And it's good to have this "list of useful questions" attached to this board somewhere or just written down with market on the board itself... in the top right corner, as an example :)

Splitting User Stories. Part 2: Decomposing Rich UI Stories.

By Alex Yakyma
Link
In this post we will continue outlining the ways of splitting user stories. Previous post was about splitting stories that include complex or data-intensive algorithms (Splitting User Stories. Part 1: Incremental Development of Complex Algorithms). Post #1 also includes interesting links and provides brief overview of all posts in the series. Currently we will touch another common class of stories – those including much of the UI work.
In this post as well as in the previous one we will stick to the simple model and terminology for splitting: a Story splits into First cut – something simpler and faster-to-implement and then Cut 2 – finishing the rest of the functionality.
In case of rich UI stories Cut 2 may often be translated into non-functional requirements (NFRs). And in this case it has to be sooner or later applied to all the functionality of the system. Let’s consider few examples:
Cut 1: Implementing the functionality of a certain web page. Cut 2: Extracting all CSS and Javascript code into separate files
• …Cut 2: Using same page/screen template
• …Cut 2: Using jQuery for AJAX calls
These examples naturally transform into NFRs: a) All CSS/Javascript code should be in separated from HTML markup; b) All system screens should descend from master screen template; c) All asynchronous calls should be done via jQuery API.



Now we’re approaching the 12 ways of splitting UI stories.

1. Synchronous calls – Asynchronous calls.
Story: As a user I can register in order to make purchase.
Cut 1: …registration is on the separate screen, process totally synchronous.
Cut2: …I can register asynchronously using inline form.


2. Basic controls – Advanced controls.
Simple text boxes instead of advanced calendar control. Screens instead of pop-ups, etc.


3. Basic validation – Complex validation.
Validation sometimes can be really complex and it may be useful to make first step with minimum validation functionality and then add it in the next cuts. Example…
Story: As a user I can register in the system.
Cut 1: …required fields not empty Cut 2: …email fully validated; username to satisfy the pattern and to be unique; zip code validated against DB; Street address validated against pattern; DOB within the range. Field length requirements checked on client side.

4. Functional UI – UI/UX standards, styles.
Because usually functionality may open a wide bandwidth for communication and feedback, it makes sense to develop functional UI as a First cut and apply styles and standards later as Cut 2.

5. Main UI functionality – All UI functionality
E.g.: the “advanced” parts would be: “auto-complete”, “Image zoom”, “drag & drop”, “pagination” (instead of longer list) etc.


Story: As a user I can see a list of my monthly credit card transactions.
Cut 1: …in the table.
Cut 2: …in the table with pagination.

6. Fixed view – Adaptable view An ability to provide a user with his specific UI. User-specific UI may appear when we have different classes of users and so all UI or only some of the screens could be:
- Branded for different clients (companies)
- Adjusted to different personas
- Configurable by users themselves
- …
Story: As a user I can make flight and hotel reservations. The tool is used by two personas: end consumer and travel agency. This is reflected in somewhat different behaviors where travel agent may have additional capabilities on the screen to make group reservations. In Cut one we may either:
- Allow both personas use simplest user interface that still covers the needs of both, or
- Build two screens the simplest way possible
And then in Cut 2 we develop the foundation that allows for easy, metadata-based, customization of the screens.


7. Empty inputs – Good defaults
This method assumes not as trivial work in Cut 2 as it seems at a first glance. Example…
Story: As a user I can book flight tickets.
Cut 1: …all controls empty.
Cut 2: …My current location selected as possible place of departure, my most frequent destination – as the one; as I select a departure date the default for return date would be next Saturday after departure.

This example shows that good and useful default values may have non-trivial logic behind it and it may make a lot of sense in separating it out.

8. Single screen – Wizard.
Story: As a user I can enter all necessary information to make my online booking.
In Cut 1 we simply create a single screen with all necessary controls in it. Cut 2 will be a wizard that would collect the data in much more user-friendly manner.

9. Less controls – All controls
Story: As a user I can register in the system.
Cut 1: …providing only basic information.
Cut 2: ...providing richer demographic information.
This can be sometimes extremely useful as simple registration (or other generic function) may enable rest of system functionality work, while next cut will conclude the implementation of more complex registration requirements.


10. Interfacing user – Interfacing other systems.
UI may carry the burden of interfacing other systems, not just the user. Here are few examples:
- Search engine optimization – Web UI should be specially formatted (both visible and invisible parts); content adhering special rules; breadcrumbs navigation etc.
- Access to file system, user directories etc, network locations from the UI.
- Built-in screen printing function
- UI logging and statistics (for further analytical processing)
- Special layout requirements for screens (various reports etc) to be further exported and submitted for automated data indexing

In these cases Cut 1 would be implementing user interface the user and Cut two is extending it to further capabilities of interfacing with the rest of the systems.

11. Main platform – All platforms
Story: As a sales representative I can check product availability in real time.
Cut 1: …with my laptop. Cut 2: …via the interface for mobile devices.


12. Simplest technology – UI framework
Sometimes it can be very beneficial to start really fast development of a, say, classic JSP web page (Cut 1) that implements a story and then only (Cut 2) jump to some advanced UI framework like JSF, Struts or Maverick. This can be done not only in the beginning of the development of a product but also much later on, when UI framework is already in place, but a new piece of important functionality would be much faster to implement using “dirty” simpler methods. Usually these first cuts enable the rest of the backlog to be implemented and then at some point Cut 2 puts the story under the concrete of the framework.

Splitting User Stories. Part 1: Incremental Development of Complex Algorithms.

By Alex Yakyma

Splitting user stories into smaller stories is a very important skill for absolutely every agile team. There are good general approaches to doing it in the following post by Bill Wake, and an overview of reasons why to split stories by Bob Hartman. Splitting stories is outlined as a part of a bigger discipline of creating quality user stories in chapter 6 of Agile Software Requirements book by Dean Leffingwell. But expressing it in one sentence we may say that agile team cannot be successful without this skill – high risks and high variability of the outcome of an iteration will always be there if stories are too big; on the other hand if they are so big that they don't even fit into an iteration and we can't do anything about it - then this is not incremental development of user value at all and we are back to the doom of spawning large amounts of uncontrollable work-in-progress that inevitably leads to mediocre results.

Current post is the first one in series of posts on splitting user stories. This is an attempt to provide deeper analysis on how to ensure fine granularity in delivery of user value. Below is the full list of areas that we will cover in this blog divided into “classes” of stories:

Splitting User Stories. Part 1: Incremental Development of Complex Algorithms.

Splitting User Stories. Part 2: Evolving Rich UI.

Splitting User Stories. Part 3: Incremental Architecture.

Splitting User Stories. Part 4: Simple Steps in Implementing Complex Scenarios.

Splitting User Stories. Part 5: Evolving APIs, Protocols, Interfaces.

Before we dive deep into our first class of user stories, it is worthy emphasizing the importance of this skill especially for large scale development:

Splitting user stories is a necessary skill of every agile team. But it becomes extremely critical on the large enterprise scale where only small increments of user value, made by each individual agile team, give a chance for continuous synchronization of the whole program.

This post describes 14 ways to split stories that include certain algorithmic complexity or require processing of large amounts of data.

We grouped our methods into two sub-groups: 1) splitting stories based on Processing type, and 2) Data structure. Every method includes a little note, whether splitting stories this way affects story functionality (usage scenarios) or system qualities (usually system performance) or both. Examples should help to better understand how each method works in practice. Every method is briefly referenced in the following format: First Cut – Second Cut.



Before we start considering these methods of splitting stories, it is important to stress that this is not an attempt to build an exhausting catalog but rather to provide a reader with few insights that could be a helpful starting point for teams in their real project environments.

Group 1: By processing type.

1. In-memory processing – Disk-based processing (Affects: functionality and system qualities).
This approach can be effectively applied when we need to process relatively large amount of data and this assumes saving some intermediate or final data to disk for further reference or processing. Instead of taking such a big story all at once, our first step would be only in-memory processing that would only perform the basic function. Example:

Story: As an accountant I can upload all quarter invoices so I can see totals for a quarter and use it for reporting purposes.

First cut: As an accountant I can upload all quarter invoices so I can see totals.

Second cut: As an accountant I can upload all quarter invoices so I can use it for reporting purposes in the future.

Obviously Cut 1 assumes that we simply calculate all necessary totals in-memory and show them to the user. In the meantime, Cut 2 assumes saving different kinds of data (both during and after the processing) to disc.

2. Disk-based processing – Cached processing (Affects: system qualities).
This type of splitting stories is somewhat reverse to #1 above but it is used in different circumstances. Typical use – look-up operation. First cut is to allow the system to query the data source every time the information is needed for further processing. Cut two will be the implementation of a caching mechanism that would keep the most frequently requested data items in RAM.

Usually following this method does not change any user scenarios, but system qualities, usually system performance.

3. One-by-one processing – Batch processing (Affects: system qualities).
This method is good when processing a large number of entities which in turn will be saved to disk or sent over some network protocol (or the processing of each item requires disk or network “read” operation at some point). In such a case we first provide a simple implementation that “saves each item to disc individually” as Cut one and Cut two will be implementing the batch processing model.
Cut 2 usually improves the performance and allows for performance tuning based on varying the batch size.

4. Standard algorithm – Custom algorithm (Affects: functionality and system qualities).
Let’s start with the example:
Story: As an online consumer I can see products ordered by relevance which reflects my personal preferences.

First step will be Cut 1: As an online consumer I can see products ordered by relevance based on different priorities of product attributes. This story assumes that we apply well-known lexicographical order to the product list. For example if the user orders the list by price most of the time and sometimes by editor rating, then for the initial page load the system will apply a two-dimensional lexicographical ordering where “price” will be primary and “editor rating” a secondary parameter.

And Cut 2: As an online consumer I can see products ordered by organic relevance which reflects my preferences. In this case we may want to research a more sophisticated way of ordering results based on more complex models than the lexicographical order.

Note that sometimes the difference between standard and custom algorithms does not impact the functionality but only the speed of processing or other system qualities.

5. Synchronous – Asynchronous (Affects: functionality and system qualities).
Example where functionality is affected:

Story: As an admin I can run data backup process.

First cut: As an admin I launch data backup process and wait until it completes to see the status. (Synchronous processing)

Second cut: As an admin I can launch data backup process asynchronously so I can switch to other tasks and get system notification when backup job is over.

The case when functionality remains unchanged appears when the “actor” is not a live user but a system or part of the system and then the asynchronous operations with input/output streams simply provide a faster and more scalable way of implementing same user scenarios.

6. Real-time processing – Pre-processed data (Affect: system qualities)
Few generic examples:

Example 1. The First cut in implementing a set of financial reports could be simply implementing them separately based on complex and time-consuming SQL queries (each report would build its data set in real time each time we run it). The Second cut would be building a shared OLAP Cube (preprocessed data structure and data set) and then running each report on top of it with incomparably higher speed of to data.

Example 2. The simplest way (Cut 1) to implement any kind of search would be to run thru whole set of elements (in real time) and compare them against the search criteria. Second cut would be building a search index (pre-processed data set).

7. Pre-processed data – Real-time processing (Affects: system qualities).
Sometimes to get some results we need to pre-process data and then only we have a chance to calculate something on top of that data. In the future though we re-architect the algorithms so that end-to-end real-time processing becomes possible.

8. Omitted steps – All steps (Affects: functionality and system qualities).
Example:
Story: As a third party application I can perform my query on least loaded server.

First cut: As a third party app I can perform my query. Here the part of the algorithm responsible for evaluating server loads and selecting the least loaded one is a stub – simple randomized selection is used instead.

Second cut: As a third party app I can be directed to the least loaded server.

9. Approximation – Exact processing (Affects: functionality and system qualities).
Some algorithms may use certain approximations and still deliver valuable results.

Example:

Story: As an admin I can see the exact number of DB calls during a day.

First cut: As an admin I can see the approximate number of DB calls based on number of users during a day. In this case we simply multiply the number of users for the day by the average number of DB queries per user.

Second cut: …the exact number… . In this case we will have to log all queries and calculate their exact amount.

Group 2: By data structure.

10. Flat data structure – Complex data structure. (Affects: functionality and system qualities)
Example: Instead of applying the lexicographical order in item 4 above for the attributes of products we simply assume that they are all of equal importance (flat structure) and take their sum as the overall relevance for Cut 1. In Cut 2 we will implement the sophisticated algorithm we need.

11. Less dimensions – More dimensions (Affects: functionality and system qualities).
Example: As an admin I can see a report of online consumers and their favorite items.

First cut: ...favorite items identified based on one main parameter.

Second cut: ...favorite items identified based on whole set of factors.

12. Single data type – Various data types (Affects: functionality and system qualities).
Example:

Story: As an admin I can upload an XLS report file into system DB.

First cut: As an admin I can upload XLS report and process all entries as plain text data.

Second cut: …text, numerical, currency, boolean data types.

ETL (extract, transform and load) is a big area where this method of splitting stories is highly applicable.

13. Independent data – Linked data (Affects: functionality).
Linked objects appear everywhere: HTML documents pointing to each other, expense reports from the same employee, TCP packages as parts of the same SOAP call, products that are often bought together etc etc.

Story: As a user I can see most relevant documents in the top.

First cut will be implementing relevancy algorithm based on individual properties of a document while Cut 2 will “boost” the relevance of the documents referenced by other documents.

14. Trimmed data set – All data (Affects: functionality and system qualities).
Sometimes relatively simple algorithms may work well on limited number of elements. This can be good start with still sufficient quality/depth of results. The next natural step then is to improve the algorithm and extend it to the whole set of entities.

Example:

Story: As an accountant I can see the trend curve of monthly expenses.

In First cut of this story we will build the trend based on a couple of randomly selected data sets while in the Second cut we will let the system analyze considerable amount of data.