New team. Old code. The code is complex and lacking any automated testing. You're tasked with a "small" change to a massive build script. You want to "fix" all the issues you see and completely rewrite the script. Should you rewrite or should you follow Kaizen to make it 1% better?
I have been a part of teams where “scripts”, particularly build and deploy scripts, lack automated tests. The question of how to improve the code arises and one answer usually ends up being a rewrite. I have seen several rewrites and during these rewrites:
The rewrites have been proposed because the code is perceived to be too big/complex to get tests around it or because it’s complex beyond further maintenance. So if rewrites are not the answer, what can we do?
Kaizen is the philosophy of continuous improvement of working practices. You decide to just make the script 1% better today instead of doing the rewrite. We will explore two options for doing so, both of which involve automated testing. We can write the first characterization test for the script or specifically unit test the new feature. We’ll talk about both approaches and why you might choose one over the other. In time, this script may undergo the “rewrite” that you initially dreamed of but you went about it in a much safer way.