How to write Test Cases?
What is Test Case ?
Test case is “Documentation specifying inputs, predicted results, and a set of execution conditions for a test item.” The purpose of Test Case is to divide the software function into small units of function that is testable with input, and producing result that is measurable.
i-e A test case is a feature/function description that should be executed with a range of input, given certain preconditions, and the outcome measured against expected result.
These are the fields commonly present in the Test Cases :
Test case id
Test Case Description
Procedure / Test Steps
Test data
Expected result
Actual result
Status ( Pass/ Fail)
Comments
Test cases should be simple and easy to understand for Developers.
Test Case ID :
This ID should be Unique throughout the Testing Application and not to change at any moment.
Test Case Description:
Explain the function under test. Clearly state exactly what attribute is under test and under what condition.
Prerequisites- Every test needs to follow a sequence of actions, which lead to the function under test. It could be a certain page that a user needs to be on, or certain data that should be in the system . For example registration step should be completed before start testing login.
Procedure/Steps:
Sequence of steps to execute the specific function.
Test data:
Specify the data used for a particular test or if it is a lot of data, mention the path of a file where this data is stored.
Expected Result:
Clearly specify the expected outcome in terms of the page/ screen that should appear after the test, changes that should happen to other pages, and if possible, changes that should happen to the database..
Actual Result :
State the actual result of the function execution. Especially in case the test case fails, the information under ‘actual result’ will be very useful to the developer to analyse the cause of the defect.
Comments:
In this section you can add your reviews, suggestions and ideas to developers for the bug how we fix that. Especially this section made to communicate with developers.
Read more http://qtpbook.com/2013/05/14/how-to-write-test-cases/











