Use Case In Software Testing

Use Case is a document which describes the end to end behavior of the system from User perspective. It has User action which defines the action performed by the user And System behavior which describes the system reaction done on the basis of User action. Each Use case describes the interactions the actor has with the system in order to achieve a specific task.

Use cases also define sequence of steps that describe every interaction between the actor and the system. But Use cases are defined in terms of the actor, not the system, describing what the actor does and what the actor sees rather than what inputs the system expects and what the system’s outputs

What is Use Case in Testing?

A Use Case in Testing is a brief description of a particular use of the software application by an actor or user. Use cases are made on the basis of user actions and the response of the software application to those user actions. It is widely used in developing test cases at system or acceptance level.

What is Use Case Testing?

The Use-Case Testing Technique helps identifying test cases that cover the entire system, on a transaction by transaction basis from the start to finish. It is a Functional Black Box Testing technique of deriving the Test Case through the use case document.

Use Case testing ensure the important User journeys or important User path are working fine on the system. It is a type of complimentary testing and it does not provide the entire coverage of the application. It is not a candidate to judge the quality or decide the production deployment of an application, based on the use case test results.

Doing use case testing, we do and test the end to end flow of all the transactions (positive test case) and also cover the alternate flows (negative test case) based on the user action and system action. User action is the steps which the user does (Request) and system action is the output of user action (response). Test cases based on use cases and are referred as Test Scenarios.

Use Case Example

When developing use cases, a test case table is usually developed. There will be a success scenario as well as the steps that the user should complete. Examples of the steps can be:

  • Insert card,
  • Validates card and asks for a PIN,
  • Enters a PIN,
  • Validates a Pin, and
  • Allows access to the account.

Following this, there will also be a list of extensions within the table. It could happen, for example, that upon validating the card, the system determines that something is incorrect. The extensions can be listed as follows:

2a) Card not valid (Display message and reject card),
3a) Pin not valid (Display message and ask for re-try – twice), and
4a) Pin invalid 3 times (eat card and exit).
Many times, software testers and developers refer to users as ‘actors’. Use cases are associated with the following:

Actors (human users, external hardware or other components or systems), and
Subjects (the component or system to which the use case is applied).
Each use case specifies some behavior that a subject can perform in collaboration with one or more actors.

A use case specifies a type of behavior that a subject can perform in collaboration with one or more actors, and it can be described by interactions and activities as well as preconditions, post conditions and natural language where appropriate.