Recently I was reviewing the test cases of one of my colleagues who has joined as a fresher in the testing team. Though he had tried his best to cover up all the test cases as per the functionality and WireFrame provided in the Business Requirement Specification, I found that cases written were not descriptive to be understood in one go. I had to ask him multiple times what he meant to say in Case 1, then in Case 2 and so on…
In my experience, I have observed this multiple times. The test cases written by testers are not quite descriptive, people try to address multiple things in a single test case which actually makes it difficult to understand. A test case should be so specific that even a lay man should understand what it is actually trying to cover and test. Functional test cases need to be developed, reviewed, used, managed and saved.
What does a Test Case mean?
IEEE Standard 610 (1990) defines test case as follows:
- “(1) A set of test inputs, execution conditions, and expected results developed for a particular objective, such as to exercise a particular program path or to verify compliance with a specific requirement.”
- “(2) (IEEE Std 829-1983) Documentation specifying inputs, predicted results, and a set of execution conditions for a test item.”
It's basically what you are testing, with what input, what you expect in return and finally recording the actual outcome of the test.
Furthermore, Test Cases can be classified into different categories like GUI, Functional, etc.
What is a Functional Test Case?
A test case which covers the specific functionality of the application can be termed as “Functional Test Case”. Functional test case is attached to a certain function or feature of the application and verifies if it produces the expected result as mentioned in the Business Specification or Functional Specification Document.
Before anything is moved to production, it is required to test that specific feature in the test environment to verify it is actually performing the required function correctly.
Not everything you test in the application relates to the functionality or feature. There are, for example GUI related things like Color, Background, icons, text color, font size, etc which can be tested separately, though these are also important aspects with regards to the application however can not be taken as functional test cases.
What should a Functional Test Case have?
These points are not specific to functional test cases and can be covered in normal test cases as well. However for writing a functional test in software testing, it is recommended to cover the following:
- Menu Name - Window name where functionality needs to be covered.
- Description of the test case.
- Pre Conditions required.
- Steps required to execute the test.
- Expected Output.
- Actual Output.
- Remarks - In case, any additional info needs to be provided.
In case of test case failure, always make sure that you provide all the required information that is available at your end in the Actual Output column. Information like the following is very handy for the developers to debug the issue and also understand the cause of the failure:
- Error message displayed.
- Error log.
- Screenshot of the issue.
- Exact steps to reproduce the issue.
How to write a Functional Test Case?
Let’s take the example of login functionality and write a few test cases.
Here is the mock screen of the demo mobile application through which can be used by the end user to login, sign Up and also to reset the password. It also has links that the users can use to Sign in with Google or Apple accounts.
Here are a few example of test cases that can be derived to test the login functionality:
How to write a good test case for quality product?
A tester should always create a test case keeping the end user in mind. An effective test case is the one which can uncover defects. Bugs are not necessarily found in complex test cases. A bug could be hidden in the title of the page, you just need an effective test case and a tester’s eye to uncover it.
Always mention the steps in the test case, it makes the developers work easier.
It is advisable to perform only one check or validation per test case. Your test case should not be pointing to two different things. If required, split the test case in two, rather than summing up all in one.
Your cases should be self explanatory so the person who views your test cases shouldn’t feel the need to contact you to make them understand what you have written.
Try to write independent and small test cases which could be reused later.
Test cases are the basis on which you actually test the application and derive the final outcome if the application is production ready or you still need something to fix before it reaches the market. Hence, always make sure you write a good test case which eventually will help you in regression tests and also prove to be an evidence to what all things were tested and covered during testing phase in case any production issue arises later.
This GitHub repository contains the general test cases for performing manual testing on the Web/Mobile application. It also has test cases related to API Testing and templates related to test plan and BugBash.
Do mark a ⭐ and make the project popular, so it reaches the people who need help and learn more about testing and writing test cases.
In this blog, we covered what a test case is and then moved towards functional test cases where we talked about important aspects to consider while writing a functional test case. We also tried our hands on writing functional test cases considering the example of a login functionality of a mobile application. In the end, we drafted some important points to consider while writing a good test case.
Hope you got a better understanding and knowledge about writing test cases.