分支包含单元测试和源代码控制结构的解决方案?
以下是 TFS 2010 中的源代码控制结构示例:
TFS Project
Development
Branches
Source
Tests
在源目录下,我为数据访问层创建了一个目录。该解决方案目前不依赖于其自身解决方案之外的任何其他项目。我这样做是为了我可以只分支这个代码。我想避免对整个源文件夹进行分支。
我个人喜欢将单元测试作为解决方案的一部分,这样我就可以轻松地针对代码创建和运行测试,而无需进入另一个解决方案。
如果我将单元测试项目放在与 DAL 解决方案相同的解决方案中,那么在没有单元测试项目依赖项的情况下对整个 DAL 进行分支的最佳方法是什么?我应该创建另一个没有分支单元测试的解决方案吗?在分支解决方案后,是否应该在分支中包含单元测试?
由于测试位于 Tests 文件夹中,因此无法在 TFS 中选择性地分支文件夹。
其他用户如何处理这个问题?
Here is an example of my source control structure in TFS 2010:
TFS Project
Development
Branches
Source
Tests
Under my Source directory I have created a directory for my Data Access Layer. The solution is currently not dependent on any other project outside its own solution. I did this so I could branch just this code. I wanted to avoid having to branch the entire Source folder.
I personally like having my unit tests as part of a solution so I can easily create and run tests against the code without having to go into another solution.
If I put my unit test projects in the same solution as my DAL solution, what is the best way to branch my entire DAL without the unit test project dependencies? Should I create another solution without unit Tests for branching? Should I include the unit tests in the branch after I branch the solution?
Since the Tests are located in the Tests folder, there isn't a way to selectively branch folders in TFS.
How do other users approach this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
单元测试还有助于充当代码的文档以及代码的行为方式和使用方法的示例。
因此,如果您要进行分支来更改代码的行为,我建议将单元测试与代码一起进行分支。这样您的文档和示例始终是最新的。
The unit tests also help to act as documentation for the code and examples of how it behaves and how to use it.
Therefore, if you're branching to change the code's behavior, I recommend branching the unit tests along with the code. That way your documentation and examples are always up to date.