In the beginning of my career, I used to write test scenarios/cases in behavior driven development (BDD) style, which was a not a globally accepted test cases writing practice. I then discovered that this was a style of writing used in automation acceptance testing supported by Cucumber tool. Cucumber is a tool which facilitates BDD style more prevalent in Ruby ecosystem.
Example : Login scenario
The more I researched on how to write test cases I have learned the below things which I am sharing with you all.
What is a use case and its relation to test case?
The use case and the test case are related to each other in the following way:
– Use case is a document prepared by Business Analyst on the requirement specifications, which is in a more elaborate pictorial format. Test cases are derived from these use cases. They also contain real time scenarios.
– Test cases is a document prepared by Test engineers or Quality Analyst based on the Use cases provided by BA. It is in step-by-step descriptive format of functionality with scenarios, steps, defined inputs, expected result, actual result and remark(Pass/Fail)
What are Test cases?
Test cases are a set of conditions, on whose successful execution proves that the system is working as per customer/business requirement. Test case need not be written after getting the first built instead they can also be written after preparing the System requirement specifications or after obtaining the ticket of a business requirement for any feature. Test case are maintained in version format if any changes are made to the original feature.
Why write test cases?
We should carry forward the practice of writing test cases for below reasons:
- – cover all corner cases
- – end-to-end test coverage
- – to maintain the version of changes in the original feature
What are the types of test cases?
Test Cases can be written based on the type of testing: Functional, Nonfunctional, and Automation. There are majorly two types of test cases:
Test cases for manual testing:
For manual testing we have functional and non-functional test cases:
Functional test cases are test cases written for actual functionality, end-to-end application flow and look & feel of the system/application. Non-Functional test cases include Load testing, stress testing, installation and uninstallation of the system/application.
Test cases for automation testing:
In automation, even though we consider the end to end flow, we do not execute each and every test case. We on high priority cover major, critical, important modules, and repetitive work in automation process hence some part of test cases (depending upon the application) from manual test cases are fetched and executed.
How to write Test Cases in an appropriate way?
Template of writing test cases differs from organization to organization. In some organizations test cases are written in excel sheets or Google spreadsheets are shared across, while in some organizations HP-QC tool is used for writing test cases.
Basic attributes of writing test cases are:
- 1. Project name:
- • SRS version
- • Requirement ID
- • Test ID
- • Test cases written by
- 2. Testing Scope:
- • Test steps
- • Expected result
- • Actual Result
- • Conclusion
- 3. Review:
- • Reviewed by
- • Reviewed on Date
- • Reviewed Comment
One of the easy and acceptable way for writing test cases can be:
What is a Traceability matrix?
Traceability matrix: It is a tabular format which maps the functionality and test cases for a system/application. The main objective of traceability matrix is to cover maximum test cases and no functionality is missed while testing. And it is one of the best practice of testing.
Author: Sonali Sorate
Email : email@example.com
Follow me on Twitter