Test-Driven Development

  • 2-3 Days
  • Intermediate
  • Virtual | Classroom
  • £ On Request

Learn the many virtues of writing tests early and often

Book For My Team

Overview

Code that is not tested does not work. It’s a mantra that we all should live by and yet, for various reasons, surprisingly few of us actually do.

But there is so much more to upfront testing than verifying the functional correctness of your code. By paying close attention to the quality of your production and test code you will learn the non-functional benefits of more cohesive, maintainable, readable, modifiable and bug free source code.

So while this course is largely about unit testing and refactoring, it is mostly about design and its purpose is to radically alter how you think about and approach design. We believe that by the end of this course you will not only be more productive, you will also be creating more maintainable and understandable designs.

Outline

Testing Fundamentals

  • Programmer testing vs debugging
  • Cost and quality
  • White-box and Black-box testing
  • Unit Testing
  • Testing behaviour, not methods
  • The xUnit/TestNG family
  • Test cases, suites, runners, and fixtures
  • Assertions/hamcrest
  • IDE tooling

Factoring and Refactoring

  • Intention revealing code
  • Understanding test and production code quality
  • Removing duplication and redundancy
  • Decomposition and delegation
  • Code smells
  • Common refactorings

Testing Single Objects

  • The red, green, refactor rhythm
  • Sufficient design
  • Faking it
  • Obvious implementation

Testability and Isolation

  • Loose coupling and high cohesion
  • Open Closed Principle
  • Strategies, Templates and Decorators
  • Dependency Inversion
  • Dependency Management

Testing Clusters of Objects

  • Decoupling techniques; layering, facades, dependency injection
  • Interaction vs state based testing
  • Pragmatic testing – when and when not to mock
  • Static mocks vs dynamic mocks vs stubs
  • Designing with interfaces
  • Interface discovery through mocking
  • Anti-patterns; statics, globals and singletons

Miscellaneous

  • Understanding test quality – writing ‘Good Unit Tests’
  • Using DSLs to simplify tests
  • TDD vs design by contract
  • The truth about code coverage
  • Continuous integration
Garth Gilmour
Google Developer ExpertGoogle Developer Expert

25 years coding and educating. 1000+ deliveries of (almost) everything to everyone.

Follow Garth
Eamonn Boyle

Programming junky with 20 years professional experience. Happiest when helping others code.

Follow Eamonn
Ryan Adams

Used to make software for learning as a developer, now helping software makers learn.

Follow Ryan
For a breakdown of what to expect in our training, check out our training overview page.

Great course. The instructors were highly knowledgeable as well as clear in their explanations. I'd previously struggled with some of the concepts when explained by others yet I came out of the course feeling like I understood the concepts. The introduction of various developer tools to assist with actually implementing these concepts was highly valuable, demonstrations of technologies such as NUnit, Jasmine, Moq and ReSharper for example. A lot of other courses would simply try to explain the core fundamentals, leaving you with no real idea of how to practically implement those concepts. I'd absolutely recommend this course (and INSTIL in general) to anyone.

Very thorough course on TDD. Delivered with enthusiasm and real industry knowledge at a good pace. A comprehensive mix of introductory and advanced topics. The extensive exercises helped drive home the course content

Great course. Great lecturer. Learned a lot of new development methods and was able to run these in my own system. Look forward to adding TDD to my future projects

Excellent course, delivered with very easy to follow examples and real passion for the subject matter.

Deloitte logo
Atlassian logo
Workday logo
BMW logo
Amex logo
McAfee logo
PWC logo