0% found this document useful (0 votes)
2 views

Software Testing Lec 9

The document discusses collaboration-based test techniques in software testing, emphasizing the importance of user stories and acceptance criteria in defect avoidance. It outlines the process of converting user stories into test cases, prioritizing them, and updating them as needed. Additionally, it introduces Acceptance Test-driven Development (ATDD) as a proactive approach to creating test cases before implementing user stories.

Uploaded by

mark.mamdouh67
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Software Testing Lec 9

The document discusses collaboration-based test techniques in software testing, emphasizing the importance of user stories and acceptance criteria in defect avoidance. It outlines the process of converting user stories into test cases, prioritizing them, and updating them as needed. Additionally, it introduces Acceptance Test-driven Development (ATDD) as a proactive approach to creating test cases before implementing user stories.

Uploaded by

mark.mamdouh67
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Ahram Canadian University

F a c u l t y o f C o m p u t e r S c i e n c e a n d I n f o r m a t i o n Te c h n o l o g y
Department of Software Engineering

Software Testing
SWE406

Dr. Mervat Helmy Hussein

Lecture 9
Collaboration-based test techniques
Focus on defect avoidance by collaboration and communication
A. Collaborative User Story Writing
- Collaboration between business representatives, developers, and testers
- a User Story is a small workflow unit, written in:
As a User (role), I seek Activity so that the Goal is structured, followed by the
acceptance criteria for functional and non-functional requirements.
- User stories have “3 C’s:
• Card – are where user stories are written to be put on board,
• Conversation – written user stories in cards are discussed. Explains how the
software will be used (can be documented or verbal)
• Confirmation – the Acceptance Criteria

Testers turn User Stories into Test Cases to ensure the program works as intended.

CTFL v4.0 - Chapter 4: Test Analysis and Design. 2


Collaboration-based test techniques
How to Convert User Stories Into Test Cases?
Ex.: User Story.. ”As a customer, I want to add products to my shopping basket on an e-
commerce website to make a purchase.”
Sol.:
1- Identify the scenarios:
Scenario 1: Adding one item to the shopping cart.
Scenario 2: Adding numerous items to the shopping cart.

2- Define the test cases:


In Test Case 1: Confirm that a single item may be added to the shopping basket.
In Test Case 2: Verify that a user may add numerous products to the shopping basket

Ref.: https://testsigma.com/blog/user-stories-in-testing/ 3
Collaboration-based test techniques
3- Write the test case steps:
Test Case 1:
1.Go to the product’s page.
2.For the chosen item, click the “Add to Cart” button.
3.Check that the item has been put to the shopping basket.
Test Case 2:
1.Go to the product’s page.
2.Select multiple items by selecting the “Add to Cart” buttons next to them.
3.Check that all selected goods have been put in the shopping basket.

4- Add relevant screenshots:


Include images of the product page, the “Add to Cart” button, and the updated shopping
cart after the item(s) have been added.

Ref.: https://testsigma.com/blog/user-stories-in-testing/ 4
Collaboration-based test techniques
5- Prioritize the test cases:
Prioritize the situations depending on their relevance.
Test Case 1 is a priority since it covers the core operation of adding a single item to the
shopping cart.

6- Update the test cases:


Update the test cases as the user narrative matures or changes.
Ex.: if the user narrative is changed to include the ability to remove products from the
shopping cart, the test cases should be updated to incorporate the removal procedures.

Ref.: https://testsigma.com/blog/user-stories-in-testing/ 5
Collaboration-based test techniques
B. Acceptance Criteria
• Acceptance criteria for a user story are the test conditions (called in agile: definition of
done which are a set of a criteria to be met to accept an increment (sprint) to be
released in a project):
- should describe customers' requirements and demands.
- define the scope of the user story
- should be exercised by the test cases,
- written by product owner or manager

Two most common formats to write acceptance criteria are:


• Scenario-oriented (e.g., Given/When/Then format)
Ex.: Given some precondition, When I do some action, Then I expect some result
• Rule-oriented (e.g., bullet point verification list)

