"I'll be back later, I'm sure I will"
Hi,
Today, when I was revising some classes of our messy code base, it caught my attention this comment of one of my former teammates, who recently left:
Back in June 2016, when he was actually performing a refactor of the same code base, he wrote TESTS PENDING into a commit, bearing in mind to create some unit tests after the refactor.
Unfortunately, we know we never come back. And this is something we all have gone through. Some of the important bits that Martin Fowler and Kent Beck encourage to do when performing refactors of legacy code is to move on bit by bit, small changes along with unit tests. [Refactoring]
After a massive refactor, they also point out, it's very difficult to keep track of all the changes in case we break the code, and as a consequence, reverting our changes is necessary. Performance gains when shorts steps are taken since we minimise the time of reverting newly introduced bugs or rolling back due to undesired side effects.
In short, it's not easy to stick to good practises, but, just for the sake of our future selves or any other developer who has to take over the project, leaving a bunch of test cases with a good degree of coverage is essential.
This post is dedicated to Nico, our QA who defended TDD so many times in our team meetings, and the company decided eventually to lay him off. Sad.
Today, when I was revising some classes of our messy code base, it caught my attention this comment of one of my former teammates, who recently left:
Back in June 2016, when he was actually performing a refactor of the same code base, he wrote TESTS PENDING into a commit, bearing in mind to create some unit tests after the refactor.
Unfortunately, we know we never come back. And this is something we all have gone through. Some of the important bits that Martin Fowler and Kent Beck encourage to do when performing refactors of legacy code is to move on bit by bit, small changes along with unit tests. [Refactoring]
After a massive refactor, they also point out, it's very difficult to keep track of all the changes in case we break the code, and as a consequence, reverting our changes is necessary. Performance gains when shorts steps are taken since we minimise the time of reverting newly introduced bugs or rolling back due to undesired side effects.
In short, it's not easy to stick to good practises, but, just for the sake of our future selves or any other developer who has to take over the project, leaving a bunch of test cases with a good degree of coverage is essential.
This post is dedicated to Nico, our QA who defended TDD so many times in our team meetings, and the company decided eventually to lay him off. Sad.
Comments
Post a Comment