Cucumber/Rspec:有没有办法从现有代码中提取测试?
我要开始学习 cucumber/rspec。
我在rails3/mysql和rails3/mongoid中没有任何应用程序,我在没有任何测试的情况下编写了:-(
应该想知道我是否可以有一个“cucumber/rspec”生成器,它可以提取黄瓜的场景和“步骤定义”,就像rspec 的行为。一种逆向工程代码生成器,它从现有控制器/模型/视图中提取测试。
是否建议使用其他方法将旧的错误代码与未来的良好实践测试相结合?
您 之外/内部,但是,如何清理数千行旧代码?
在 BDD开发 卢卡·G·索阿夫
I'm going to begin learning cucumber/rspec.
I've few application in rails3/mysql and rails3/mongoid which I wrote without any test :-(
Should be wonder if I could have a "cucumber/rspec" generator which could extract scenario and "step definition" for cucumber, just like behaviors for rspec. A kind of reverse engineering code generator, which extract tests from existing controllers/models/views.
Do you suggest any other approach for having old buggy code alligned to the future well practice testing ?
I know this completely broke the vantage of outside/in BDD development but, how to sanitize thousand of lines of old code ?
Thanks in advance
Luca G. Soave
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果测试可以自动生成,我们一开始就不需要它们,不是吗?
以下是在时间有限时处理未经测试的遗留应用程序的方法:
一段时间后,您将为您的应用程序提供足够好的测试覆盖率。
祝你好运。
If tests could be auto-generated, we wouldn't need them in the first place, would we?
Here's how to deal with untested legacy application when your time is limited:
After a while you will have nice enough test coverage for your application.
Good luck.