Ref.: https://testsigma.com/blog/user-stories-in-testing/ 6
Writing Acceptance Criteria - Scenario-oriented

Ex.: User story: As a bank card user, I want to be able to request cash from my account at an
ATM so that I will be able to receive the money from my account quickly and in different
places.

Scenario 1: Requesting the cash from a creditworthy account


•Given: that the account is creditworthy
•And: the card is valid
•And: the dispenser contains cash
•When: the customer requests the cash
•Then: ensure the account is debited
•And: ensure cash is dispensed
•And: ensure the card is returned

Ref.: https://www.altexsoft.com/blog/acceptance-criteria-purposes-formats-and-best-practices/ 7
Writing Acceptance Criteria - Scenario-oriented

Ex.: User story: As a bank card user, I want to be able to request cash from my account at an
ATM so that I will be able to receive the money from my account quickly and in different
places.

Scenario 2: Requesting the cash from an overdrawn account


•Given: that the account is overdrawn
•And: the card is valid
•When: the customer requests the cash
•Then: ensure the rejection message is displayed
•And: ensure cash isn’t dispensed

Ref.: https://www.altexsoft.com/blog/acceptance-criteria-purposes-formats-and-best-practices/ 8
Writing Acceptance Criteria - Scenario-oriented
Ex.: User story: As a website user, I want to be able to recover the password to my account,
so that I will be able to access my account in case I forgot the password.

Scenario: Forgot password


•Given: The user navigates to the login page
•When: The user selects <forgot password> option
•And: Enters a valid email to receive a link for password recovery
•Then: The system sends the link to the entered email
•Given: The user receives the link via the email
•When: The user navigates through the link received in the email
•Then: The system enables the user to set a new password

Ref.: https://www.altexsoft.com/blog/acceptance-criteria-purposes-formats-and-best-practices/ 9
Writing Acceptance Criteria - Rule-oriented
Ex.: User story: As a traveler, I want to search by city, name, or street, so that I can have
more matching hotel options.
Search interface Acceptance Criteria
•The search field is placed on the top bar
•Search starts once the user clicks “Search”
•The field contains a placeholder with a grey-colored text: “Where are you going?”
•The placeholder disappears once the user starts typing
•Search is performed if a user types in a city, hotel name, street, or all combined
•Search is in English, French, German, and Ukrainian
•The user can’t type more than 200 symbols
•The search doesn’t support special symbols (characters). If the user has typed a
special symbol, show the warning message: “Search input cannot contain special
symbols.”

Ref.: https://www.altexsoft.com/blog/acceptance-criteria-purposes-formats-and-best-practices/ 10
Collaboration-based test techniques
C. Acceptance Test-driven Development (ATDD)
ATDD is a testing approach:
• Test cases are created by e.g., customers, developers, and testers prior to
implementing (system development) the user story
• The user story and its acceptance criteria are analyzed, discussed, and written by
the team members including testers (through a workshop); which also include
identifying incompleteness, ambiguities, or defects in the user story to be fixed
and avoided in the test cases.
• Then, testers create the test cases (based on the acceptance criteria ) and apply
any test techniques, test cases are considered examples on how to develop the
system which will implement the user story (tests before development).
• These examples help the team implement the user story (development) correctly

Ref.: https://www.altexsoft.com/blog/acceptance-criteria-purposes-formats-and-best-practices/ 11
Collaboration-based test techniques
C. Acceptance Test-driven Development (ATDD)
• User stories are then revised efficiently avoiding defects
• Run positive test cases: confirming the correct behavior without exceptions or
error occurrence (as everything goes as expected), -- called happy paths
• Run negative testing: testing the system with incorrect input values and incorrect
actions to ensure the system will handle such errors
• In addition, test non-functional requirements
• Tests should be expressed in terms that stakeholders can understand

Ref.: https://www.altexsoft.com/blog/acceptance-criteria-purposes-formats-and-best-practices/ 12

You might also like