a11y and TDD: A Perfect Match

Rate this content
Bookmark

Accessibility has been web development's ugly duckling for quite some time now. I often get asked, "when should you test for a11y in your apps?" My answer is simple, "right from the start!". Regardless of the framework considered - React, Svelte, Vue, YourOwn™️ - as developers we are in a privileged position to help the ugly duckling grow into a beautiful swan. How? By diving deep into the pond and harnessing the power of Javascript APIs to build the right components for your web apps. And how can do you know you are building them right? By pairing Test Driven Development with the Testing Library family. Ready to grow your web apps into swans?

This talk has been presented at JSNation 2022, check out the latest edition of this JavaScript Conference.

FAQ

Rita is a speaker who works in the Software Development Center (SDC) for the Volkswagen Group in Lisbon. She is passionate about comic books, cycling, and gaming.

'A11Y' stands for accessibility, with the number 11 representing the eleven letters between the 'A' and 'Y' in the word. It emphasizes the importance of making software usable for as many people as possible.

Test-Driven Development (TDD) is a software development approach where test cases are created before writing the production code. It involves a cycle of writing a test, making it fail, implementing code to make the test pass, and possibly refactoring.

Accessibility and TDD combine to ensure software is usable by as many people as possible, including those with disabilities. TDD helps create a robust architecture that supports accessibility features from the ground up.

Atomic design is a methodology where components are built up from smaller units (atoms) to larger and more complex structures (molecules and organisms). This approach helps in organizing code and making it easier to manage in software development.

The 'red cycle' in TDD refers to the initial phase of the development process where a new test is written and intentionally fails because the corresponding feature hasn't been implemented yet.

Considering the user's perspective during test writing ensures that the software functions intuitively and meets user needs. It enhances the usability and accessibility of the software, making it more effective and user-friendly.

Rita Castro
Rita Castro
24 min
16 Jun, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

This Talk explores the intersection of accessibility and test-driven development (TDD) in software development. TDD is a process that involves writing tests before writing production code, providing a safety net for code changes. The Talk demonstrates how to apply TDD principles to real-life examples, such as filling out a form, and emphasizes the importance of user-centric testing. By using atomic design principles, code can be organized in a clean and easy way. The Talk also discusses the use of labels and test IDs in tests for improved accessibility.

1. Introduction to the Talk

Short description:

Welcome to this talk. My name is Rita, and I work in the SDC, the software development center for the Volkswagen Group in Lisbon. In my free time, I like to game. If you're ever in Lisbon, please do drop by our building.

Okay. So thank you very much. Welcome to this talk. And let's get started. So my name is Rita. I'm a geek at heart. I really love comic books. I have a son named Pedro. He's three and a half years old. I recently since we got back from the pandemic, I started cycling. And when I go to work, I usually do so by bike. In my free time, I like to game, which is nice. I work in the SDC with these amazing people, which are the ones that are kind of making noise. And the SDC is the software development center for the Volkswagen Group in Lisbon. This is our building. It is really pretty. If you're ever in Lisbon and you want to visit, please do drop by.

2. Accessibility and Test-driven Development

Short description:

So for today, accessibility. It has been talked about in the previous talks. The first definition that you find in the dictionary for accessibility is something that is capable of being understood or appreciated and reached. Test-driven development, what is it? In a nutshell, it's the ability to convert software requirements into test cases before you do any line of production code. So, given accessibility, given test-driven development, how exactly do these two match and why exactly is it so important to combine the two of them? Let's come back to accessibility. For us, developers, accessibility is the power to enable as many people as possible to use the software that we use, to empower people to use the things that we built. Accessibility is for all of us. Including us. Especially us. How many of you have issues with the keyboard? And accessibility gives us this. Coming back to the test driven development. So, my first contact with TDD, it was through this book.

So for today, accessibility. It has been talked about in the previous talks. And there's a big reason for it. So when you think accessibility, you usually think about people with disabilities, or something that can be accessed by people with disabilities, or something that is adapted for people with these set disabilities. However, that's not all of it. The first definition that you find in the dictionary for accessibility is something that is capable of being understood or appreciated and reached, which is big. Let that sink in.

Test-driven development, what is it? In a nutshell, it's the ability to convert software requirements into test cases before you do any line of production code. It is quite simple and just to get a feel of the room, how many of you have done test-driven development? OK, cool. Then I will let you go. Then I will fast forward. But for those of you who haven't, test-driven development is ‑‑ sorry.

So, given accessibility, given test-driven development, how exactly do these two match and why exactly is it so important to combine the two of them? I hope that by the end of this you will have a better idea of it. Let's come back to accessibility. And a funny thing that I discovered. So, between the A and the Y, there's 11 letters. And that's why it's usually referred to as LE or A11Y. I kind of didn't know that. But once I did, it became a fun fact. For us, developers, accessibility is the power to enable as many people as possible to use the software that we use, to empower people to use the things that we built. We don't want to build things to be put on a shelf. But it's not only for people who are in a wheelchair, who have some crutches, who have a wheel cart for the baby. Accessibility is for all of us. Including us. Especially us. How many of you have issues with the keyboard? If we can spend all of our time just using the keyboard, that's pretty cool. And accessibility gives us this. Coming back to the test driven development. So, my first contact with TDD, it was through this book. It is done for Java.

QnA