docs/contribution/testing/writing-high-quality-testing-instructions.md
Having clear testing Instructions on pull requests is the first level of quality engineering in WooCommerce, which is key for testing early and minimizing the impact of unexpected effects in the upcoming versions of WooCommerce.
This page contains the following sections:
A test is a method that we can use to check that something meets certain criteria. It is typically defined as a procedure which contains the steps required to put the system under test in a certain state before executing the action to be checked. Therefore, a test consists of the following stages:
For example, in the process of adding an item to the cart:
Specifying the preconditions, actions and validations can be quite beneficial when understanding the scope of a test, because:
In this context, we will refer to testing instructions as the tests we need to execute in order to validate that the changes delivered in a pull request or release work as expected. This means the testing instructions could refer to a test or more, involving the happy path and potential edge cases.
As stated in the previous section, a test (in our context, a testing instruction) is a method to check that a new change or set of changes meets certain criteria.
Therefore, a PR could have testing instructions for multiple scenarios, in fact, it is recommended to include testing instructions for as many scenarios as needed to cover the changes introduced in the PR. In other words, please add as many testing instructions as needed to cover the acceptance criteria, understanding acceptance criteria as the conditions that a software product must satisfy to be accepted by a user, customer or other stakeholders or, in the context of a PR, the conditions that this PR must satisfy to be accepted by users, developers and the WooCommerce community as per requirements.
- Install the WooCommerce Beta Tester plugin.
- Go to `Tools > WCA Test Helper > Experiments`.
- Toggle the [x] experiment.
In this section, you will see some real examples of testing instructions that have room for improvement (before) and how we can tweak them (after).
Before:
After:
Improvements:
Before:
After:
Improvements:
Before:
After:
Improvements: