Home Page Icon
Home Page
Table of Contents for
Chapter 5: Test Doubles
Close
Chapter 5: Test Doubles
by Jeff Langr
Modern C++ Programming with Test-Driven Development
Modern C++ Programming with Test-Driven Development
For the Best Reading Experience...
Table of Contents
Early Praise for Modern C++ Programming with Test-Driven Development
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
Chapter 1: Global Setup
Setup
The Examples
C++ Compiler
CMake
Google Mock
CppUTest
libcurl
JsonCpp
rlog
Boost
Building Examples and Running Tests
Teardown
Chapter 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
Chapter 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
Chapter 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
Chapter 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
Chapter 6: Incremental Design
Setup
Simple Design
Where Is the Up-Front Design?
Refactoring Inhibitors
Teardown
Chapter 7: Quality Tests
Setup
Tests Come FIRST
One Assert per Test
Test Abstraction
Teardown
Chapter 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
Chapter 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
Chapter 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
Chapter 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
Appendix 1: Comparing Unit Testing Tools
Setup
TDD Unit Testing Tool Features
Notes on Google Mock
Notes on CppUTest
Other Unit Testing Frameworks
Teardown
Appendix 2: Code Kata: Roman Numeral Converter
Setup
Let’s Go!
Practice Makes Perfect
Teardown
Appendix 3: Bibliography
You May Be Interested In…
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Teardown
Next
Next Chapter
Setup
Chapter 5
Test Doubles
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset