有谁知道有一个可以自动生成单元测试存根的工具吗?
我正在编写一个 winforms 应用程序,最终我想从 DAL 和 Biz 对象层等为该应用程序编写单元测试。
有人知道有一个免费工具可以接收程序集的路径,然后使用以下命令输出单元测试存根吗匹配程序集的签名。
任何可配置的选项,如“仅公共接口”、“测试框架选择”、“语言选择”都将是一个优点。
我至少需要这个工具来针对 nunit 发出 vb.net 。
谢谢。
赛斯
I am writing a winforms application and eventually I would like to write unit test for this application from the DAL, and Biz Objects layers etc.
Does someone know of a FREE tool that can recieve the path to an assembly and then output unit test stubs with matching signatures for the assembly.
Any configurable options like "public interfaces only", "test framework choice", "language choice" would be a plus.
I at least would need this tool to emit vb.net against nunit.
Thanks.
Seth
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
最后我听说,推荐的单元测试方法是在以测试优先的方式开发功能时编写它们。在我看来,自动生成单元测试存根只会导致一大堆未实现的单元测试,这些测试不会增加任何价值,并且很可能具有非常糟糕的通用名称,无法描述正在测试的行为。
另一方面,也许我只是误解了你的问题......
Last I heard, the recommended method of unit testing was to write them as you develop the functionality in a test first style. Auto-generating unit test stubs, in my mind, would just result in a whole bunch of unimplemented unit tests which add no value and will most likely have very awful generic names that don't describe the behavior being tested.
On the other hand, maybe I'm just misunderstanding your question...
查看来自 Microsoft Research 的 Pex。
Take a look at Pex from Microsoft Research.
VS2008 中构建的 MS 单元测试可以代表您创建存根(使用反射)。
我发现它在大多数情况下非常有用。
MS Unit test build into VS2008 can create stubs (using Reflection) in your behalf.
I found it very useful in most cases.
有一个名为 Pex 的工具,它不仅制作存根,同时也为您填写测试。还有一个 在线视频。
编辑:马克·西曼(Mark Seemann)打败了我!希望这些链接仍然有用。
There is a tool called Pex that not only makes the stubs, but also fills in tests for you. There's also a video online.
edit: Mark Seemann beat me to it! Hopefully the links are still useful.