What's interesting about this is that these companies were clearly attempting to build accessible sites. Otherwise, they wouldn't have even used ARIA attributes, whose purpose is to enhance accessibility. And yet, it's a perfect example of how intentions don't always lead to results in accessibility.
Today, I am going to talk about an approach to coding in an accessible way, that I think can prevent these kind of defects from ever reaching production. But before I do that, let me quickly introduce myself. I'm Daniel Gorin, a passionate researcher dedicated to refining chaotic processes. And that's me in the picture, trying to decipher the contents of a jar in my Airbnb. I've been working for the past six years as a researcher, and I currently lead the analysis technologies team at Evinst, where we focus on developing innovative capabilities for accessibility analysis.
Evinst is a software company that builds tools for developers, designers, and other professionals that take part in the product development life cycle. We help them make their sites and mobile applications accessible to all, where our focus is on helping our users detect and prevent accessibility violations as early as possible. In this talk, we'll explore the concept of accessibility through test-driven development. We'll start by understanding what it is, and how it's applied in front-end development. We'll dive into the complexities of choosing the right pattern. There's more to it than meets the eye. And finally, we'll tackle the challenges head-on, providing you with tools and examples to help you get started.
TDD was rediscovered in 2002 by Kent Beck. In his own words, the original description of TDD was in an ancient book about programming. It said, you take the input tape, manually type in the output tape you expect, then program until the actual output matches the expected output. So we can think of it as a timeless approach to software engineering. By writing tests before the code, TDD fosters better design, encourages simpler code, and helps developers catch defects early in the development cycle. This proactive method not only enhances code quality, but also improves maintainability, and makes refactoring easier. Now, we can start our journey with a unit test.
And unit testing is not just for applicative code. It's already used extensively in front-end code, especially when building components. In this slide, I'll demonstrate unit testing in React, using VTest with JS DOM as the browser environment. JS DOM is an incredibly useful tool for testing web applications. It's a partial implementation of a web browser in pure JavaScript. Its main advantage is speed, as it skips heavy lifting of visual rendering, things like computing styles and layouts, and instead focuses on simulating DOM APIs like Document or Window, making it ideal for testing logic and interactions. In this unit test, I render a Button component, which expects to get a click listener. In this case, the click listener is supposed to just change the value of a variable called click from false to true.
Comments