在哪里存储单元测试类?
到目前为止,我总是将单元测试存储在 HDD 上,因为我是公司中唯一真正关心它们的人,但我正在考虑在存储库中检查它们,以便在我的 CI 服务器中使用它们,并研究代码覆盖率,所以我想知道......您在哪里可以找到更好地存储在 SVN 存储库中的相应项目?与他们“涵盖”的项目一起,还是在他们自己的项目结构中?
想法 1:
Project A\trunk\Project A
Project A\trunk\Project A.Tests
想法 2:
Project A\trunk\Project A
Unit Tests\trunk\Project A.Tests
我看到了这两种可能性的优点和缺点,所以我只想得到一点小小的推动:P。
So far I've always stored my unit test on my HDD, as I'm the only one in the company to actually care about them, but I'm thinking of cheking them in the repository in order to use them in my CI server, and look into code coverage, so I'm wondering... where do you find the corresponding projects to be better stored in a SVN repository? along with the projects they "cover", or in their own project structure?
Idea 1:
Project A\trunk\Project A
Project A\trunk\Project A.Tests
Idea 2:
Project A\trunk\Project A
Unit Tests\trunk\Project A.Tests
I see their own pros and cons to both possibilities, so I just want to get a small push :P.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
测试是产品的一部分,但仅供您的公司使用。您应该签入它们并对它们进行版本控制。
我建议第一个选项,因为测试被视为项目 A 的一部分,而不是单独的东西。
另外,通过签入它们,如果其他人访问此代码,那么他们就可以看到它,因此您可以让他们查看测试,即使他们从未编写任何代码,他们也可以使用它们来验证他们所做的事情没有损坏任何东西。 如果有的话,这是进行测试的最重要原因。
Tests are part of the product but only used by your company. You should check them in and version control them.
I suggest the first option as then the tests as seen as part of project A and not as something separate.
Also by checking them in, if other access this code, then they get to see it and thus you get them looking at tests, even if they never write any, they can use them to verify that the stuff they've done hasn't broken anything. If anything this is the most important reason for having the tests.