Enrol to start learning
Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.
14.2.7. T - Testable
Learn content
Interactive Audio Lesson
Unlock the classroom podcast
The transcript is free to read. A free account plays the conversation back.
To start off, can anyone tell me what a user story is?
Isn't it just a way to say what features we need?
Great point! A user story is a short description of a feature from the end-user's perspective. Why is it useful to frame it that way?
It helps us understand the user's needs better!
Exactly! The typical format is 'As a [type of user], I want [goal], So that [reason/benefit].' Let's create a user story together for a new feature.
How about 'As a reader, I want to bookmark articles so that I can read them later'?
Fantastic! That’s a well-structured user story. Remember, it clarifies the user's needs and intention.
Unlock the classroom podcast
The transcript is free to read. A free account plays the conversation back.
Now, let's talk about the INVEST model. Does anyone know what those letters stand for?
Hmm, Independent, Negotiable... um, I can’t remember the rest!
No problem! It’s easy to remember if you think of it as needing to be small enough to complete within a sprint, and testable. Can anyone guess what 'testable' means in this context?
I think it means we need to have clear criteria to check if it’s done?
That’s it! Acceptance criteria define conditions for acceptance and testing and are crucial for aligning the development team's understanding.
Unlock the classroom podcast
The transcript is free to read. A free account plays the conversation back.
Let’s focus now on acceptance criteria. Can anyone provide examples of what might qualify for acceptance criteria in a user story?
I think we could say 'a reset password link is sent to the user's email'?
Exactly! And it should also have other conditions like 'the link expires after 24 hours.' Why do we need multiple criteria?
It ensures all requirements are covered for testing!
Right! It creates a shared understanding between stakeholders and the development team, facilitating better communication.
Unlock the classroom podcast
The transcript is free to read. A free account plays the conversation back.
Let’s shift gears to Gherkin language. Does anyone know how to express an acceptance test using Gherkin syntax?
Isn't it 'Given, When, Then' format?
That’s correct! Can someone provide an example using this structure for our previous user story?
Okay, how about: 'Given the user is on the login page, When the user clicks on forgot password, Then a reset link should be sent to their email.'
Perfect! You've just demonstrated how Gherkin creates clarity and testability in user stories.
Overview
Short Summary
This section underscores the importance of writing clear and testable user stories in Agile projects, emphasizing the use of acceptance criteria to define completion conditions.
Medium Summary
In Agile projects, writing effective user stories is vital for Business Analysts. This section details how user stories should be constructed to be clear and testable. It covers the use of the INVEST criteria and acceptance criteria to ensure development aligns with business needs.
Detailed Summary
T - Testable
In the Agile framework, user stories are a crucial mechanism for defining functional requirements. They should not only express need but must also be clear and testable to ensure that the development team accurately delivers what the business requires.
User Stories
A user story is typically structured in the format:
As a [type of user],
I want [goal],
So that [reason/benefit].
For instance: As a job seeker, I want to upload my resume so that I can apply for jobs quickly. This structure helps clarify the user’s perspective and need.
INVEST Criteria
The INVEST checklist ensures that each user story possesses desirable qualities:
- Independent: Can be developed without dependencies.
- Negotiable: Serves as a point for discussion rather than a fixed contract.
- Valuable: Provides user or customer value.
- Estimable: Clear enough to estimate effort.
- Small: Able to be completed within a single sprint.
- Testable: Contains acceptance criteria for validation.
Acceptance Criteria
Acceptance criteria define a user story's boundaries and requirements for being accepted as complete. Examples include conditions like sending a reset password link to a registered email that expires after 24 hours. This assures that all stakeholders have a shared understanding, ensuring clarity and facilitating testing.
Gherkin Language
Utilizing Gherkin syntax in Behavior-Driven Development (BDD) allows teams to express acceptance criteria in a structured way, using the format:
Given [precondition]
When [action]
Then [expected result].For example, a successful password reset implementation can be detailed using Gherkin to illustrate its logic clearly.
The ultimate goal in crafting user stories is to ensure that they convey a detailed yet succinct narrative. A well-written user story aids in motivation and clarity for the development team, guiding them in producing the right outcomes.
"A great user story tells a mini-story with a purpose — and leaves no room for confusion."
Audio Book
Unlock the audio lesson
The script is above and free to read. A free account plays it back, in the voice you pick.
Create a free accountThe story must have clear acceptance criteria to validate completion.
Detailed Explanation
A testable user story is one that comes with defined acceptance criteria. These criteria serve as a guide to understand what 'done' looks like for the story. This means that, upon completion of the development work on the story, testers should be able to run specific checks to confirm that the story functions as intended without ambiguity.
Examples & Analogies
Imagine you're baking a cake. If your recipe (user story) simply says 'Make a cake', you might not know if it should be chocolate, vanilla, or red velvet. However, if it says, 'Make a chocolate cake that is moist and has a creamy frosting', those specifications are clear. You know exactly how to bake it and how to determine if it's successful (by tasting it).
Unlock the audio lesson
The script is above and free to read. A free account plays it back, in the voice you pick.
Create a free accountAcceptance criteria define boundaries and conditions that the user story must meet to be accepted as done. They ensure clarity, testability, and shared understanding between stakeholders and the development team.
Detailed Explanation
Acceptance criteria list the specific requirements that must be satisfied for the user story to be considered complete. These criteria help ensure all stakeholders have the same understanding of what the feature should accomplish. They can include functionality, performance, and quality requirements.
Examples & Analogies
Think of acceptance criteria as a checklist for a school project. If the criteria say, 'Include a title, 5 paragraphs, and a bibliography', you'll know exactly what you need to do to finish the project successfully. Without that checklist, it’s easier to miss important components.
Unlock the audio lesson
The script is above and free to read. A free account plays it back, in the voice you pick.
Create a free account✅ A reset password link is sent to the registered email. ✅ The link expires after 24 hours. ✅ The user is prompted to enter a new password upon clicking the link.
Detailed Explanation
These acceptance criteria provide clear, quantifiable conditions that must be met. For instance, stating that 'a reset password link is sent to the registered email' ensures that once the user requests a password reset, they will receive a link in their email. The criteria also define that the link will expire after a specified time frame, which adds a layer of security.
Examples & Analogies
Imagine ordering a pizza with specific criteria: 'The pizza should be large, have extra cheese, and be delivered within 30 minutes.' Each criterion helps ensure you receive exactly what you expect. If the pizza doesn't meet these conditions, it’s clear that there’s a problem.
Unlock the audio lesson
The script is above and free to read. A free account plays it back, in the voice you pick.
Create a free accountGherkin is a structured language used in Behavior-Driven Development (BDD) to write acceptance tests in a readable Given–When–Then format.
Detailed Explanation
Gherkin language helps formulate user stories and their acceptance criteria in a clear, standardized way. The format consists of: 'Given' (context), 'When' (action), and 'Then' (expected outcome). This structure helps anyone involved in the project understand the flow of the feature's functionality.
Examples & Analogies
If you were to describe a day at school to someone unfamiliar with it, you might say: 'Given it’s a school day, when I arrive at 8 AM, then I have math class first.' This format simplifies the explanation and helps convey expectations clearly.
Unlock the audio lesson
The script is above and free to read. A free account plays it back, in the voice you pick.
Create a free accountFeature: Password Reset Scenario: Successful password reset request Given the user is on the login page And the user clicks on "Forgot Password" When the user submits their registered email address Then a reset link should be sent to that email And the link should expire in 24 hours
Detailed Explanation
This Gherkin example illustrates a case where a user requests to reset their password. Each part follows the Given, When, Then structure, clearly defining the preconditions (the user is on the login page), the action (clicking 'Forgot Password'), and the expected outcome (receiving a link by email). This format makes it easy to automate the testing of this feature.
Examples & Analogies
Consider an itinerary for a road trip. You might say: 'Given I have a full tank of gas, when I start the trip, then I should be in city X by 3 PM.' Each piece of the statement helps you understand the conditions leading to the expected result.
--
Key concepts
Core takeaways and short definitions to help you quickly recall the key ideas from this section.
- User Story:
A concise description of a user's need or goal.
- INVEST Criteria:
Guidelines ensuring user story quality, which include Independence, Negotiability, Value, Estimability, Size, and Testability.
- Acceptance Criteria:
Specific conditions that a user story must fulfill to be considered complete.
- Gherkin Language:
A structured format for writing acceptance tests that improves clarity and collaboration.
Examples
Step-by-step examples to apply the section's ideas and test your understanding.
Example of a user story: 'As a shopper, I want to filter products by category so that I can easily find what I'm looking for.'
Gherkin formatted example for password reset: 'Given the user is logged in, When they request a password reset, Then they receive a reset link via email.'
Memory aids
User stories tell a tale, / From demands they will prevail. / With INVEST they won't fail, / Clear criteria form the trail.
Imagine a shopkeeper who always listens to her customers. She crafts clear stories of what they need, ensuring her goods truly fit their desires. Every time she updates her inventory, she thinks in terms of who wants what and why, perfecting her craft.
Remember the INVEST model: I for Independent, N for Negotiable, V for Valuable, E for Estimable, S for Small, T for Testable. Use the acronym I-N-V-E-S-T to recall easily!
Flash Cards
Glossary
User Story
A brief, informal description of a feature from the user’s perspective.
INVEST Criteria
A checklist for crafting effective user stories: Independent, Negotiable, Valuable, Estimable, Small, Testable.
Acceptance Criteria
Conditions that define the boundaries and requirements for user story acceptance.
Gherkin Language
A structured language used in Behavior-Driven Development for writing test cases in a readable format.