Writing a good functional test case means ensuring the scope aligns with the feedback you care about. In other words, you should avoid cramming too much into a single test.
Ideally, a test case should represent a straightforward user activity. In the e-commerce world, you might leave a review for a past purchase or create a new account.
While testing both activities in a single test case might be tempting, each set of actions represents a different activity—and a separate test case.
Over time, creating tests that are broad in scope makes it difficult to measure results. Better to keep tests short, modular, and confined to a specific function or user flow.
Sign up as a new user using an invalid email address and confirm that the system raises an error. Then, sign up with a valid email address and password. Now, search for an Airbnb stay in Paris, France, and verify the results.
Lumping together unrelated user actions results in a test that is unfocused.
Click the sign-up button and confirm that a sign-up modal appears.
Here, the scope is too narrow; no useful activity can be completed.
Log in to Airbnb using an email and an invalid password. Confirm that the system raises an error.
This is a suitable test case with a well-defined outcome.
To keep tests modular and simplify test suite maintenance, we recommend Embedded Tests. You can use these pre-written modules as building blocks when creating test cases.
- For a more tactical approach to creating Rainforest tests, check out our Deep Dive: Building Your First Test Suite guide.
- To learn about QA strategy, refer to our Introduction to QA Strategy guide.
- As your process matures, consider setting up seeded states to minimize the steps required to put test accounts in a specific state for testing. Check out our Seeded State Management guide.
If you have any questions, reach out to us at [email protected] or via the chat bubble below.
Updated 8 months ago