Test Cases and Test scenarios: Definition, Examples, Template

What is Test case?
  • Test case consist of detailed step's what needs to be followed in order to perform testing.
  • Test case is a set of conditions using which tester identifies whether the software/application under test meet the requirement or works correctly.
  • Whenever a test case is developed with valid set of data then its is called as positive test case.
  • If the test case consist of invalid set of data then it is called as negative test case.
Test Case Parameters:
  • Test case Id: Here each and every test case is given a id.
  • Test Case Description: It consist of details about what needs to be tested.
  • Precondition: Precondition is a condition which needs to be satisfied before entering test cases.            
    • Example:
      • To forward an email from inbox the precondition is atleast one email should be present in inbox.
      • To book a flight ticket the precondition is atleast one ticket should be available.
  • Steps: It consist of steps to follow to perform testing.
  • Data: It consist of data to be provided to application to perform testing.
  • Expected Result: Expected result consist of what should be the outcome when a test case is executed. Test execution should match expected result, If it does not matches expected result then ideally it is a bug.
  • Actual Result:When a test which is executed does not matches expected it comes under actual result.
  • Status:It consist of Test "Pass", Test "Fail", If testing is blocked due to some issue then status is given as "Blocked", if testing is not performed then "Not Executed" status is given.
What is Test case Severity?
  • Severity of test case help us to classify how important the test cases are .
    • Test case Severity is classified into three types:
      • High.
      • Medium.
      • Low.
Interview Question:

When there are lots of test cases and very less time to execute the test cases what will you do?

Answer: When the time is less and test cases are more, I will execute the test cases based on severity i.e I will execute all the test cases with severity high , even after that if there is some more time left then, I will execute test cases with severity medium, even after that if there is some more time left then, I will execute test cases with severity low.

Sample Login Test Cases with template :


TC_ID

Test Case Description

Prerequisite

Steps

Data

Expected Result

TC_ID_01

Test Login functionality by entering

registered mobile number and password

1)App should be installed

2)User should have registered

mobile number

1)Install app

2)Launch App

3)Navigate to login screen

4)Enter mobile number

5)Enter password

6)Click on login

Mobile number:1234567890

password:123456

1)User should be successfully logged in and the user should be

redirected to home page of app

TC_ID_02

Test by entering special characters in mobile number field and

try to login

App should be installed

1)Install app

2)Launch App

3)Navigate to login screen

4)Enter special character in mobile

number field

5)Enter password

6)Click on login

Mobile number:@#$%^&*()!

password:123456

User should not be able to enter special characters

in mobile number field

TC_ID_03

Test by entering characters in mobile number field and

try to login

App should be installed

1)Install app

2)Launch App

3)Navigate to login screen

4)Enter character in mobile

number field

5)Enter password

6)Click on login

Mobile number=abcdef

123456

User should not be allowed to enter characters in

mobile number field

TC_ID_04

Test by leaving Mobile number and password field blank

and try to login

App should be installed

1)Install app

2)Launch App

3)Navigate to login screen

4)Leave mobile number field blank

5)Leave password field blank

6)Click on login


Enter mobile number and password error message should be

displayed

TC_ID_05

Test the login functionality by login with mobile number which

is not registered

App should be installed

1)Install app

2)Launch App

3)Navigate to login screen

4)Enter mobile number which is not

registered

5)Enter password

6)Click on login


User not found error message should be displayed

TC_ID_06

Test login to app by entering invalid password

App should be installed

1)Install app

2)Launch App

3)Navigate to login screen

4)Enter mobile number

5)Enter wrong password

6)Click on login


Invalid Password error message should be displayed



Try this examples on your own(Refer above Template):
  • Write a test case to upload a photo on Facebook .
  • Write a test case to save email in drafts.
  • Write a test case to delete an email from Inbox.
What is Test Scenario?
  • It is a high level description of what needs to be tested.
    • Test scenarios Examples :
      • Compose and email.
      • Delete and email.
      • Save the email in drafts.
      • Login to application.
  • Note: For a particular scenario we can write several test cases.
Test Scenario parameters:
  • Test Scenario Id: It is a id given to each and every test scenarios.
  • Test Scenarios Description: In test scenarios description we give high level description of the application, Based on the test scenarios test cases are written.
  • Number of test cases: Here we specify how many test cases are written for each and every test scenarios.
Sample Facebook Test Scenarios with template:


TS_ID

Test scenario description

Number of Test Cases

TS_ID_01

Test login functionality of Facebook


TS_ID_02

Test forgot password functionality of Facebook


TS_ID_03

Test uploading profile picture on Facebook


TS_ID_04

Test adding friend functionality


TS_ID_05

Test remove friend functionality


TS_ID_06

Test block user from Facebook


TS_ID_07

Test deactivate account


TS_ID_08

Test post functionality on Facebook






Comments