Modern C++ Programming with Test-Driven Development
eBook - ePub

Modern C++ Programming with Test-Driven Development

Code Better, Sleep Better

  1. 366 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Modern C++ Programming with Test-Driven Development

Code Better, Sleep Better

About this book

This is the only comprehensive treatment on TDD in == C++ == that provides you with everything you need to know about TDD, and the challenges and benefits of implementing it in your == C++ == systems. Its many detailed code examples take you step-by-step from TDD basics to advanced concepts. As a veteran == C++ == programmer, you're already writing high-quality code, and you work hard to maintain code quality. It doesn't have to be that hard.

In this book, you'll learn:

  • how to use TDD to improve legacy == C++ == systems
  • how to identify and deal with troublesome system dependencies
  • how to do dependency injection, which is particularly tricky in == C++ ==
  • how to use testing tools for == C++ == that aid TDD
  • C++11 features that facilitate TDD

As you grow in TDD mastery, you'll discover how to keep a massive == C++ == system from becoming a design mess over time, as well as particular == C++ == trouble spots to avoid. You'll find out how to prevent your tests from being a maintenance burden and how to think in TDD without giving up your hard-won == C++ == skills. Finally, you'll see how to grow and sustain TDD in your team.

Whether you're a complete unit-testing novice or an experienced tester, this book will lead you to mastery of test-driven development in == C++ ==.

Q&A with Jeff Langr, author of Modern == C++ == Programming with Test-Driven Development

Why did you write Modern == C++ == Programming with Test-Driven Development?
I'd been working with a number of == C++ == development teams recently that were very interested in using test-driven development ( TDD ) to get their source under control and whip it into a better shape. I thought, "If any language needs a way to safely accommodate continual, incremental change, it's == C++ ==." There's a dearth of material written on TDD in == C++ ==, and I figure I'd see what I could do to help.

Aren't you being a bit bold with that book title?
Thanks for noticing. Sure, TDD isn't the only way to do things, but I believe it's the best technique we have in 2013 to help you succeed with programming, whether your language is == C++ == or something else. " Modern == C++ == " to me is about harnessing the great power of the language (including some nice, new C++11 features) with a mechanism that will allow you to do so safely and help you to craft a great design along the way.

If I already know TDD, what might I get out of this book?
I wanted Modern == C++ == Programming with Test-Driven Development to be the most up-to-date, comprehensive source of information on TDD. It covers just about everything you might expect, and adds a few up-to-date topics such as the Mikado Method and the Transformation Priority Premise ( TPP ). I incorporate my experiences throughout, so you'll get a bunch of hard-won wisdom based on having practiced TDD for over a dozen years. You'll also pick up some ideas for growing and sustaining TDD in your team.

Is the TDD material in the book book accessible to someone who isn't familiar with == C++ ==?
While there's plenty of code in the book, you should have no trouble following the examples if you've had any exposure to a C-based object-oriented language (such as Java, C#, or Objective-C). One of the goals in TDD is to structure your code to be expressive, and I strove to ensure the code in the book met that goal. I focus on TDD concepts and techniques that you can apply equally well to other languages.

What if I use a different unit testing tool?
The exercises use a mix of Google Test/Google Mock and CppUTest. However, once you've seen a couple unit testing tools, you've seen them all—it's pretty easy to translate tests written in one tool into another (such as CppUnit, CxxTest, or Boost.Test). In the book, you'll find an appendix that gives you some criteria to help you choose an appropriate unit testing tool for your team.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Modern C++ Programming with Test-Driven Development by Jeff Langr in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in C++. We have over one million books available in our catalogue for you to explore.

Table of contents

  1. Modern C++ Programming with Test-Driven Development
  2. Table of Contents
  3. Early Praise for ​ Modern C++ Programming with Test-Driven Development ​
  4. Foreword
  5. Introduction
  6. Chapter 1: Global Setup
  7. Chapter 2: Test-Driven Development: A First Example
  8. Chapter 3: Test-Driven Development Foundations
  9. Chapter 4: Test Construction
  10. Chapter 5: Test Doubles
  11. Chapter 6: Incremental Design
  12. Chapter 7: Quality Tests
  13. Chapter 8: Legacy Challenges
  14. Chapter 9: TDD and Threading
  15. Chapter 10: Additional TDD Concepts and Discussions
  16. Chapter 11: Growing and Sustaining TDD
  17. Appendix 1: Comparing Unit Testing Tools
  18. Appendix 2: Code Kata: Roman Numeral Converter
  19. Appendix 3: Bibliography