refactoring - Working with bad code ? do i need to refactor it? -


i'm working in company big system messy code structure. want work right standards polymorphism , design patterns.

but code such mess , needs heavily refactored that. current company gives me tasks, , if have heavily refactor, open many bugs in system it's not unit tested, of course.

what think? should work on tasks on bad structure finish work? or tell them need rebuild many things (also won't find difference features work now).

i think need start off unit tests.

whilst doing tasks have been assigned, write tests test code change, can refactor it.

now can start write code task, test-first.

if code there works, refactoring best option. if doesn't work, rewrite becomes possible.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -