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:
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:
- The driver will sit on the bike.
- The driver remove the stand.
- The driver put the keys.
- The driver spin the key.
- The user will press start button to start bike
- The bike will start.
- The speedo meter will start.
- The driver pull the clutch.
- The driver will press the gear by foot.
- The driver will start releasing the clutch slowly slowly.
- The bike will start going forward slowly slowly.
- The driver will release whole clutch.
- The driver puts second.
- The bike will start gaining the speed.
- The driver will put 3rd gear bike will take more speed.
- The driver increate accelerator.
- The driver will put 4th gear bike will take more and more speed.
- The driver will decrease the gear 4th 3rd 2nd 1st neutral.
- The bike will start reducing the speed.
- The bike speed will become zero.
- The driver spin the key.
- The bike will stop and shut down.
- 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