TDD in C++

162 views
Skip to first unread message

Andrew O'Neill

unread,
Nov 13, 2014, 11:35:15 AM11/13/14
to clean-code...@googlegroups.com
Hello all,

In an effort to learn TDD and improve my C++ and unix skills, I'm starting a small personal project. I understand a lot of C++ develop with an IDE like VisualStudio or NetBeans, but I am a longtime vim user and would prefer to avoid IDEs in this case. I started the project by making a simple makefile, but it quickly became unwieldy and tedious to maintain.

My questions are as follows: 

- Project recommendations:
  - Project layout (directory structure, etc.) ?
  - Build system?
  - Unit testing framework?
- Are there any solid examples of non-IDE, unit tested C++ projects like this online?
- Do any of you have experience using vim as part of their test-code-refactor cycle?

Any thoughts or ideas are much appreciated.

Thanks!
Andrew

Edson Chavez

unread,
Nov 13, 2014, 3:54:49 PM11/13/14
to clean-code...@googlegroups.com
Hello, after a quick search on google, maybe you want try this

maven nar plugin

Regards

--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
Visit this group at http://groups.google.com/group/clean-code-discussion.

Philip Markgraf

unread,
Nov 13, 2014, 4:11:00 PM11/13/14
to clean-code...@googlegroups.com
My team is IDE centric and is about to change its build system, so I won’t talk to most of the questions… but I can touch on the question of frameworks...

My team uses GoogleTest, which has pretty extensive capabilities (like testing exceptions and exit) and an associated mocking framework. After having used the mocking for a while, we have shifted to primarily build-your-own test doubles and only use GoogleMock when we need some fairly complex results matching. (Bob talks about this approach in his video on mocking, so we’re not out on an island with this.)

Cheers,
Phil

P.S. My team has a couple of openings. We do Extreme Programming (with TDD, pairing and all that fun stuff) to create safety critical medical devices. It is a great team and fun environment set in Southern California and we use C++ and Lua as our languages of choice. Send me a note privately if any of this appeals!



Chilon Sage

unread,
Nov 28, 2014, 10:12:14 AM11/28/14
to clean-code...@googlegroups.com
Hi,
One widely used build system for C/C++ is cmake.

It can generate Unix Makefiles, Visual Studio projects, XCode projects etc.
So you can use it with vi if you want. I personally use it with QtCreator under Linux and Visual Studio under Windows.

unclebob

unread,
Nov 30, 2014, 7:26:10 AM11/30/14
to clean-code...@googlegroups.com
I've had a lot of success using CPPUTest with TextMate.  I presume it would work just as well with VIM.  It's very easy to set up, and will force you to design your code so that your compile/link times remain very small.  
Reply all
Reply to author
Forward
0 new messages