自动创建junit [英] Create junit automatically

查看:121
本文介绍了自动创建junit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法我不需要编写junit测试用例并且它会自动生成。

Is there any way that i need not write junit test cases and it gets generated automatically.

实际上我的应用程序已经过全面测试但没有写入junit为了它。所以我确信它是完整的并且没有太多错误。但我的客户想要一个相同的代码覆盖率报告。

Actually i have an application which is fully tested but has no junit written for it. So i am sure that it is complete and has not much error. But my client wants a code coverage report for the same.

是否有可用的工具可以自动生成测试用例。

Is there any tool available which can generate test cases automatically.

我正在使用java,jboss portal。

I am using java, jboss portal.

推荐答案

为了写作或覆盖而编写单元测试是一个坏主意。应编写单元测试以实际测试您的代码。在您的情况下,您可以先开始为更重要的类编写测试,然后逐步增加代码覆盖率。你甚至可能在这个过程中发现一些真正的错误。

Writing the unit tests for the sake of writing or for coverage is a bad idea. Unit tests should be written to actually test your code. In your situation you could start writing the tests for the more important classes first and then gradually work towards increasing the code coverage. You might even find some real bugs in this process.

这篇关于自动创建junit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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