Tuesday 

Room 6 

09:00 - 17:00 

(UTC+02

1 Day

Program with GUTs

One of the greatest shifts in modern programming practices has been how programmers across many different domains, languages and environments have embraced unit testing. Good unit testing, however, is more than having a unit-testing framework installed and running.

C++
C
Testing
Python
Technique

Tests help to make long-term product development cost effective rather than a cost centre, they underpin the effective flow of CI/CD and reduce failure demand on a team. But the discussion of unit testing goes further than simply doing it: what makes a good unit test? It is not enough to have tests; poor quality tests can hold back development just as good tests can streamline it.

This session looks at good unit tests (GUTs) and different testing workflows, from test-driven development (TDD) to refactoring-driven development, whether the code you are testing comes from the past, from a prompt or direct from your fingertips. Examples will be in C++, C and Python.

Agenda
• Kinds of tests
• Test-writing workflow: POUT, ITL, DDT, TDD and more
• What makes a unit test good?
• Common test smells and failure modes
• Tests as documentation and specification
• Given/When/Then and Arrange/Act/Assert test structure
• Aligning tests with domain concepts
• Data-driven tests
• Choices and checklists for test data
• Understanding (and misunderstanding) code coverage
• Structuring tests according to state models
• Grouping and nesting tests according to Given/When/Then
• Addressing brittle tests and long-term skipped tests
• Test strength: overfitting and underfitting tests
• Improving the design of your code by listening to your tests
• Dependency management and mocking
• Alternatives to mocking

Computer Setup
Attendees need to bring a laptop to this workshop. The hands-on part of the workshop uses a web environment, so no specific tooling needs to be installed.

Kevlin Henney

Kevlin is an independent consultant, trainer, speaker and writer. His development interests and work with companies covers programming, practice and people. He is a contributor to the Modern Software Engineering YouTube channel. Kevlin is also co-author of two volumes in the Pattern-Oriented Software Architecture series, editor of 97 Things Every Programmer Should Know, co-editor of 97 Things Every Java Programmer Should Know and former columnist for a number of magazines and sites.