How to start unit-test old and new code?

前端 未结 5 2026
谎友^
谎友^ 2021-02-05 09:43

I admit that I have almost none experience of unittesting. I did a try with DUnit a while ago but gave up because there was so many dependencies between classes in my applicatio

5条回答
  •  感动是毒
    2021-02-05 10:15

    Writing unit tests for legacy code usually requires a lot of refactoring. Excellent book that covers this is Michael Feather's "Working Effectively with Legacy Code"

    One additional suggestion: use a unit test coverage tool to indicate your progress in this work. I'm not sure about what the good coverage tools for Delphi code are though. I guess this would be a different question/topic.

    Working Effectively with Legacy Code

提交回复
热议问题