Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the current state of BDD in C++?

Tags:

c++

tdd

bdd

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?

like image 907
Corey D Avatar asked Sep 16 '11 13:09

Corey D


Video Answer


1 Answers

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.

like image 128
Joakim Karlsson Avatar answered Nov 09 '22 21:11

Joakim Karlsson