C++ 中的 BDD 目前状态如何?
所以我发现了一些关于 C++ BDD 框架的较旧问题。 CppSpec 被推荐作为 BDD 风格的框架,但该框架远不如 RSpec 优雅甚至谷歌测试。
我还看到提到一篇详细介绍 使用 Ruby 和 RSpec 对 C 和 C++ 进行单元测试 听起来非常有趣。然而,文章指出,在 C++ 中使用此方法有很多限制。这情况有好转了吗?如果不使用 Ruby,SWIG 是否能更好地连接 C++ 和 Python?我可以附加一些像黄瓜这样的东西吗?
我想到的最后一件事是将 googlemock 与 googletest (我已经使用了一些进行单元测试),尽管它看起来仍然不像使用那样优雅或快速Ruby 或 Python BDD 框架。
我认为让 BDD/TDD 发挥作用的关键是编写测试应该快速且轻松。我正在尝试在工作中介绍这些和其他开发方法,并且我可能需要让人们相信编写测试可以是简短、甜蜜且容易的。
更新 我刚刚发现 Kross,它可能会很好用,因为该应用程序使用 Qt 和目标是 Linux 环境。这可能比 SWIG 更容易/更好吗?
So I found a few older questions asking about BDD frameworks for C++. CppSpec was recommended as a BDD-style framework, but the framework is not nearly as elegant as RSpec or even googletest.
I also saw mentioning of an article detailing Unit Testing C and C++ with Ruby and RSpec which sounded really interesting. However, the article states that there are a lot of limitations with using this method with C++. Has this gotten any better? If not with Ruby, has SWIG become better at interfacing C++ and Python? Could I then attach something like Cucumber?
The last thing that occurred to me was to use googlemock together with googletest (which I'm already using some for unit testing), though it still doesn't seem as elegant or quick as using Ruby or Python BDD frameworks.
I think the key to making BDD/TDD work is that writing tests should be quick and painless. I'm trying to introduce these and other development methods at work and I may need to convince people that writing tests can be short, sweet, and easy.
Update
I just found out about Kross, which might work well because the application uses Qt and targets a Linux environment. Could this potentially be easier/better than SWIG?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您看过 Igloo 吗?
我们没有像 googletest 这样多的功能,但我们创建它的目的是让您不必重复自己,并且我们从 RSpec 和 NUnit 中获得了一些灵感,并尝试创建一些令人愉快的东西。
免责声明:如果还不是很明显的话,我是 Igloo 背后的开发人员之一。
Have you taken a look att Igloo?
We don't have nearly as many features as for instance googletest, but we created it with the intention that you shouldn't have to repeat yourself, and we took some inspiration from RSpec and NUnit, and tried to create something pleasant.
Disclaimer: If it's not obvious already, I'm one of the developers behind Igloo.