TDD in Legacy Code - ATDD for Bugs
Developers sometimes try to solve bugs without first having reproduced the bug. There can also be miscommunication between Developers & QA Engineer regarding bugs. How do we reach alignment? Use ATDD.
🔒Hello, this is Valentina with a premium issue of the Optivem Journal. I help Engineering Leaders & Senior Software Developers apply TDD in Legacy Code. This article is part of the TDD in Legacy Code series. To get these articles in your inbox every week, subscribe:
Problem #1: The bug isn’t solved?!
Sometimes when Developers get a Bug ticket, they immediately jump to the “solution“ (they immediately think of the bug fix in their mind), open up the code straightaway, make the changes, and as soon as possible, hand it over to QA Engineers. But then the QA Engineer tests the fix, and says that the bug wasn’t actually solved. Or it may even pass the QA testing, but the User complains that the bug wasn’t fixed.
Why? The developer hadn’t actually reproduced the bug BEFORE attempting to fix the bug.
Problem #2: The bugs keep re-reoccurring!
Many teams face the challenge of fixing a bug, having it tested by QA, and having the fix deployed to Production… But then, some months later, the same bug appears in the system! What’s even worse is that the bug keeps coming back, it’s unstoppable.
Why? The bug fix was only verified manually, with no automated verification. This means that when we introduce the bug again, we have no idea.
Solution: Use ATDD for reliable Bug Fixing
By applying ATDD to fix bugs, it helps us solve problems:
Through the Bug report, we translate the expected behavior into a failing Acceptance Test, to prove that we’ve reproduced the bug
Then, when we implement the bug fix, and the Acceptance Test passes, we can be sure that we’ve fixed the bug
Lastly, the Acceptance Test remains in our Test Suite, so if the bug accidentally ever occurs again, it will be caught by the Acceptance Test (thus, the bug won’t reach the QA Engineer, and won’t reach the End User)
Here are the steps to introduce ATDD for Bug Fixes in Legacy Code. I’ll provide you with step-by-step guidance on how to introduce ATDD in your GitHub Sandbox Project. ⬇️⬇️⬇️