logoalt Hacker News

charles_fyesterday at 3:26 PM3 repliesview on HN

Write tests. Most likely those 300k lines of code contain a TESST folder with 4 unit tests written by an intern who retired to become a bonsai farmer in the 1990s, and none of them pass anymore. Things become much less stressful if you have something basic telling you you're still good.


Replies

layer8yesterday at 5:01 PM

The problem with complex legacy codebases is that you don’t know about the myriads of edge cases the existing code is covering, and that will only be discovered in production on customer premises wreaking havoc two months after you shipped the seemingly regression-free refactor.

show 5 replies
karmakurtisaaniyesterday at 5:04 PM

The best time to write tests was 20 years ago. The second best is now, provided you've applied to all the companies with better culture.

ipsento606yesterday at 7:22 PM

I've been working on react and react native applications professionally for over ten years, and I have never worked on a project with any kind of meaningful test coverage

show 3 replies