自动生成 .NET 单元测试 [英] Auto-generation of .NET unit tests

查看:20
本文介绍了自动生成 .NET 单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在单元测试生成之类的东西?如果是这样……

Is there such a thing as unit test generation? If so...

...效果好吗?

...可用于 .NET 的自动生成解决方案有哪些?

...What are the auto generation solutions that are available for .NET?

...有使用这种技术的例子吗?

...are there examples of using a technology like this?

...这仅适用于某些类型的应用程序,还是可以用来替代所有手动编写的单元测试?

...is this only good for certain types of applications, or could it be used to replace all manually written unit testing?

推荐答案

看看 Pex.它是微软研究项目.来自网站:

Take a look at Pex. Its a Microsoft Research project. From the website:

Pex 通过基于动态符号执行的自动探索性测试从手写参数化单元测试生成单元测试.

如评论中所述,Pex 现在称为 IntelliTest 是 Visual Studio 企业版的一项功能.它支持以 MSTest、MSTest V2、NUnit 和 xUnit 格式发出测试,并且具有可扩展性,因此您可以将其与其他单元测试框架一起使用.

As mentioned in the comments, Pex is now called IntelliTest and is a feature of Visual Studio Enterprise Edition. It supports emitting tests in MSTest, MSTest V2, NUnit, and xUnit format and it is extensible so you can use it with other unit test frameworks.

但请注意以下注意事项:

But be aware of the following caveats:

  • 仅支持面向 .NET Framework 的 C# 代码.
  • 不支持 x64 配置.
  • 在 Visual Studio 中可用仅限企业版

这篇关于自动生成 .NET 单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