Software Test Cases
In software QA terminology, software test case is simply a set of steps that when performed (or ran) should always produce a given result. Even a small application or monolith or a simple microservice will have a lot of test cases - as we need to define every set of interaction from the user with the desired output.
In case of a simple typical monolith web app, a test case might be about the 'login' functionality. So in such a case, test case will determine what URL a user should visit, when should she see a form, what should happen when a "Login" button is pressed (with both correct and incorrect info)
Similarly, in case of an API, it might be about defining a 'read' function, so a test case would need to include which URL should be called by API client, and what response type would be (JSON, HTML, or XML) and what response content would be.
Key concepts while writing a test case
- Understandable: Your test case should be understandable by all team members, not just technical members or developers. A test case will not only be read by developers but your product manager, other testers, and even high level executives. So it has to be written in plain and simple language. Technical jargon should be avoided!
- Granularity: Each test case should focus on single set of functionality of a feature, or a sub-feature. In other words, each test case will test one-single given condition exclusively. This way when test case is failed, developers won't have to second guess about what when wrong and it'll speed up their work.
- Reproducibility: It must be reproducible (by other team members or by you) with the steps mentioned, it isn't a valid test case if you forget to add a necessary step. For a complicated application, writing such a test case would mean a lot of test case steps, but rememeber, it'll all be worth it in the end.
- Priority: You should categorize test cases into desired priority, because a standard software cannot have all test cases with same level of importance. From time to time, a team under deadline is required to make decisions so most important work gets done first, same applies to test cases.