I have a legacy project written for Delphi 7. I'm about to integrate a bunch of new code into it which includes a test suite using DUnit. DUnit it not a part of Delphi 7 (it has been integrated later), so here's the question: should I include DUnit units into my project (check them into version control etc) or should I better require all the participating developers to maintain their separate DUnit installation?

The project is closed source and is written and deployed only within the enterprise I'm working for—that is, the project source code won't be delivered to any consumer.

有帮助吗?

解决方案

The way you've worded your question, there may be some confusion as to what you're asking. So let's get that out of the way first.

It sounds like your asking whether to include DUnit units in your production application. This would be a very bad idea, and I'll avoid the details why in this answer.

However, I understood your question to be about whether you should treat this "third party" source like your own project source code (in terms of source control). And I've answered as such.


There are a number of principles that justify including DUnit source in your SC repository.

  • Whenever you have a new developer or new dev machine installation, you want to get up and running quickly, easily and with a minimum of fuss.
    • Only when all dependencies are managed within your source repository can the ideal be achieved. It's quite difficult to do better than: (1) Get Latest Source. (2) Build.
    • Even if you use a disk image with all required apps (including third-party libraries), it won't have 100% up-to-date source.
  • It is very important that all your developers are on the same version of DUnit.
    • Otherwise you risk having test cases that work on one machine, but might not even compile on another.
  • After you've made extensive use of DUnit, I'm sure you'll find various things (big and small) that you'll want to change. You'd best keep these changes in your repository.
    • My personal experience with DUnit is that parts of it are poorly designed. As a result some extensions are much more easily done by modifying the units directly.

I would even go a step further: Even though more recent versions of Delphi include DUnit, I'd still make a copy into Source Control. As much as DUnit is shipped with Delphi - it is really just third party source slapped into a folder.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top