Workshop details

2024. May 28. - May 29.,
Testing Without Mocks
Topics:
Software Delivery Craft Matters
tdd
testing
mocks
nullables
javascript
typescript
programming
hands-on
unit tests
integration tests
Level: General

<p>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:</p>

<ul>
<li>Flaky tests fail randomly.</li>
<li>End-to-end tests run slowly.</li>
<li>Mock-heavy tests can be hard to understand, lock in implementation, or only test themselves.</li>
</ul>

<p>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.)</p>

<p>In this hands-on coding 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.</p>

<h4>Learn how to:</h4>

<ul>
<li>Write narrow tests that are fast and reliable.</li>
<li>Write sociable tests that ensure your whole system works together.</li>
<li>Use state-based tests so you can refactor code without breaking tests.</li>
<li>Factor out helper methods that make your tests easy to read and resilient to changes.</li>
<li>Use Nullables to easily test application code that depends on infrastructure.</li>
<li>Design and implement Nullables of your own.</li>
<li>Use low-level Nullables to easily test high-level infrastructure wrappers.</li>
<li>Design and implement reusable low-level infrastructure wrappers.</li>
<li>Use narrow integration tests to test low-level infrastructure.</li>
</ul>

<p>All this while building and testing a web page controller and the infrastructure that connects it to an external service.</p>

<h4>Prerequisites</h4>

<p>This is a course for experienced developers. You’ll need to be familiar with:</p>

<ul>
<li>JavaScript or TypeScript</li>
<li>Unit testing tools (see <a href="https://www.jamesshore.com/v2/projects/lunch-and-learn/incremental-tdd">this video</a> for an introduction)</li>
</ul>

Speaker
Craft 2024 - James Shore
James Shore
Vice President of Engineering at OpenSesame

James Shore leads organizations in scaling software development, most recently for OpenSesame, where he is Vice President of Engineering. He is the author of the Agile how-to guide, The Art of Agile Development, co-creator of the Agile Fluency® Model, and a recipient of the Agile Alliance’s Gordon Pask Award for Contributions to Agile Practice. His writing and screencasts may be found online at ja...