Testing Our Way to a Better Developer Experience

Rate this content
Bookmark

Are our UI tests a chore, or do they help us move faster? Let’s examine what makes testing great and not so great. We’ll focus on test strategies that help us code with confidence and clarity, and where they can cost us time and energy. The secret to good testing lies in how it shapes our developer experience. Do our tests give us useful feedback in a timely manner? How quickly can we tell what is wrong when a test suite fails? Do they document our features and explain our past decisions? We’ll answer these questions with better tests that give us joy.

This talk has been presented at React Day Berlin 2024, check out the latest edition of this React Conference.

FAQ

Will Klein suggests a hybrid approach of writing tests as soon as there is a clear understanding of what changes are needed, rather than strictly before or after coding.

TDD (Test-Driven Development) involves writing tests before code. Will Klein believes that while TDD is useful, it may not always mix well with front-end development due to its evolving landscape.

Will Klein emphasizes testing because it improves developer confidence, prevents defects, and enhances the overall developer experience.

Will Klein is the founder of ToolSpace, a consultancy focused on building developer tools and improving developer experience.

Will Klein mentions unit tests, integration tests, and end-to-end tests as crucial in development.

Will Klein recommends using Testing Library for its guiding principles and best practices in writing tests that resemble real user interactions.

Will Klein recommends using test descriptions to reflect user stories and impacts, not just technical specifications, to better understand the code's purpose.

Will Klein suggests focusing on user experience coverage, prioritizing tests that impact users the most.

Will Klein critiques code coverage because it can lead to writing tests that don't necessarily improve quality, equating it to measuring productivity by lines of code.

ToolSpace focuses on building great developer tools and enhancing the developer experience.

Will Klein
Will Klein
21 min
16 Dec, 2024

Comments

Sign in or register to post your comment.
  • Dmytro
    Dmytro
    DataArt
    Thank you for the talk! It was usefull.
Video Summary and Transcription
I want to talk about the importance of testing and how it can improve the developer experience. Lack of tests can lead to issues and breakdowns in productivity. The challenges of using TDD and testing last are discussed, along with the benefits of writing tests early. Effective tests provide valuable feedback and save time. Prioritizing user-focused testing and using tests as documentation are recommended. Tests should resemble user behavior, and enhancing testing capabilities with linters and custom matchers is suggested. Advanced testing techniques can improve developer productivity.

1. Introduction to Testing and Developer Experience

Short description:

I want to talk to you about testing and how it can help us have a better developer experience. Working with good tests is one of my favorite things and it helps me enjoy writing code even more. Let me share a quick story.

♪♪ Hey, I'm Will Klein, and I want to talk to you about testing. In particular, I want to share how testing can help us have a better developer experience. I started a company called ToolSpace, a consultancy focused on building great developer tools and improving the developer experience for everyone because it's what I enjoy doing the most.

And working with tests, good tests in fact, is one of my favorite things to have in my arsenal, and it helps me enjoy writing code even more than I already do. I'd like to share with you today how I do that so you can as well. Let me start off with sharing a quick story.

I have a client project where I shipped my first feature recently, and it was kind of challenging to implement, partly because I was new to the code base, but also because I felt like the developer experience was a bit lacking. Some tools needed to be set up, and the tests in particular, well, there were unit tests for some things, but there were no integration tests, and there were no end-to-end tests. So if I made a change, I didn't really have the confidence I'm accustomed to knowing that everything still works. So I worked a little bit more slowly than usual, and I was very careful with understanding the impact of my changes.

2. The Importance of Having Tests in Place

Short description:

Thinking back, I should have insisted on having tests in place. After shipping a feature, a client reached out saying it broke something. I didn't have tests to give me confidence that my change didn't cause the issue. It turned out to be someone else's fault, but the lack of tests caused a breakdown in the developer experience and productivity.

