简体   繁体   English

自动测试.NET(Gallio?)

[英]Automated testing .NET (Gallio?)

I am working on a software development project that uses code written primarily in C and C#. 我正在开发一个软件开发项目,该项目使用主要用C和C#编写的代码。 Currently, the responsibility of testing falls mostly on developers as they change the code. 目前,测试的责任主要落在开发人员更改代码上。

I am interested in implementing an automated testing framework to help us improve the quality of our code. 我有兴趣实现自动化测试框架,以帮助我们提高代码质量。 In particular, it would be great to have automated testing that ran every time code was submitted to version control. 特别是,每次将代码提交到版本控制时都会运行自动化测试。

I do not have much experience with automated testing (or unit testing for that matter). 我对自动化测试(或单元测试)的经验不多。 Has anyone done development using a testing framework for C/C#, and if so, what might be some hurdles we would face to implement it company-wide and on a rather large existing code base? 有没有人使用C / C#的测试框架进行开发,如果是这样,我们在整个公司范围内以及在相当大的现有代码库上实现它可能会遇到什么障碍?

In particular, I have been looking at how Gallio might be used. 特别是,我一直在研究如何使用Gallio Any comments on this particular product would be appreciated. 对此特定产品的任何评论将不胜感激。

Additional Information : 附加信息

Adding unit tests to an existing project 将单元测试添加到现有项目
Unit Testing Legacy ASP.NET Webforms Applications 单元测试旧版ASP.NET Webforms应用程序
Moving existing code to Test Driven Development 将现有代码移至测试驱动开发
Favorite .NET Unit Testing framework 最喜欢的.NET单元测试框架

To be blunt, this sounds like you're looking for reasons not to do it. 坦率地说,这听起来像是在寻找不这样做的理由。 Just get NUnit and get going. 得到NUnit然后开始吧。 Start with the smallest piece to get your feet wet. 从最小的一块开始,让你的脚湿润。

Gallio is actually a framework for the entire testing toolchain. Gallio实际上是整个测试工具链的框架。 From writing the tests, to running them to post build processes. 从编写测试到运行它们到发布构建过程。 It provides common facilities and standardized interfaces for each step to allow greater choice and flexibility when putting a build process together. 它为每个步骤提供了通用工具和标准化接口,以便在将构建过程组合在一起时提供更多选择和灵活性。

It comes with a version of the MbUnit framework, which it uses by default. 它附带了MbUnit框架的一个版本,它默认使用它。 It also comes with a GUI runner named Icarus, and a console runner named Echo. 它还带有一个名为Icarus的GUI跑步者和一个名为Echo的控制台跑者。 They are all well respected tools in the testing community. 它们都是测试界备受推崇的工具。

It is an excellent choice for a large company, since it can allow you to take advantage of many of the popular testing and continuous integration tools with a minimum of integration headaches. 对于大型公司来说,它是一个很好的选择,因为它可以让您利用许多流行的测试和持续集成工具,同时最小化集成难题。

Picking a framework and writing tests is only half the battle, Gallio really does help with the other half; 挑选框架并编写测试只是成功的一半,Gallio确实帮助了另一半; gluing up all the other steps in the build process. 粘贴构建过程中的所有其他步骤。

The only real downside at the moment is the lack of a central repository of examples and information. 目前唯一真正的缺点是缺乏示例和信息的中央存储库。 For some, the fact that its a relatively new initiative may put them off using it right now. 对于一些人来说,这是一个相对较新的倡议,可能会让他们立即使用它。

Check out the docs here. 在这里查看文档。 They are a work in progress and very incomplete but will get you started on the basics of writing tests. 它们是一项正在进行中且非常不完整的工作,但它将帮助您开始编写测试的基础知识。 Keep your eyes on Jeff Browns Blog for other information. 请关注Jeff Browns博客以获取其他信息。

TestComplete was decent and easy to use when I used it (a couple of years ago). TestComplete在我使用它(几年前)时体面且易于使用。 At least then, you'd need to learn some VBScript. 至少那时,你需要学习一些VBScript。

We use TestComplete from AutomatedQA, and it's a decent platform for doing gui testing. 我们使用来自AutomatedQA的TestComplete,它是进行gui测试的一个不错的平台。 We do all of our TestComplete code in Jscript, which isn't great, but it gets the job done. 我们在Jscript中完成了所有TestComplete代码,这不是很好,但它完成了工作。 I'm not sure i'd recommend Automated GUI testing though, I think you'll get a much better return on unit testing. 我不确定我是否会推荐自动GUI测试,我认为你会获得更好的单元测试回报。

Nunit and rhino mock are great tools for unit testing. Nunit和rhino mock是单元测试的绝佳工具。

CruiseControl looks like the best way to set up automated testing on each build. CruiseControl看起来是在每个构建上设置自动化测试的最佳方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM