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.

  • Jan 27
    Queen Elizabeth II Centre
    1 day
    08:00 - 16:00 UTC
    Kevlin Henney
    790 GBP

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 unit test good? It's 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#, JavaScript and TypeScript.

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

Kevlin Henney
Programming · Patterns · Practice · Process

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.

    NDC Conferences uses cookies to see how you use our website. We also have embeds from YouTube and Vimeo. How do you feel about that?