15
How to Test With Multiple Threads
Multi-threading is one of the most difficult aspects of writing software. Something that’s often overlooked is how we can test multiple threads. And can we use TDD to help design software that uses multiple threads? Yes, TDD can help and you’ll find useful and practical guidance in this chapter that will show you how to use TDD with multiple threads.
The main topics in this chapter are as follows:
- 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
First, we’ll examine what problems you’ll find when ...
Get Test-Driven Development with C++ now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.