Updated April 13, 2023
Definition of Use Case Testing
Use case testing is a type of software testing that comes under the functional black box testing. As it is black box testing, there will be not and execution of the codes. It is used to ensure that the path used by the users is working as expected or not. It makes sure that the user performs its function successfully, without any interruption or error. Use case testing is not performed to determine the quality of the software. It is an end to end testing. Even if it is an end to end testing, it will not ensure the entire coverage of the user’s applications. Note that we cannot decide the deployment of the production environment based on the test results derived from the use case testing.
Use cases are made on the basis of user actions towards the software application and the application response towards the user actions.
Elements of use cases which are given as follows:
- Actor: It is a user entity that is involved in use case actions.
- Brief description: It is a description that explains the use case in brief.
- Precondition: It is a condition that needs to be satisfied before the use case starts.
- Basic Flow: It is a flow of transaction that is done by the user while interacting with the system or software. As it is a normal workflow, there will be no chances of getting an error from the system. The actor or user will get the expected result from the system.
- Alternate Flow: A system can also have alternate flow. This is a less common interaction done by the user towards the system.
- Exception Flow: It is a flow that prevents and user to achieve its goal and throw some error.
- Post Condition: It is a condition that needs to be checked after the use case.
Use Case Notation
The below image shows the notation used for making a use case.
- System: It is shown by using a rectangle shape.
- Use Case: It is shown by using an oval shape. Any action or activity which is carried is shown by using the use case.
- Actor: The actor is an entity that is used to represent the user.
- Relationship: Relationship is used to show the flow of the action. It is represented by using an arrow.
How does Use Case Testing Work?
Consider an example where a user needs to buy clothes online. The first user will visit the site and click on the login. After that user will enter his user id and password. After a successful login, the user will search for the item he is intended to buy. After viewing three-four items, the user will add this to the shopping cart and then click on the buy options. After all of these action user will logout the system. So this is an example, where all the transactions are logically connected to each other in a sequential manner. The user will perform these steps to accomplish the task. Use case testing tests these flow of transactions in the entire system from end to end. Use cases are the way that user will likely use to achieve a successful task.
In use case testing, the first step is to check the use case document. We need to first review the document and need to ensure that all the functional requirements are working properly or not. The second step is to ensure that all steps or test cases or automatic. The third step is to check the normal workflow of the system. The fourth step is to ensure that the alternate workflow for the system is working properly. The fifth step is to ensure that all the steps in the use cases are tested. Once we have reviewed these cases, we can write a test case.
Example of Use Case Testing
Consider an example where users try to login to the Gmail account whereas:
- Case Name: Gmail account login
- Actor: User
- Pre Condition: System must be connected to a network.
A use case for Gmail account login.
A: Actor/ S: System
- User enters the email ID.
- The system validates the email ID.
- The user enters the password.
- The system validates the password.
- The system shows the emails to the user.
Extension
- 1a Invalid email ID. S: System shows an error message.
- 3a Invalid password. S: System shows an error message.
Advantages of Use Case Testing
Some of the advantages are given below:
- It helps to understand the requirements of the system.
- It is a sequence of steps that describes the interaction between user and system.
- It helps to manage the complexity in the transaction, as it focuses on one task at a time.
Conclusion
Use case testing is testing which is used to test the end-to-end transactions. Based on the requirements uses cases are written and executed. In this article, we have discussed the basics of use case testing, with its working. We have also discussed one sample example to understand the concept in a practical manner.
Recommended Articles
This is a guide to Use Case Testing. Here we also discuss the introduction and how does use case testing work along with advantages. You may also have a look at the following articles to learn more –