Testing C++ Applications: From Unit Tests to Integration Testing
Testing C++ Applications: From Unit Tests to Integration Testing
Summary:
The book "Testing C++ Applications" is a comprehensive guide to all aspects of software testing in the C++ language. The author, Andrey Volkov, an experienced developer and software architect, shares practical knowledge accumulated over 15 years of working on high-load projects. This book will become an indispensable assistant for every C++ developer striving to write reliable, maintainable, and secure code.
Who is this book for?
- Beginning C++ developers who want to learn the basics of testing and incorporate it into their workflow.
- Experienced programmers looking to deepen their knowledge in unit testing, mocking, and integration tests.
- Team leads and architects responsible for code quality in C++ projects.
- Technical students studying modern development methodologies.
What will you learn from the book?
- Fundamentals of unit testing: how to write simple, clear, and effective tests using the Google Test and Catch2 frameworks.
- Advanced techniques: parameterized tests, fixtures, assertion macros, and exception testing.
- The art of mocking and stubbing: how to isolate tested code from external dependencies (databases, network, file system) using the FakeIt, Trompeloeil, and Google Mock libraries.
- The TDD (Test-Driven Development) methodology: a step-by-step guide to test-driven development, including refactoring and design.
- Integration testing: verifying module interaction, API testing, working with databases and network protocols.
- Testing legacy code: strategies for introducing tests into an existing project, working with non-injectable dependencies and global state.
- Continuous Integration (CI): setting up automatic test execution in Jenkins, GitLab CI, and GitHub Actions.
- Code coverage measurement: using gcov, lcov, and other tools to analyze test quality.
The book contains numerous real code examples, ready to use in your projects. You will learn not only how to write tests but also how to design architecture that is convenient for testing. Separate chapters are dedicated to testing multithreaded applications, working with time and randomness, as well as performance testing.
"Testing C++ Applications" is not just a collection of recipes, but a systematic guide that will help you change your approach to development and make your code truly high-quality. Start writing reliable C++ today!