Accelerated TDD: For More Productive C++

“Accelerated TDD: For More Productive C++” is available as either a one-day or two-day training course with programming exercises taught by Phil Nash. It is offered at the Meydenbauer Conference Center from 9AM to 5PM either on Saturday, September 29th, or on Saturday and Sunday, September 29th and 30th (immediately after the conference). Lunch is included.

Course Description

We all know that writing tests for our code is “what we should do”, and maybe we’re even doing that already. But it feels like extra busy-work that slows us down – and they hardly ever catch any bugs anyway…

Maybe we’ve even tried TDD, and felt that it was just adding even more ceremony to the problem with no real advantages.

But the advantages are definitely there! We just need a good grounding in what TDD _actually_ is (and isn’t) and how to do it properly – especially in the context of C++, which brings it’s own idiosyncrasies and bottlenecks to the matter.

That’s what this workshop aims to be. Whether you’ve never written a test before, or you’ve had some mileage with TDD already, be prepared to ratchet up your productivity by thinking about things in new ways and gaining more approaches to breaking down problems in sustainable ways.

Prerequisites

  • Be comfortable with the basics of C++. Being an expert not required
  • A laptop with a reasonably modern OS.
  • A compiler capable of running C++11 (ideally gcc, clang or VC++) – don’t worry if it’s not what you use in your day job.
  • A development environment you’re comfortable with. I can provide short term CLion licenses if you’d like (please let me know beforehand if possible)
  • An open mind and motivation to find better ways of doing things.

Course Topics

  • First Day
    • Why “Accelerated”?
    • Why test?
      • What is a test?
      • Type of test (unit, integration, system, regression, acceptance…)
      • Roles of a test
      • How testing makes us go faster
    • Why test first?
      • Coverage = Courage
      • Design pressures
      • Mental modes
      • Focus and flow
      • Never more than 5 mins from green
    • How to TDD
      • The TDD Cycle
      • The Art and Craft of TDD
      • Are we done yet?
    • Relevant Design Principles
      • Separation of Concerns
      • Single Responsibility
      • Cohesion
      • Low/ Loose Coupling
      • SOLID?
    • Growing Software, Guided By Tests
      • Putting it all together
      • Treat test code like production code
      • Negative paths
      • Avoiding brittle tests
      • Pruning tests
      • Dependent Tests
      • Tests as documentation
  • Second Day
    • Decelerated TDD
      • Slowing down to speed up
      • Deliberate Practice
    • Pain points and Limitations
      • Slow running tests
      • Flakey Tests
      • Brittle tests revisited
      • Testing the implementation
      • Orthogonal concerns (e.g logging. error handling)
      • Premature Generalisation
      • Beware a false sense of security
      • Getting legacy code under test
      • Getting team buy-in
      • The Transformation Priority Premise
    • Beyond TDD
      • BDD
      • ATDD
      • Property based Testing
      • Mutation Testing
      • Fuzz Testing
      • Treat test code like production code, except when you shouldn’t
      • Mocking
      • Risk Planes
    • Next Steps
      • Keeping the momentum going
      • Pairing
      • Forming habits

As well as some smaller throw away demos we’ll work through a complete, small, application in the course of covering this material.

Course Instructor

Phil Nash

Phil Nash is the author of the test frameworks, Catch – for C++ (and Objective-C), and Swordfish for Swift. As Developer Advocate at JetBrains he’s involved with CLion, AppCode and ReSharper C++. He’s previously worked in Finance and Mobile as well as an independent consultant and coach specialising in TDD on iOS.