And thinking back, I really should have insisted, we really should have some tests in place. I've been there where I've just forged ahead, and, you know, yeah, wish I had those tests. And indeed, after I shipped this feature a few weeks ago, the week after the client reached out to me and said, hey, that work you did on this thing, it broke something. That's very important, and we need you to fix it. And I was like, oh, darn. I was working on something else, I had to stop what I was doing, I had to context switch back to what I had been working on, and I started looking into it. And as I looked into it, I just kept thinking, hmm, I really don't think it was my change, but I didn't have tests. I didn't have tests to know that, to give me that confidence to know everything was still working after I made the change. So I did my investigation, and after a pretty short period of time, I figured out it's not me. It wasn't my change. And honestly, I wish it was me, because if it was, I knew what I changed. I could have figured it out pretty quickly. But instead, I had to tell my team that didn't know what broke it, was not me, which meant that two other developers then had to stop what they were doing and then look at what went wrong. So kind of a classic case of not having the tests that you should have, and your developer experience completely breaking down, your productivity going out the window, having to context switch, having to stop what you're doing, having to figure out what this is instead of building features and doing cool things. This is not where anyone wants to be.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Remix Flat Routes – An Evolution in Routing
Remix Conf Europe 2022Remix Conf Europe 2022
16 min
Remix Flat Routes – An Evolution in Routing
Top Content
Remix Flat Routes is a new convention that aims to make it easier to see and organize the routes in your app. It allows for the co-location of support files with routes, decreases refactor and redesign friction, and helps apps migrate to Remix. Flat Folders convention supports co-location and allows importing assets as relative imports. To migrate existing apps to Flat Routes, use the Remix Flat Routes package's migration tool.
How to Make a Web Game All by Yourself
JS GameDev Summit 2023JS GameDev Summit 2023
27 min
How to Make a Web Game All by Yourself
This talk guides you on how to make a web game by yourself, emphasizing the importance of focusing on tasks that interest you and outsourcing the rest. It suggests choosing a game engine that allows distribution on the web and aligns with your understanding and enjoyment. The talk also highlights the significance of finding fun in the creative process, managing scope, cutting features that don't align with the game's direction, and iterating to the finish line. It concludes by discussing the options for publishing the game on the web and leveraging unique web features.
Atomic Deployment for JS Hipsters
DevOps.js Conf 2024DevOps.js Conf 2024
25 min
Atomic Deployment for JS Hipsters
This Talk discusses atomic deployment for JavaScript and TypeScript, focusing on automated deployment processes, Git hooks, and using hard links to copy changes. The speaker demonstrates setting up a bare repository, configuring deployment variables, and using the post-receive hook to push changes to production. They also cover environment setup, branch configuration, and the build process. The Talk concludes with tips on real use cases, webhooks, and wrapping the deployment process.
Your GraphQL Groove
GraphQL Galaxy 2022GraphQL Galaxy 2022
31 min
Your GraphQL Groove
The Talk discusses the value proposition of GraphQL and its ability to solve common pain points in API development. It highlights the importance of making informed decisions when choosing GraphQL clients, servers, and schema builders. The Talk also emphasizes the need to focus on the best developer experience in the present rather than seeking a perfect long-term solution. Additionally, it mentions the future of the Urkel GraphQL client and the reasons for dropping ReScript support. Overall, the Talk provides insights into the current state and future trends of GraphQL development.
Full-stack & typesafe React (+Native) apps with tRPC.io
React Advanced 2021React Advanced 2021
6 min
Full-stack & typesafe React (+Native) apps with tRPC.io
Top Content
Alex introduces tRPC, a toolkit for making end-to-end type-safe APIs easily, with auto-completion of API endpoints and inferred data from backend to frontend. tRPC works the same way in React Native and can be adopted incrementally. The example showcases backend communication with a database using queries and validators, with types inferred to the frontend and data retrieval done using Prisma ORM.
Using UDP in the Browser for faster Client/Server Connections
JS GameDev Summit 2023JS GameDev Summit 2023
21 min
Using UDP in the Browser for faster Client/Server Connections
Top Content
This talk introduces geckos.io, a real-time client-server communication library using UDP and WebRTC. The speaker discusses the benefits of UDP for real-time multiplayer games and explains how geckos.io enables UDP connections between browsers and Node.js servers. The deployment process for geckos.io involves opening UDP ports and handling signaling through an HTTP request. The speaker demonstrates how geckos.io works with Docker and showcases the ability to host multiple servers on the same machine. Overall, this talk provides an overview of geckos.io and its applications in real-time communication.

Workshops on related topic

Integrating LangChain with JavaScript for Web Developers
React Summit 2024React Summit 2024
92 min
Integrating LangChain with JavaScript for Web Developers
Featured Workshop
Vivek Nayyar
Vivek Nayyar
Dive into the world of AI with our interactive workshop designed specifically for web developers. "Hands-On AI: Integrating LangChain with JavaScript for Web Developers" offers a unique opportunity to bridge the gap between AI and web development. Despite the prominence of Python in AI development, the vast potential of JavaScript remains largely untapped. This workshop aims to change that.Throughout this hands-on session, participants will learn how to leverage LangChain—a tool designed to make large language models more accessible and useful—to build dynamic AI agents directly within JavaScript environments. This approach opens up new possibilities for enhancing web applications with intelligent features, from automated customer support to content generation and beyond.We'll start with the basics of LangChain and AI models, ensuring a solid foundation even for those new to AI. From there, we'll dive into practical exercises that demonstrate how to integrate these technologies into real-world JavaScript projects. Participants will work through examples, facing and overcoming the challenges of making AI work seamlessly on the web.This workshop is more than just a learning experience; it's a chance to be at the forefront of an emerging field. By the end, attendees will not only have gained valuable skills but also created AI-enhanced features they can take back to their projects or workplaces.Whether you're a seasoned web developer curious about AI or looking to expand your skillset into new and exciting areas, "Hands-On AI: Integrating LangChain with JavaScript for Web Developers" is your gateway to the future of web development. Join us to unlock the potential of AI in your web projects, making them smarter, more interactive, and more engaging for users.
Managers Are From Mars, Devs Are From Venus
TechLead Conference 2024TechLead Conference 2024
111 min
Managers Are From Mars, Devs Are From Venus
Workshop
Mo Khazali
Mo Khazali
A Developer’s Guide to Communicating, Convincing, and Collaborating Effectively With Stakeholders
It’s a tale as old as time - collaboration between developers and business stakeholders has long been a challenge, with a lack of clear communication often leaving both sides frustrated. The best developers can deeply understand their business counterparts’ needs, effectively communicate technical strategy without losing the non-technical crowd, and convince the business to make the right decisions. Working at a consultancy, I’ve both failed and succeeded in architecting and “selling” technical visions, learning many lessons along the way.Whether you work at a product company, are a consultant/freelancer, or want to venture beyond just being a developer, the ability to convince and clearly communicate with stakeholders can set you apart in the tech industry. This becomes even more important with the rise of GenAI and the increasingly competitive developer market, as problem-solving and effective communication are key to positioning yourself.In this workshop, I’ll share real-world examples, both good and bad, and guide you through putting the theory into practice through dojos.
How to create editor experiences your team will love
React Advanced 2021React Advanced 2021
168 min
How to create editor experiences your team will love
Workshop
Lauren Etheridge
Knut Melvær
2 authors
Content is a crucial part of what you build on the web. Modern web technologies brings a lot to the developer experience in terms of building content-driven sites, but how can we improve things for editors and content creators? In this workshop you’ll learn how use Sanity.io to approach structured content modeling, and how to build, iterate, and configure your own CMS to unify data models with efficient and delightful editor experiences. It’s intended for web developers who want to deliver better content experiences for their content teams and clients.