Use Case Testing

Use case testing is basically a Test Designing technique. Use case contains the steps, this steps explains how the actor (which may be anything like user, client or other devices or system.) interacts between the applications. So this use case cover all the functional requirement of the application. It has two parts one is main scenario and other is exceptional scenario.

We will discuss some examples.

Use Case Name: Bike driving
So the use case name is Bike driving

Actors and System: Driver (user) and Bike
The actor are user and bike who are going to interact between each other.

Prerequisite:

  1. Bike should have fuel.
  2. Driver should know the driving.
  3. Driver should have the Bike Key.

These are the list of prerequisite, bike should have fuel, and without these bike won’t run and other prerequisite is user should know the driving otherwise he will collide or crash on something.

How user case is show the interaction between the driver and the bike below are the normal flow and alternate way or alternate work flow. The difference between these two flows are in normal work flow nothing will go wrong, everything will happen as per the flow it’s something like the testing the application with the positive flow. And in alternate flow something can go wrong.

Normal Flow:

  1. The driver will sit on the bike.
  2. The driver remove the stand.
  3. The driver put the keys.
  4. The driver spin the key.
  5. The user will press start button to start bike
  6. The bike will start.
  7. The speedo meter will start.
  8. The driver pull the clutch.
  9. The driver will press the gear by foot.
  10. The driver will start releasing the clutch slowly slowly.
  11. The bike will start going forward slowly slowly.
  12. The driver will release whole clutch.
  13. The driver puts second.
  14. The bike will start gaining the speed.
  15. The driver will put 3rd gear bike will take more speed.
  16. The driver increate accelerator.
  17. The driver will put 4th gear bike will take more and more speed.
  18. The driver will decrease the gear 4th 3rd 2nd 1st neutral.
  19. The bike will start reducing the speed.
  20. The bike speed will become zero.
  21. The driver spin the key.
  22. The bike will stop and shut down.
  23. The use case ends with success.

This is the normal flow and steps of interaction between the driver and the bike. Here thing is correct. But in alternate work flow, something goes wrong, see below are the alternate work flows.

Alternate Work Flow (Negative flow):

When there is not fuel in bike : the after step 5 the step 6 will be as follow
Alternates steps:
Step 6.  Bike will not start.
Step 7. User case will ends with failure.

When user enters wrong key : then bike will not start and keys will not spin
Alternates steps:
Step 4. The Driver enters wrong key.
Step 5. The Driver tries to spin the key.
Step 6. The bike will not start.
Step 7. Use case will ends with failure.

When there is no battery backup : so after pressing the starter the bike will not start
Alternate Steps:
Step 6.The driver will press the start button.
Step 7.The Bike will not start.
Step 8.The Use case will ends with failure.

There may be the more alternate ways, this is how use case look like. After creation of use case tester has to write the test cases for this use case. Mostly preferable is that write one test case for each flow, means one test case for normal flow and one test case for each alternate flows. That would be enough the cover all the requirements.

No comments:

Post a Comment