138

Senior: Why did you refactor those ten files?

Junior: There was a method copy-pasted in every one of them, so I moved it to a utils class.

Senior: Don't you know we will have to test all of those changed classes again? Please, rollback!

Junior: ok.

... two days later ...

Senior: Why did you just copy-paste that method? Don't you know it's bad practice?

Comments
  • 28
    OMFG.
    O.o
    Another idiot Senior dev? how did this guy made it to senior?
    Also, testing the refactored class should not be a problem at all.
  • 14
    Stupid question: why would you have to test again after refactoring?
  • 3
    @Krokoklemme prob protocol.

    But I'm sure he would have seen it was a roll back if you did roll back on version control and didn't just re write and copy paste them again. The senior prob swamped. Annoying for you I'm sure though :)
  • 4
    @CogInTheWheel Well if there were unit tests it wouldn't even take 5 minutes to test it...
  • 4
    The whole point of tests is that you can refactor without worrying about breaking things...
  • 2
    @bittersweet sure, it you keep interfaces and structure the same.

    After I refactored the app in tracking care of, amount of code reduced by half. Whole structure is now different. Test cases had to be rewritten from scratch. Only external API has survived. But I had no integration tests before starting ;-)
  • 1
    @mt3o And you didn't do TDD while doing the more rigorous refactoring... :P
  • 0
    You can use TDD when you create new code. If you have an 5 year old app written by two separate team, one in India one in USA. At first they had no contact except sharing xml. In single app. Between the app and its dependency. A jar library.
    In that app each object was a dependency for each other object. Some were just injected as a parameter to be passed deeper thru the call stack only to discover that the code is obsolete and never used.
    You can effectively use TTD during rf if the app has rather loose coupling. That wasn't the case. I had to refactor just to be able to write unit tests...
  • 1
    Sounds like the typical fake senior, all titles but can't code shit...
  • 1
    😦😦 this rant is too facking close to my situation. Here, have my upvote!
Add Comment