Accessibility Assessment of Violations on the Stack Overflow Platform
Ingrid M. Miranda da Silva, Luciano Arruda Teran, Marcelle Pereira Mota · 2022 · Proceedings of the 21st Brazilian Symposium on Human Factors in Computing Systems (IHC) · doi:10.1145/3554364.3561828
Summary
This study investigates whether code snippets shared on Stack Overflow — one of the world's most popular developer Q&A platforms with over 120 million monthly visitors — follow web accessibility guidelines. The researchers built a tool called A11y RepoMining that extends the open-source Pa11y accessibility linter to evaluate HTML and CSS code snippets extracted from SOTorrent, a publicly available dataset of Stack Overflow post histories. They extracted posts from December 2020, filtering for accepted answers containing HTML and CSS code. After manually removing snippets that primarily contained other technologies like JavaScript or jQuery, they retained 269 code snippets for analysis. Each snippet was run through the Pa11y linter configured to check against WCAG 2.0 success criteria. The study is positioned as the first to apply repository mining techniques specifically to assess accessibility compliance in shared code repositories, addressing a gap where previous mining research focused on code quality and usability but not accessibility.
Key findings
Across 269 evaluated snippets, the researchers found 597 WCAG violations — an average of 2.21 accessibility failures per snippet. Of the snippets analysed, 206 (76.6%) contained at least one violation. The violations mapped to 9 WCAG guidelines, with the vast majority (93.3%) being Level A failures, meaning the most basic accessibility requirements were not met. Only 6.7% were Level AA violations, primarily related to colour contrast (guideline 1.4.3). The most frequently violated WCAG principles were Perceivable (33.17%), Robust (28.47%), Operable (27.47%), and Understandable (10.89%). Common specific violations included missing page titles (2.4.2), improper input type attributes (4.1.2), presentational HTML attributes instead of CSS (1.3.1), missing alt text on images (1.1.1), missing page language declarations (3.1.1), and insufficient colour contrast (1.4.3). The authors also cite a survey finding that 51.5% of Brazilian IT professionals only implemented accessibility when their project explicitly required it.
Relevance
This research exposes a significant problem in the developer knowledge ecosystem: the code that millions of developers copy and adapt from Stack Overflow routinely ignores accessibility. With an average of over two WCAG violations per snippet and 93% of those being basic Level A failures, the platform effectively propagates inaccessible coding patterns at massive scale. For accessibility advocates and trainers, this underscores the need for accessibility education to be integrated into the environments where developers actually learn — not just formal training but community platforms, documentation, and code examples. The study also highlights that most developers only consider accessibility when projects mandate it, pointing to the critical role of organizational requirements and procurement standards in driving accessible development practices. The A11y RepoMining tool, available on GitHub, offers a replicable approach for auditing code repositories for accessibility compliance.
Tags: web accessibility · repository mining · software development · code quality · WCAG compliance · developer awareness · automated testing · HTML · CSS
Standards referenced: WCAG 2.0