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

查看:28
本文介绍了.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.

但请注意以下警告:

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

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

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