Software testing is an important process for software engineers. It can be used to find defects in the code, evaluate the performance of a system, and determine if the product meets customer expectations. Software testers are responsible for writing test scenarios that will identify bugs or faults in a piece of software that may not have been noticed by other team members or stakeholders.
When writing test scenarios, it’s important to consider different perspectives. Every software tester has a different perspective, and it is important for us to understand the approach of others. We have to consider – what would happen when certain features are missing? What problems could this cause? How might these issues affect users?
This blog post deals with how to write good test scenarios which makes your project successful.
What is a Test Scenario?
How Would You Describe A Test Scenarios?
Software testing is an essential part of software development. Test Scenario plays a very important role in the improvement of test cases.
Test scenarios are detailed descriptions or records on how a user will interact with an application during software testing. It is also known as Test Possibility or Test Condition.
Test scenarios are used to provide information on what the tester has done. Test scenarios help testers to create better test cases, so that their automated tests can be run by automation tools and they identify all possible results not only expected but also unexpected ones so bugs can be reported immediately.
When you write software, it is important to test your product before releasing it. A test scenario is the sequence of steps that a user might take in order to use your software during testing.
Test scenarios should consider all possible ways of completing a task and cover both positive test cases as well as negative test cases because end users may not necessarily take the steps you expect them too.
By using test scenarios, we assess the applications performance from the perspective of end user. While creating test scenarios, as a tester you have to keep yourself in end user’s shoes so that you get the clarity on what real-world scenarios the software will have to deal with when it is released.
Point to be noted:
We wont use test scenarios in the test execution phase to test the product becuase it doesn’t consists of test steps. We create test cases for every test scenario and use them in the phase of test execution.
What is Scenario Testing?
Scenario testing in software testing is used to test the software application using scenarios derived from the use cases instead of test cases.
With scenario testing we can test end to end scenarios of a complex application logic with easy to evaluate test scenarios.
Test Scenario Template Example
A Test Scenario document can include the following fields:
User Story ID/Requirement ID: In this field we will add the User Story ID or Requirement ID which is related to the scenario we are going to write.
Test Scenario ID: In this field we will add the Test Scenario ID.
Test Scenario Description: In this field we will add the description of the test scenario.
No. of Test Cases: In this field we will add the number of test cases linked to the particular test scenario.
Priority: In this field we will add the priroity of the test scenario.
Download Test Scenario Template
Download the test scenario template in the XLS file format below.
Test Scenario Example
#1. Test Scenarios for GMail
Here we are not listing the complete GMail Test Scenarios. We hope the following list gives you general idea of Test Scenarios. We have covered detailed list of Gmail Test Scenarios in other post.
- Verify that all the read and unread emails are displayed in the inbox
- Verify that the recently received email or unread emails are highlighted in bold in the Inbox section.
- Verify that the recently received email has correct sender‘s name or email id, subject of the email, its preview and date or time.
- Verifty that the recently received email’s sender’s name or email id, subject of the email, and date or time should be in bold and preivew text shouldn’t be in bold.
For applications like Gmail, the number of test scenarios will be huge. Most of the times, teams write Acceptance Criteria for the large applications and get approval from stakeholders.
While writing acceptance criteria, we follow the Given, When, and Then format.
Given a precondition.
When to do an action.
Then the result expected.
#2. Test Scenarios for ATM Machine
1. Verify the ‘ATM Card Insertion Slot’ is as per the specification
2. Verify the ATM machine accepts card and PIN details
3. Verify the error message by inserting a card incorrectly
4. Verify the error message by inserting an invalid card (Expired Card)
5. Verify the error message by entering an incorrect PIN
6. Verify that the user is asked to enter the PIN after inserting a valid ATM Card
Check this detailed guide where we have covered more test scenarios of ATM.
Before moving further to learn, don’t miss the following related articles.
- Test Case Template with Detailed Explanation
- Test Cases for Registration Page
- Test Cases for Login Page
- Test Scenario vs Test Case
- Test Strategy vs Test Plan
Who Write Test Scenarios?
It varies from company to company. Business analysts, test leads generate test scenarios in terms of complex applications such as Banking, Financial applications. In small companies, testers take responsibility in writing test scenarios.
Why Create Test Scenarios?
We create test scenerios for the following reasons
- Ensures complete test coverage.
- Improves overall user experience.
- Ensures that the application is working properly for each use case.
- Identifies most important end-to-end transactions.
- Can be identified and prioritized end-to-end transactions and real time application transactions.
When Not To Write Test Scenarios?
Test scenarios play vital role in the success of a quality product but in some cases we don’t even write test scenarios. In the following situations, we don’t write test scenarios.
- The application under test (AUT) is difficult, volatile, and there is a deadline for completion of the project.
- In Agile Methodology projects such as Scrum and Kanban, we may not write test cases.
- To perform testing for new bug fixes and to perform regression testing, we don’t create test scenarios. In these cases we simply use previously written test cases.
How Do You Create Test Scenarios
The following steps can be carried out by a tester when writing Test Scenarios:
- Step 1: Go through the requirement document (Business Requirement Specification (BRS), Software Requirement Specification (SRS), Functional Requirement Specification (FRS)) of the system under test (SUT) thorughly. We can also refer use cases, books, manuals etc., for the same.
- Step 2: For each requirement, find out how the user may use the software in all possible ways.
- Step 3: List out test scenarios for each and every feature of the application under test (AUT).
- Step 4: Create a Traceability Matrix and link all the scenarios to the requirements. It lets you find whether each and every requirement is mapped to a test scenario or not.
- Step 5: Send the test scenarios to the supervisor to review and evaluate them. Even the test scenarios are further verified by all the stakeholders.
Best Practices to Create Test Scenarios
- Should be correct.
- Should be simple to understand.
- Should cover both positive and negative scenarios.
- Should create atleast one test scenario for one requirement or user story.
Advantages of Test Scenarios
- It is a time saving activity.
- Scenario testing may be completed considerably faster than test case testing.
- It allows for complete test coverage since the test cases are derived from user requirements.
- Test scenarios are derived from User Requirement or User Story. So it gives good test coverage.
- Test scenarios are one liner statements. It reduces the complexity and redundancy.
Difference Between Test Scenario & Test Case
|TEST CASE||TEST SCENARIO|
|Test case consists of Test case name, Precondition, Test steps, Expected result and Post condition||Test scenario are one liner but it is associated with multiple test cases|
|Test case guide a user on “how to test”||Test scenario guide a user on “what to test”|
|Purpose of test case is to validate the test scenario by executing a set of steps||Purpose of test scenario is to test end to end functionality of a software application|
|Creating test cases is important when working with testers off-site||Creating test scenarios helps you in a time-sensitive situation (especially working in Agile)|
|Software applications change often. It leads to redesigning the pages and adding new functionalities. It hard to maintain test cases||Test scenarios are easy to maintain due to its high level design|
|More time consumption compared to test scenarios||Less time consumption compared to test cases|
|Required more resources to create and execute test cases||Relatively less resources enough to create and test using test scenarios|
|It helps in exhaustive testing of application||It helps in agile way of testing end to end functionality|
|Test cases are derived from test scenarios||Test scenarios are derived from use cases|
|Test cases are low level actions||Test scenarios are high level actions|
|Test cases are written by Testers||Test scenarios are written by Test Leads, Business Analysts, and Testers.|
|Test case may or may not be associated to multiple Test scenarios.||Test Scenarios have multiple test cases.|
In any software testing life cycle, the development of Test Scenarios and their understanding is a vital stage and improves the quality of the product. We generate test cases from the test scenarios and every test scenario has multiple test cases.
I hope that after reading this article, you have a good understanding of Test Scenarios.