How to refactor a Delphi unit with 10000 lines with no documentation?

后端 未结 8 2015
醉话见心
醉话见心 2021-02-02 00:28

I have been assigned the task to refactor a Delphi unit. Wow. 10000 lines of code, no documentation, tons of copy and paste code.

THere are many methods made with copy a

8条回答
  •  暖寄归人
    2021-02-02 00:49

    I've faced similar situations. My condolences to you!

    In my opinion, the most important thing is that you actually understand all the code as it is today. Minds better than mine may be able to simply read the code and understand it. However, I can't.

    After reading the code for a general overview, I usually repeatedly single step through it in the debugger until I begin to see some patterns of operation and recognize code that I've read before. Maybe this is obvious, but thought I'd mention it.

    You might also think about creating a good test suite that runs on the current code.

提交回复
热议问题