Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Test-Driven Development with C++
  • Table Of Contents Toc
Test-Driven Development with C++

Test-Driven Development with C++

By : Abdul Wahid Tanner
4.5 (2)
close
close
Test-Driven Development with C++

Test-Driven Development with C++

4.5 (2)
By: Abdul Wahid Tanner

Overview of this book

Modern, standard C++ is all that is needed to create a small and practical testing framework that will improve the design of any project. This allows you to think about how the code will be used, which is the first step in designing intuitive interfaces. TDD is a modern balanced software development approach that helps to create maintainable applications, provide modularity in design, and write minimal code that drastically reduces defects. With the help of this book, you'll be able to continue adding value when designs need to change by ensuring that the changes don't break existing tests. In this book, you will use test-driven development (TDD) to gain practical skills by writing a simple testing framework and then using it to drive the design of a logging library. The book will help you enhance your software development skills with test cases. You'll understand how to design and implement test cases. The chapters will also show you how to utilize the TDD approach to be more productive in software development than attempting to code in large unstructured steps. By the end of this book, you'll have gained knowledge of TDD and testing and also built a working logging library with unique features not found in other libraries.
Table of Contents (21 chapters)
close
close
1
Part 1: Testing MVP
10
Part 2: Using TDD to Create a Logging Library
14
Part 3: Extending the TDD Library to Support the Growing Needs of the Logging Library

Preface

Many years ago, I started avoiding cookbook-style books when I wanted to learn a new technology or develop a new skill. A book should guide us to understand fundamental ideas so we can adapt our learning to fit our needs. We should not get lost just because a recipe doesn’t match exactly what we want to accomplish.

I also tend to avoid books that are full of theory. You probably know what I mean. Instead of explaining how to use a technology, these books mention ideas with no exploration of putting the ideas into practice. Focusing on either one of these two tangents can leave the learning experience incomplete.

This book is different. Instead of giving you a few simple examples like a cookbook or droning on with rules and definitions, I’ll show you how to use tests to write software that does the following:

  • What users expect and with ease
  • Let’s you add new features without breaking what you’ve already done
  • Clearly communicates what the code does

We’re going to start from the beginning and build multiple projects. You’ll learn what a test is and how it can help by building an easy and natural way to write tests in C++. This is called Test-Driven Development (TDD) and you’ll be using TDD to develop the tools needed for your projects.

In order to get the most benefit from TDD, you’ll need a way to write and run tests. Some programming languages already support TDD while C++ needs extra tools and libraries to support tests. I could have simply explained how to use various TDD tools that already exist. That would be a cookbook approach because each existing solution is slightly different. By starting from the beginning and building what you’ll need, you’ll learn TDD and at the same time you’ll learn how all the other solutions work. The concepts are the same.

For example, most people who learn how to drive a car will be able to drive a pickup truck or a van. Some minor differences are expected but the concepts are the same. Riding a motorcycle is more of a challenge but many of the same concepts are still valid. Driving a bus might need some extra training but is also similar.

If you decide to use other tools or even other languages, you’ll gain a deep understanding of how those other tools work by following the steps in this book. The other tools will be like driving a pickup truck.

This book is divided into three parts. You’ll build a testing library in the first part that will let you write and run tests. You’ll learn how to proceed one step at a time and let the tests guide you.

The second part will use the testing library to start a new project to help you log messages as your software runs. This is a logging library and this project will show you how to build software that meets the needs of your intended customer. You’ll be adding many features to the logging library and you’ll learn how to keep everything working while developing more features.

The intended customer for the logging library is a C++ micro-services developer and this customer focus extends into the third part where you’ll extend the testing library and build a simple service. The service will be used to explain one of the most difficult aspects of software development how to test multiple threads.

All three parts will combine to show you how to use TDD to effectively design and write software that meets the customers needs, gives you the confidence to make changes, and lets other team members understand the design.

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Test-Driven Development with C++
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon