A practical guide to writing a simple testing framework and extending it to drive the design of your logging library
Key Features
- Learn to solve challenges of testing in C++ with a minimal solution
- Develop a logging library with enhancements.
- Drive code designs using tests
Book Description
Modern, standard C++ is all that is needed to create a small and practical testing framework that will improve the design of any other project. This allows a developer to first think about how to code will be used which is the first step in designing intuitive interfaces. And it continues adding value when designs need to change by ensuring that the changes don't break existing tests.
In this book, developers working with Test Driven Development (TDD) will be able to put their knowledge to work with this practical guide to writing a simple testing framework and then using it to drive the design of a logging library. The book provides a hands-on approach to implementation and associated methodologies that will have you up-and-running, and productive in no time.
By the end of this book, the reader would know what TDD and testing in general is and as a bonus, would have a working logging library.
What you will learn
- How to develop using TDD
- Keeping the code for the system as error-free as possible
- Refactor and redesign the code with high confidence
- Communicate to the team what the requirements and the behaviors of the code are
- Understand the differences between unit tests and integration tests
- Use TDD to create a minimal viable testing framework
Who This Book Is For
This book is for C++ developers already familiar with and using C++ for daily tasks who want to get better. You don't need to be an expert but you should already know some modern C++ and how to use templates to get the most out of this book.
Table of Contents
- Desired test declaration
- What should test results look like?
- The TDD process
- Adding tests to a project
- Adding More Confirm Types
- Explore Improvements Early
- Test setup and teardown
- What makes a good test?
- Using tests to drive code design of a logging library
- The TDD Process In Depth
- How to manage dependencies
- Creating better test assertions
- How to test floating point values
- Mocking dependencies
- Testing across multiple threads