Table of Contents

Foreword
Introduction
But Can It Work for Me on My System?
Who This Book Is For
What You’ll Need
How to Use This Book
About “Us”
About Me
About the C++ Style in This Book
Acknowledgments
Dedication
1. Global Setup
Setup
The Examples
C++ Compiler
CMake
Google Mock
CppUTest
libcurl
JsonCpp
rlog
Boost
Building Examples and Running Tests
Teardown
2. Test-Driven Development: A First Example
Setup
The Soundex Class
Getting Started
Fixing Unclean Code
Incrementalism
Fixtures and Setup
Thinking and TDD
Test-Driving vs. Testing
What If?
One Thing at a Time
Limiting Length
Dropping Vowels
Doing What It Takes to Clarify Tests
Testing Outside the Box
Back on Track
Refactoring to Single-Responsibility Functions
Finishing Up
What Tests Are We Missing?
Our Solution
The Soundex Class
Teardown
3. Test-Driven Development Foundations
Setup
Unit Test and TDD Fundamentals
The TDD Cycle: Red-Green-Refactor
The Three Rules of TDD
Getting Green on Red
Mind-Sets for Successful Adoption of TDD
Mechanics for Success
Teardown
4. Test Construction
Setup
Organization
Fast Tests, Slow Tests, Filters, and Suites
Assertions
Inspecting Privates
Testing vs. Test-Driving: Parameterized Tests and Other Toys
Teardown
5. Test Doubles
Setup
Dependency Challenges
Test Doubles
A Hand-Crafted Test Double
Improving Test Abstraction When Using Test Doubles
Using Mock Tools
Getting Test Doubles in Place
Design Will Change
Strategies for Using Test Doubles
Miscellaneous Test Double Topics
Teardown
6. Incremental Design
Setup
Simple Design
Where Is the Up-Front Design?
Refactoring Inhibitors
Teardown
7. Quality Tests
Setup
Tests Come FIRST
One Assert per Test
Test Abstraction
Teardown
8. Legacy Challenges
Setup
Legacy Code
Themes
The Legacy Application
A Test-Driven Mentality
Safe Refactoring to Support Testing
Adding Tests to Characterize Existing Behavior
Sidetracked by the Reality of Legacy Code
Creating a Test Double for rlog
Test-Driving Changes
A New Story
A Brief Exploration in Seeking Faster Tests
Mondo Extracto
Spying to Sense Using a Member Variable
Spying to Sense Using a Mock
Alternate Injection Techniques
Large-Scale Change with the Mikado Method
An Overview of the Mikado Method
Moving a Method via Mikado
More Thoughts on the Mikado Method
Is It Worth It?
Teardown
9. TDD and Threading
Setup
Core Concepts for Test-Driving Threads
The GeoServer
Performance Requirements
Designing an Asynchronous Solution
Still Simply Test-Driving
Ready for a Thready!
Exposing Concurrency Issues
Creating Client Threads in the Test
Creating Multiple Threads in the ThreadPool
Back to the GeoServer
Teardown
10. Additional TDD Concepts and Discussions
Setup
TDD and Performance
Unit Tests, Integration Tests, and Acceptance Tests
The Transformation Priority Premise
Writing Assertions First
Teardown
11. Growing and Sustaining TDD
Setup
Explaining TDD to Nontechies
The Bad Test Death Spiral, aka the SCUMmy Cycle
Pair Programming
Katas and Dojos
Using the Code Coverage Metric Effectively
Continuous Integration
Deriving Team Standards for TDD
Keeping Up with the Community
Teardown
A1. Comparing Unit Testing Tools
Setup
TDD Unit Testing Tool Features
Notes on Google Mock
Notes on CppUTest
Other Unit Testing Frameworks
Teardown
A2. Code Kata: Roman Numeral Converter
Setup
Let’s Go!
Practice Makes Perfect
Teardown
A3. Bibliography
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.89.2