Actions Panel
Live “Testing Without Mocks” Training - US/EUR - June 2023
Learn a new way to write tests that are fast, reliable, and support refactoring.
When and where
Date and time
June 6 · 8am - June 15 · 11am PDT
Location
Online
Refund Policy
About this event
- 9 days 3 hours
- Mobile eTicket
Schedule: Four three-hour sessions on June 6th, 8th, 13th, and 15th (Tuesdays and Thursdays). Each session is 8am-11am Pacific / 11am-2pm Eastern / 17:00-20:00 CEST plus an optional office hour.
Programmers need automated tests to avoid wasting huge amounts of time manually checking and fixing code. But automated tests also tend to waste a huge amount of time:
- Flaky tests fail randomly.
- End-to-end tests run slowly.
- Mock-heavy tests can be hard to understand, lock in implementation, or only test themselves.
People use design techniques such as Hexagonal Architecture to reduce these problems, but they require expensive architectural changes and often leave infrastructure untested. (Infrastructure is the code that talks to external systems or state.)
In this course, I'll show you another way. You'll learn how to write tests that are fast, reliable, fully test infrastructure, and don't require architectural changes. Better yet, they're 100% compatible with your existing code and tests. You can start using them immediately, even in a legacy codebase.
State-Based Tests using Nullables
The secret is a novel infrastructure pattern called Nullables. It’s part of my “Testing Without Mocks” pattern language, which focuses on creating narrow, sociable, state-based tests. (That's a fancy way of saying “simple tests that just run code and look at the results.” We'll dig into exactly what it means during the course.)
The “Nullables” pattern describes how to add an “off” switch to your existing infrastructure code. Nullables are useful in production, but they're also great for tests. They allow you to write sociable tests that don't interact with the outside world.
Putting these patterns together results in surprisingly simple tests and allows you to remove unnecessary cruft from your code.
This class teaches you everything you need to know to start using Nullables in your code. You’ll learn how to:
- Write narrow tests that are fast and reliable.
- Write sociable tests that ensure your whole system works together.
- Use state-based tests so you can refactor code without breaking tests.
- Factor out helper methods that make your tests easy to read and resilient to changes.
- Use Nullables to easily test application code that depends on infrastructure.
- Design and implement Nullables of your own.
- Use low-level Nullables to easily test high-level infrastructure wrappers.
- Design and implement reusable low-level infrastructure wrappers.
- Use narrow integration tests to test low-level infrastructure.
Why You’ll Love This Course
This is a hands-on coding course. You'll spend almost all your time writing code, and you'll apply the course concepts to real-world problems.
You'll get to set your own pace as you work. Do you have a ton of experience? Zip ahead to advanced concepts. Just getting started? Take it slow and steady and focus on the fundamentals. The course materials provide more than enough to keep you busy either way.
You’ll decide how much interaction you want. You can work alone, in a pair, or as part of a mob/ensemble. If you need to concentrate alone, you can do that. If you learn best by bouncing ideas off other people, that's okay too. (Subject to others’ availability.)
I'll be there to provide individual help and guidance as you work. As the creator of the Nullables pattern and the “Testing Without Mocks” pattern language, as well as over 23 years of professional test-driven development experience, I have the deep expertise and real-world experience to answer all your questions.
After the course is over, you'll have access to more exercises so you can keep practicing on your own, as well as detailed course materials you can refer to as you implement the ideas in your own code.
What You’ll Do
This is an online course led by an experienced instructor. It's equivalent to a two-day course, but it's split up into four sessions across two weeks. That's less disruptive for your schedule and makes the material easier to digest.
Each session consists of 3 hours of live instruction followed by an optional office hour.
- Topic introduction (~30 minutes)
- Coding exercises (~120 minutes)—including self-managed break
- Debrief (~30 minutes)
- Optional office hour (~60 minutes)
Each session starts with an introduction to a specific concept, such as “writing state-based tests” or “building high-level infrastructure wrappers.” I’ll explain what you're about to learn, why it matters, and how it fits into the big picture. It takes about 30 minutes depending on the topic and how many questions people have.
After the introduction, you’ll move into breakout rooms to put the ideas into practice. You'll work alone, in pairs, or in a mob/ensemble, depending on your personal preferences and the availability of the other course participants. You'll always have the option to work alone.
For each topic, you'll have a series of exercises that start with the basics and build into advanced topics. You're not expected to finish every exercise, so you can work at whatever pace you like. Each exercise presents a puzzle. Advanced students can attempt to solve the puzzle on their own, and beginners can follow the hints and step-by-step exercise guide.
You'll work in JavaScript or TypeScript—your choice—and Node.js, using a git repository I provide. If you're not familiar with Node.js, JavaScript, or TypeScript, don't worry. The exercise guide will have everything you need. I'll also be circulating among the breakout rooms providing help and guidance.
The exercises take the majority of the time for each session: about two hours, including an opportunity for a break. After the time is up, we'll debrief. I'll demonstrate the key ideas from the exercises, then you'll talk over your experiences in small groups of 3-4 people. Finally, we'll talk about when and how to use what you've learned—and when not to—and address any remaining mysteries.
After the end of the session, I'll be available for an office hour with anybody who wants to follow up on material we couldn't discuss during class.
Target Audience: Professional Developers
This course is meant for professional software developers. You need to know how to program (in any programming language), how to use a code editor or an IDE (your choice), and the basics of Git and the command line.
You do not need to know JavaScript or TypeScript. It's helpful, but not required. Similarity, familiarity with the tools we’re using—Node.js, Mocha, and Chai—is helpful, but not required. If you're familiar with programming concepts in general, the exercise guide will have everything else you need, and I'll also be available to help as needed.
I don't introduce the basics of developer testing or test-driven development in this course. If you're not familiar with it, you might want to check out this video for an introduction.
About Your Instructor
I'm James Shore. I've been developing software with test-driven development and other Extreme Programming practices for over 23 years. I mainly work as an embedded coach and consultant, working with teams on real software, helping them figure out how to be more effective. But I also provide training and speak at conferences around the world. My emphasis is on providing real-world experiences that translate into your actual work.
I'm best known for my book, The Art of Agile Development, as well as for numerous screencasts and presentations about test-driven development and other Agile topics. You can find out more about me on my website, jamesshore.com. My latest material is at jamesshore.com/s/new.
Course Outline and Schedule
Timing and Time Zones
The course takes place on June 6th, 8th, 13th, and 15th (Tuesdays and Thursdays) at the following times:
- PDT/UTC-7 (US Pacific): 8am-11am
- MDT/UTC-6 (US Mountain): 9am-12pm
- CDT/UTC-5 (US Central): 10am-1pm
- EDT/UTC-4 (US Eastern): 11am-2pm
- BRT/UTC-3 (Argentina, Brazil): 12:00-13:00
- UTC: 15:00-18:00
- BST/UTC+1 (UK): 16:00-19:00
- CEST/UTC+2 (Central Europe): 17:00-20:00
- EEST/UTC+3 (Eastern Europe): 18:00-21:00
Each day is followed by an optional office hour.
Day 1: June 6th
Testing Application Logic
- Terminology: narrow vs. broad tests; interaction-based vs. state-based tests; sociable vs. solitary tests.
- Understanding Nullables, configurable responses, behavior simulation, and output tracking.
- Comparing and contrasting broad tests, interaction-based tests, and sociable tests.
- Designing tests for clarity.
- Exercises: Build and test a web page controller that calls an external service.
Day 2: June 8th
High-Level Infrastructure
- Writing high-level infrastructure wrappers (also known as "Adapters" or "Gateways")
- Using Nullable low-level infrastructure to test high-level infrastructure
- Implementing output tracking
- Designing infrastructure wrappers; encapsulation; composition/decomposition
- Exercises: Build and test an infrastructure wrapper for an external service.
Day 3: June 13th
Narrow Integration Tests
- Implementing low-level infrastructure wrappers
- Testing low-level infrastructure with narrow integration tests
- Writing spy servers
- Exercises: Build and test a reusable HTTP client.
Day 4: June 15th
Embedded Stubs
- Making low-level infrastructure nullable with embedded stubs
- Implementing configurable responses
- Implementing embedded stubs in languages such as Java and C#
- Exercises: Use an embedded stub to make your HTTP client nullable.
Tags
About the organizer
James Shore teaches, writes, and consults on Agile development processes with an emphasis on technical excellence. He is a recipient of the Agile Alliance's Gordon Pask Award for Contributions to Agile Practice, author of The Art of Agile Development, and co-creator of the Agile Fluency® Model. InfoQ has named him one of the “most influential people in Agile.” You can find his writing at jamesshore.com.