4 ms·
You were hired to help fix the problem not add to it. No rewrites, no major refactors yet. Fix bugs, for every bugfix add a regression test so it never happens
by segmondy 9y ago
You were hired to help fix the problem not add to it.
No rewrites, no major refactors yet.
Fix bugs, for every bugfix add a regression test so it never happens again. Find a list of the most recent bug fixes, findout if there is a common pattern. If so, target that.
Are there code reviews? If not start one. Is there a coding standard? If not start one. With code review & standards in place. Start adding small tests. Small refactors with tests only.
Are there things that need to be done in a specific order most of the time? Document it, build a checklist.
Are there good logs? If not, add them.
The difficult work right now is not technical but social. The team needs a good process and to follow a best standard.
It's gonna be tough, cultures are difficult to change, but be patient and remind yourself. You were hired because they have problems not because they want to give away free money or help you out with a job.
- mattmanser 9y agoWhat's the point of adding regression tests to spaghetti code? All you're doing is making it an even bigger pain in the ass to refactor. And at this stage he probably doesn't even properly understand the business logic behind the code anyway and will make duff tests. I'm admittedly pretty meh about tests, never seen good ones that are flexible and actually test the functionality instead of the implementation. One of my client's actually had a contractor add a bunch of tests to some existing code that took him a month or two and caught a whole one bug in 4 years that would have probably been caught in QA any way. Otherwise I generally agree, but you can refactor as you go, which I've done plenty of times. Depends on team size and how productive you are to the other devs, but you can single handedly refactor really bad sections and setup a general outline of how the code should be laid out within a year, though you need to start getting people on board.
- mattm 9y ago> What's the point of adding regression tests to spaghetti code? All you're doing is making it an even bigger pain in the ass to refactor Refactoring is changing the code to make it more understandable while keeping the functionality the same. That is the perfect time to add tests. Adding tests before refactoring will help someone understand the code first and will also let you know if you've broken something.