How to write effective test cases
Posted: Tue Jan 21, 2025 4:22 am
In financial services, it is called the "maker-checker process" In risk management, it is popularly known as the "4 eyes principle" In US nuclear weapons management, it is called the "two person concept"
Essentially, they all do the same thing: these processes include an additional level of assessment, confirmation, authorization or approval to ensure the accuracy, quality or relevance of the result.
In software development, this is called testing or quality assurance. Simply put, software testing evaluates code to ensure it works as expected. To perform this activity effectively, quality teams use a powerful tool called a test case.
In this blog post, we explore what it is, why it is needed, when to use it, and most importantly, how to write test cases.
What is a test case?
A test case is a set of actions, conditions, and input data used to evaluate the quality of a software application.
Suppose you have created a form to capture the user's name and email ID for newsletter vp administration email list subscription. Your test case will specify the following:
Actions [both user-facing and internal] : Anything that the user or the software is expected to do to complete the workflow in the software being built.
The user enters a name
The user enters an email address
User clicks "Submit"
Sending a confirmation email to the user
The data is stored in the corresponding database
Data added to the corresponding newsletter email list
Conditions : The requirements that the user or system is expected to meet when performing its actions.
Save if name field validation is accepted, otherwise show error message
Save if validation is accepted for email address field, otherwise show error message
Add to newsletter list only if user has confirmed their email address
If the user already exists, display the corresponding error message
Input data : Samples of what is acceptable input to the function. QA teams typically create test data that allows for checking positive and negative results.
For example, if a condition for validation of a name field is "can only contain letters of the alphabet and spaces", the test data would be as follows
Jane Doe, who meets the criteria
Ad@m Sand!er, who does not meet the criteria
Essentially, they all do the same thing: these processes include an additional level of assessment, confirmation, authorization or approval to ensure the accuracy, quality or relevance of the result.
In software development, this is called testing or quality assurance. Simply put, software testing evaluates code to ensure it works as expected. To perform this activity effectively, quality teams use a powerful tool called a test case.
In this blog post, we explore what it is, why it is needed, when to use it, and most importantly, how to write test cases.
What is a test case?
A test case is a set of actions, conditions, and input data used to evaluate the quality of a software application.
Suppose you have created a form to capture the user's name and email ID for newsletter vp administration email list subscription. Your test case will specify the following:
Actions [both user-facing and internal] : Anything that the user or the software is expected to do to complete the workflow in the software being built.
The user enters a name
The user enters an email address
User clicks "Submit"
Sending a confirmation email to the user
The data is stored in the corresponding database
Data added to the corresponding newsletter email list
Conditions : The requirements that the user or system is expected to meet when performing its actions.
Save if name field validation is accepted, otherwise show error message
Save if validation is accepted for email address field, otherwise show error message
Add to newsletter list only if user has confirmed their email address
If the user already exists, display the corresponding error message
Input data : Samples of what is acceptable input to the function. QA teams typically create test data that allows for checking positive and negative results.
For example, if a condition for validation of a name field is "can only contain letters of the alphabet and spaces", the test data would be as follows
Jane Doe, who meets the criteria
Ad@m Sand!er, who does not meet the criteria