Use Case testing

 What is a Use case?

- A use case is a list of steps to achieve a goal in the system.

- These steps define the interaction between Actor and the System.

- The use case outlines the main scenarios and the optional exceptional scenarios.


Example:

Use Case name: Cash Withdrawl

Description: This use case describes how the Customer uses ATM system to withdraw cash from his/her bank account.

Pre-condition: 

1. ATM system is online

2. Sufficient balance is available

Normal Workflow:

1

The Customer will insert the debit card

2

The System will prompt for a PIN

3

The Customer will enter valid PIN

4

The System will display the option to "Withdraw Cash"

5

The Customer will select the option to withdraw

6

The System will prompt for an amount

7

The Customer will enter an amount

8

The System will submit the amount to Bank for approval

9

The Bank will confirm the transaction

10

The System will dispense cash

11

The System will return the card.

12

The use case ends with a success


Alternate workflows:

4a. If PIN is Invalid,

1

System will return the card

2

The use case ends with a failure


8a. If the Amount is invalid,

1

The System will display and error message and prompt for another amount.

2

The use case resumes at Step 7


10a. If the bank declines the transaction,

1

The System returns the card

2

The use case ends with a failure


3a, 5a, 7a If Customer selects the option to "Cancel"

1

The Sytem will return the card

2

The use case ends.

Additional Bussiness rules: The System will dispense only 100$ maximum in a Single transaction.

Post-condition: The Customer will receive their cash amount


Design Test cases for above use case:


TEST CASE(S)

STEPS

EXPECTED RESULTS

Test Case 01: Cash Withdrawl1 – Normal Workflow

1

Insert Debit card

System will prompt to enter PIN

2

Enter valid PIN

The System will display option to "Withdraw Cash"

3

Select the option to "Withdraw Cash"

The System will prompt for an amount.

4

Ènter valid amount as 100$

The System will dispense the cash. The System will return the card

Test Case 02:Cash Withdrawl2 – Invalid PIN

1

Repeat step 1 of Cash Withdrawl1


2

Enter an invalid PIN

The System will return the card.

Test Case 03: Cash Withdrawl3 – Invalid Amount

1

Repeat step 1 through 4 of Cash Withdrawl1 with invalid amount ($101)

The System will display an error message and prompt for another amount.

2

Repeat step 4 of Cash Withdrawl1 with invalid amount ($0)

The System will display an error message and prompt for another amount.

3

Repeat step 4 of Cash Withdrawl1 with valid amount ($1)

The System will dispense cash and return the card.

Test Case 04: Cash Withdrawl 4 - Bank declines transaction

1

Repear steps 1 to 4 of Cashwithdrawl1 with amount > account balance.

The System will return the card.

Test Case 05: Cash Withdrawl 5 – Cancel transaction.

1

Repeat Step 1 of Cash Withdrawl1


2

Select the option to "Cancel"

The System will return the card

3

Repeat steps 1 and 2 of Cash Withdrawl1


4

Select the option to "Cancel"

The System will return the card

5

Repeat steps 1 to 3 of Cash Withdrawl1


6

Select the option to "Cancel"

The System will return the card

This is how we design test cases using use cases.



Comments

Popular posts from this blog

Jenkins CICD in One Page

Why do we need a build tool?

Deutsche Bank Interview Questions - 2024