This Tutorial explains What Is Test Scenario along with Importance, Implementation, Examples and Templates Of Test Scenario:
Any software functionality/feature that can be tested is said to be a Test Scenario. The end-user perspective is considered while writing any test scenarios.
This tutorial will help you in answering the questions: why test scenarios are required, when test scenarios are written and how to write the test scenarios.
What You Will Learn:
- What Is A Test Scenario?
- Test Scenario Examples
What Is A Test Scenario?
Consider a hypothetical situation: There is a vast ocean. You have to travel across the ocean from one seashore to another. For example, from Mumbai, India Seashore to Colombo, Srilanka seashore.
The mode of travel you can opt are:
(i) Airways: Take a flight to Colombo
(ii) Waterways: Prefer a ship to travel to Colombo
(iii) Railways: Take a train to Srilanka
Now for the Test Scenarios: Traveling from Mumbai seashore to Colombo seashore is a functionality that is to be tested.
The Test Scenarios includes:
- Traveling by Airways,
- Traveling by Waterways or
- Traveling by Railways.
These test scenarios will have test cases.
Test cases that can be written for the above Test Scenarios include:
Test Scenario: Travelling By Airways
Test cases can include scenarios like:
- The flight is as per the scheduled time.
- The flight is not as per the scheduled time.
- An emergency situation has ensued (heavy rainfall and storm).
In the same way, a separate set of test cases can be written for other remaining scenarios.
Now let’s get to the technological test scenarios.
Anything that can be tested is a Test Scenario. Thus we can state that any software functionality that is under test and can be divided into multiple smaller functionalities and can be termed as ‘Test Scenario’.
Before delivering any product to the client, the quality of the product needs to be appraised and evaluated. Test scenario aids in assessing the functional quality of a software application which is in conformance with its business requirements.
Tester scenario is a process wherein the tester tests software application from an end-user perspective. The performance and quality of the software application are thoroughly assessed before implementation in the production environment.
Importance Of Test Scenario
- One Test Scenario can have multiple ‘Test Cases’. It can be figured as a big panoramic image and test cases are the small parts that are important to complete the panorama.
- It is a single line statement and test cases comprise of step-wise description to complete the purpose of the test scenario statement.
Test Scenario: Make the payment for the cab service availed.
This will have multiple test cases as stated below:
(i) Payment method to be used: PayPal, Paytm, Credit/Debit Card.
(ii) The payment done is successful.
(iii) Payment done is unsuccessful.
(iv) The payment process aborted in between.
(v) Not able to access payment methods.
(vi) The application breaks down in between.
- Test Scenarios thus assists in evaluating the software application as per the real-world situations.
- Test scenarios when determined, help in bifurcating the scope of testing.
- This bifurcation is termed as prioritization which helps in determining the important functionalities of the software application.
- Prioritized testing of the functionalities, assist to a great extent in the successful implementation of the software application.
- As the test scenarios get prioritized, the most important functionalities can be easily identified and tested on priority. This ensures that the majority of the crucial functionalities are working fine and defects related to it are duly captured and rectified.
- Test scenarios determine the business process flow of the software and thus end-to-end testing of the application is possible.
Difference Between Test Scenario And Test Case
|Test Scenario||Test Cases|
|Test scenario is a concept.||Test cases are the solutions to verify that concept .|
|Test Scenario is a high level functionality.||Test cases are detailed procedure to test the high level functionality.|
|Test Scenarios are derived from Requirements/ User Stories.||Test cases are derived from Test Scenarios .|
|Test scenario is ‘What functionality is to be tested’||Test Cases are ‘ How to test the functionality ’.|
|Test Scenarios have multiple test cases.||Test case may or may not be associated to multiple Test scenarios.|
|Single test scenarios are never repeatable.||Single test case may be used for multiple times in different scenarios.|
|Brief documentations required.||Detailed documentation is required.|
|Brainstorming sessions are required to finalize a Test Scenario.||Detailed technical knowledge of the software application is required|
|Time saver as minute details is not required.||Time consuming as every minute detail needs to be taken care of.|
|Maintenance cost is low as resources required are low.||Maintenance cost is high as resources required are high|
Why Is Test Scenarios Indispensable?
Test scenarios are derived from requirements or user stories.
- Take the example of a test scenario for Cab booking.
- The scenarios could be like cab booking options, payment methods, GPS tracking, road map displayed correctly or not, cab and driver details displayed correctly or not, etc all are listed in the test scenario template.
- Now suppose test scenario is to check whether the location services are turned on, if not turned on, display the message ‘Turn on location services’. This scenario is missed and not listed in the test scenarios template.
- ‘Location service’ scenario gives rise to other test scenarios related to it. These can be:
- Location service grayed out.
- The location service turned on but no internet.
- Restrictions on for location services.
- The wrong location is displayed.
- Missing a single scenario may mean missing out on many other crucial scenarios or test cases. This can have a great negative impact while implementing the software application. This results in a heavy loss of recourses (deadlines).
- Test scenarios aid to a great extent in avoiding exhaustive testing. It ensures that all the crucial and expected business flows get tested, which further assist in the end to end testing of the application.
- These are time savers. Also, a much detailed description as per the test cases is not required. A one-liner description is specified about what to test.
- Test scenarios are written after brainstorming sessions of the team members. Hence the probability of missing any scenario (crucial or minor) is minimum. This is done keeping in mind the technicalities and also the business flow of the software application.
- Moreover, the test scenarios can be approved either by Business Analyst or Client or both who have the explicit knowledge of the application under test.
Test scenarios are thus an indispensable part of SDLC.
Implementation Of Test Scenarios
Let us see the implementation of test scenarios or how to write test scenarios-
- Epics/Business Requirements are formed.
- Example of Epic: Create a Gmail account. Epic can be the major feature of an application or a business requirement.
- Epics are divided into smaller user stories across sprints.
- User stories are derived from Epics. These user stories have to be baselined and approved by stakeholders.
- Test scenarios are derived from user stories or BRS (Business Requirement Document), SRS (System Requirement Specification Document), or FRS (Functional Requirement Document) which is finalized and baselined.
- Testers write the test scenarios.
- These test scenarios are approved by Team Lead, Business Analyst, or Project Manager depending upon the organization.
- Each test scenario must be tied to at least one user story.
- Positive as well as negative test scenarios must be identified.
- User stories comprise of Acceptance criteria like:
- Acceptance Criteria are a list of conditions or the state of intent for the customer requirements. The customer’s expectations and also the misunderstandings are considered while writing the acceptance criteria.
- These are unique for one user story and each user story must have at least one acceptance criteria that should be independently testable.
- Acceptance criteria help in determining which features are in scope and which are out of scope for a project. These criteria should include functional as well as non-functional features.
- Business Analysts write the acceptance criteria and the Product Owner approves them.
- Or in some cases, the product owner can himself write the criteria.
- Test scenarios can be obtained from the acceptance criteria.
Test Scenario Examples
#1) Test Scenarios for Kindle App
Kindle is the app that enables its e-readers to search for e-books online, download, and buy them. Amazon Kindle gives the e-book reader the real-life experience of holding a book in hand and reading it. Even the turning of pages is nicely simulated into the app.
Now let’s note down the test scenarios. (Note: Limited scenarios are listed below to get a general idea for writing the test scenario. There can be multiple test cases derived from it).
|Test Scenarios #||Test Scenarios|
|1||Verify whether Kindle App launches properly.|
|2||Verify screen resolution adjusts as per different devices, after app launches.|
|3||Verify text displayed is readable.|
|4||Verify zoom in and zoom out options are working.|
|5||Verify that compatible files imported in Kindle app are readable.|
|6||Verify storage capacity of Kindle App.|
|7||Verify download functionality is working correctly.|
|8||Verify Page Turn simulation is working correctly|
|9||Verify the eBook formats compatibility with the Kindle app.|
|10||Verify fonts supported by Kindle app.|
|11||Verify the battery life utilized by Kindle app.|
|12||Verify performance of Kindle depending upon network connectivity (Wi-Fi, 3G or 4G).|
Multiple test cases can be derived from each test scenarios stated above.
#2) Acceptance Criteria for Google Docs
‘Google docs’ is a web-based application to create, edit, and share word documents, spreadsheets, slides, and forms. All files can be accessed online using a web-browser having an internet connection.
The documents created can be shared as a web page or print-ready document. The user can set restrictions on who can view and edit the documents. A single document can be collaboratively shared and worked upon by diverse individuals from different geographical locations.
Limited test scenarios are mentioned below for general understanding. In-depth test scenarios for Google docs can be a separate topic altogether.
|Acceptance Criteria #||Acceptance Criteria|
|1||Word, Sheets or Forms can be opened successfully without error.|
|2||Templates are available for docs, sheets and slides.|
|3||Available templates are accessible for users.|
|4||Template used is editable (ex: fonts, font size, adding text, deleting text, insert slide).|
|5||If internet connection is not available temporarily the file can be stored locally and uploaded on availability of internet connection.|
|6||Changes done by multiple users are not over-written.|
|7||Multiple users can work on single document.|
|8||Work done is stored if internet connection is lost while uploading a file.|
|9||Sharing restrictions are applied correctly.|
|10||View restriction users are not able to do any edits on the documents.|
|11||Documents can be published to internet for general public.|
|12||Alterations done to documents are saved with time stamp & author details.|
The number of test scenarios will be multiple and very huge for Google Docs. In such cases generally, only the acceptance criteria are set and approved by stakeholders, and the team members work on these acceptance criteria. Writing test cases for or rather test scenarios can be the exhaustive task for huge applications.
These acceptance criteria play a major role in iterative process planning and should never be overlooked. Defining them beforehand and upfront avoids surprises or shocks at end of sprints or releases
Given a precondition.
When to do an action.
Then the result expected.
The formats of Given, When and Then are helpful for specifying acceptance criteria.
Example Of Test Scenario Template
|Use Story ID #||Test Scenario ID #||Version #||Test Scenarios||# No of Test Cases||Importance|
|USID12.1||TSID12.1.1||Kin12.4||Verify whether Kindle App launches properly.||4||High|
|USID12.1||TSID12.1.2||Kin12.4||Verify storage capacity of Kindle App.||3||Medium|
In any software testing life cycle understanding and laying down the Test Scenarios is a very significant element. The quality of the software can be improved by having a good foundation for test scenarios. Frequently, the use of test cases and test scenarios may get interchanged.
However, the thumb rule is that the test scenario is used to write multiple test cases or we can say test cases are derived from test scenarios. Well defined test scenarios ensure good quality software.