Test Driven Development (TDD) with Google C++ Testing Framework and Visual Studio (I)

Test Driven Development has become one of the most important and known paradigms in software development.  We could say that is part of the Agile methodologies that are changing the traditional Waterfall way of work.  But, what exactly TDD is?

If we summarize in a few words, we could say that TDD is just write first the test, and then write the code. That’s it.  At the beginning it might seem a bit strange and you have to change the way you think when you are about to write a routine or a new class, but it has a lot of benefits that worth it:

  • Ensures quality from the start. If you have any bug, the test will fail at first attempt.
  • Maintains clean your modules of unused code.
  • Provides regression testing. If you change a piece of code, you can be sure that it will not affect to any other functionality.
  • Produces simpler and more focused APIs, classes and libraries. When you are developing a method that has to pass a specific test, you avoid the temptation of mess up your method with a different functionality.
  • It’s much easier to match the code and business requirements.

There are a lot of different frameworks to implement Unit Testing and start to practice with TDD. Here you can find a huge list.

In this series of post for C++ language, I’m going to focus on the Google C++ Testing Framework. It’s been developed by Google and I find it quite simple and useful.  In the next post we will explain how to use it and in subsequent posts I’ll try to explain other frameworks for .NET.

Stay tuned!

Advertisements

4 thoughts on “Test Driven Development (TDD) with Google C++ Testing Framework and Visual Studio (I)

  1. caveda says:

    Great topic to write about! Keep going!

  2. Manu says:

    I’m looking forward to reading more!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: