AAA framework is a way to make your tests and acceptance criteria easier to write but also to make it easier to check for their correctness.
AAA quality
Any acceptance criteria or test following the AAA framework will be divided into three steps.
Arrange the initial state
The first step is to create the initial state of the application before testing.
The idea behind this approach is to list everything that is necessary to make sure that the scenario described will be producing the same result if it is executed multiple times.
This is particularly useful as reproducing the result consistently is key when automating a test to have consistent results and not having the CI randomly produce different outputs on each run.
Defining logic to test
Once the initial state is defined, the next step is to define the logic to be tested, and this is done in the second step, also called act.
For that the logic that has to be executed will be detailed.
Asserting final state
Finally, the last step involves asserting that after executing all the previous steps, the final step is the expected one.
For that the last step of the AAA framework, assert, needs to describe what the final state of the application should look like.
That way it will be possible to verify whether there is a mismatch between the actual output and the desired outcome.
Any questions? We‘re here to help!
If you still have questions or need further assistance, please don‘t hesitate to reach out to me.