Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
*shrug* Sometimes, legacy systems are so brittle you have to hack it to get unit tests working.
-
LMagnus20577y@Jantho1990 even if that's the case adding poor decisions to poor decisions is not the way forward.
-
@LynxMagnus The "proper" way forward for legacy systems that are so brittle is to rebuild them so they no longer become brittle. That much is obvious. But, depending on how poorly the code is written and how garishly it is architected, that can take months, maybe years of dedicated work. Good luck selling that to the folks upstairs.
"Is this really necessary?"
"Yes, right now it's a miracle anything even works!"
"Well, do it in your spare time, then! Meanwhile, here's this great new idea you need to implement..."
Given the choice between imperfect unit tests and no unit tests...at least imperfect unit tests still provide info, and I'll take that over waiting for the whole system to be refactored so we can make proper unit tests with mocks and spies and everything. -
LMagnus20577yThe unit tests were written the same time the project was created. That should have been a hint to the developers that there were issues with what they were doing and stopped to rethink.
Related Rants
Just found a unit test in a legacy project that is over 300 lines long, creates files on the server and multiple records in the database, then deletes them all. It takes over two minutes to run.
Madness
rant
unit tests
mock that shit