Chapter 3.5.2: The role of QA in TDD
How can we integrate QA into the process if we practice TDD and write one test after the other?
Disclaimer: You are reading an early version of the text! The final version of the book will be revised and may contain additional content.
In case you don't have a specialized QA role in your team, the approach above of developers writing both Application and Component Tests themselves is well suited. But what if you're in the fortunate position of working in a cross-functional team that includes a dedicated QA person? In this case, we can choose from a couple of alternative workflows.
QA writes Application Tests first
When starting to work on a new user story, the team member responsible for QA can work on writing Application Tests independently. After they have written at least one test, the developers can start working on the implementation. Writing component tests is still the sole responsibility of the developers. One major downside of this way of working is that QA blocks work on a user story for as long as it takes them to write at least one test. And if the developers finish their work faster than the QA person can push the next test, they have to wait for the test before they can move on.
This workflow is not very practical. One way to mitigate at least the second problem is for QA to write all the tests for a user story upfront, and only after that the work on the implementation can begin. But that way, the developers have to wait even longer. And there is a second potential issue with this approach: you might encounter problems with the original plan for how to implement a particular feature. If we've written all the tests upfront, we must adapt them to match the new course. Still, this is a sound approach. You can make it work if you're aware of its problems and okay with adapting your tests from time to time.
Keep reading with a 7-day free trial
Subscribe to Good Tests for Vue Applications to keep reading this post and get 7 days of free access to the full post archives.