Home Page Icon
Home Page
Table of Contents for
Test-Driven Development with C++
Close
Test-Driven Development with C++
by Abdul Wahid Tanner
Test-Driven Development with C++
Test-Driven Development with C++
Contributors
About the author
About the reviewer
Preface
Part 1: Testing MVP
Chapter 1: Desired Test Declaration
Chapter 2: Test Results
Chapter 3: The TDD Process
Chapter 4: Adding Tests to a Project
Chapter 5: Adding More Confirm Types
Chapter 6: Explore Improvements Early
Chapter 7: Test Setup and Teardown
Chapter 8: What Makes a Good Test?
Part 2: Using TDD to Create a Logging Library
Chapter 9: Using Tests
Chapter 10: The TDD Process in Depth
Chapter 11: Managing Dependencies
Part 3: Extending the TDD Library to Support the Growing Needs of the Logging Library
Chapter 12: Creating Better Test Confirmations
Chapter 13: How to Test Floating-Point and Custom Values
Chapter 14: How to Test Services
Chapter 15: How to Test With Multiple Threads
Index
Other Books You May Enjoy
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
Test-Driven Development with C++
Next
Next Chapter
Preface
Table of Contents
Preface
Part 1: Testing MVP
1
Desired Test Declaration
Technical requirements
What do we want tests to do for us?
What should a test look like?
What information does a test need?
How can we use C++ to write tests?
How will the first test be used?
Summary
2
Test Results
Technical requirements
Reporting a single test result
Enhancing the test declaration to support multiple tests
Summarizing the results
Redirecting the output results
Summary
3
The TDD Process
Technical requirements
Build failures come first
Do only what is needed to pass
Enhancing a test and getting another pass
Summary
4
Adding Tests to a Project
Technical requirements
How to detect whether a test passes or fails
Enhancing the testing library to support assertions
Should error cases be tested, too?
Summary
5
Adding More Confirm Types
Technical requirements
Fixing the bool confirms
Confirming equality
Decoupling test failures from line numbers
Adding more confirm types
Confirming string literals
Confirming floating point values
How to write confirms
Summary
6
Explore Improvements Early
Technical requirements
Getting line numbers without macros
Exploring lambdas for tests
Summary
7
Test Setup and Teardown
Technical requirements
Supporting test setup and teardown
Enhancing test setup and teardown for multiple tests
Handling errors in setup and teardown
Summary
8
What Makes a Good Test?
Technical requirements
Making tests easy to understand
Keeping tests focused on specific scenarios
Use random behavior only in this way
Only test your project
Test what should happen instead of how
Summary
Part 2: Using TDD to Create a Logging Library
9
Using Tests
Technical requirements
Why build a logging library?
How will TDD help build a logging library?
What would the ideal logging library look like?
Starting a project using TDD
Logging and confirming the first message
Adding timestamps
Constructing log messages with streams
Summary
10
The TDD Process in Depth
Technical requirements
Finding gaps in the testing
Adding log levels
Adding default tag values
Exploring filtering options
Adding new tag types
Refactoring the tag design with TDD
Designing tests to filter log messages
Controlling what gets logged
Enhancing filtering for relative matches
When is testing too much?
How intrusive should tests be?
Where do integration or system tests go in TDD?
What about other types of tests?
Summary
11
Managing Dependencies
Technical requirements
Designing with dependencies
Adding multiple logging outputs
Summary
Part 3: Extending the TDD Library to Support the Growing Needs of the Logging Library
12
Creating Better Test Confirmations
Technical requirements
The problem with the current confirmations
Simplifying string confirmations
Enhancing the test library to support Hamcrest matchers
Adding more Hamcrest types
Summary
13
How to Test Floating-Point and Custom Values
Technical requirements
More precise floating-point comparisons
Adding floating-point Hamcrest matchers
Writing custom Hamcrest matchers
Summary
14
How to Test Services
Technical requirements
Service testing challenges
What can be tested in a service?
Introducing the SimpleService project
Summary
15
How to Test With Multiple Threads
Technical requirements
Using multiple threads in tests
Making the logging library thread-safe
The need to justify multiple threads
Changing the service return type
Making multiple service calls
How to test multiple threads without sleep
Fixing one last problem detected with logging
Summary
Index
Other Books You May Enjoy
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