diff --git a/LICENCE b/LICENCE deleted file mode 100644 index 5fc78dc80f..0000000000 --- a/LICENCE +++ /dev/null @@ -1,437 +0,0 @@ -Attribution-NonCommercial-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International -Public License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-NonCommercial-ShareAlike 4.0 International Public License -("Public License"). To the extent this Public License may be -interpreted as a contract, You are granted the Licensed Rights in -consideration of Your acceptance of these terms and conditions, and the -Licensor grants You such rights in consideration of benefits the -Licensor receives from making the Licensed Material available under -these terms and conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - m. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - n. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database for NonCommercial purposes - only; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - including for purposes of Section 3(b); and - - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - -======================================================================= - -Creative Commons is not a party to its public -licenses. Notwithstanding, Creative Commons may elect to apply one of -its public licenses to material it publishes and in those instances -will be considered the “Licensor.” The text of the Creative Commons -public licenses is dedicated to the public domain under the CC0 Public -Domain Dedication. Except for the limited purpose of indicating that -material is shared under a Creative Commons public license or as -otherwise permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the -public licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/_data/authors.yml b/_data/authors.yml index 2fb350aa58..5f6a2a6bf4 100644 --- a/_data/authors.yml +++ b/_data/authors.yml @@ -25,7 +25,6 @@ active-authors: - csalt - dgrew - dhinrichs - - dhope - dkerr - dmcnamee - dnicholas @@ -104,7 +103,6 @@ active-authors: - sbreingan - sburnstone - sforeshew-cain - - sgladstone - shamiltonritchie - shunton - slaing @@ -295,12 +293,6 @@ authors: name: "Dan Elliott" author-summary: "

Senior UX Designer at Scott Logic based in the Bristol office. I spend my time researching users, designing solutions and testing to ensure a productive and pleasurable user experience. PC and VR Gamer, Motorcycle Enthusiast, Dad and Collector of Loud Shirts." picture: picture.jpg - dhope: - name: "David Hope" - email: "dhope@scottlogic.com" - author-summary: "

Architect and technologist wth an interest in many areas including video streaming, identity and resilience

" - feed-description: "David's thoughts on software architecture" - picture: picture.jpg dkerr: author-summary: "

I'm a full-stack web developer, with an interest in anything and everything that's new in web technology!

" name: "Dean Kerr" @@ -1181,8 +1173,8 @@ authors: picture: dgrew_author_picture.png dhinrichs: name: "Doro Hinrichs" - author-summary: "Associate Developer based in Edinburgh. As a developer with a psychology background, I enjoy bringing a people-focused approach to coding." - picture: dhinrichs.jpg + author-summary: "I am a Graduate Developer at Scott Logic, based in the Edinburgh office. Originally from Germany, I found a home in Glasgow while studying Psychology. I pursued a career in mental health before transitioning into software development, where I enjoy bringing a people-focused approach to coding. Outside of work, you can find me surrounded by plants, playing football, or working on a DIY project." + picture: profile.png pburgess: name: "Paul Burgess" author-summary: "I'm a Lead Developer at Scott Logic and am passionate about using technology to solve real world problems.\n\nI use a wide range of languages and write about TypeScript, JavaScript, React, C# and .NET as well as how to best work together as a project team to deliver solutions." @@ -1342,9 +1334,4 @@ authors: name: "Will Duncan" email: wduncan@scottlogic.com picture: picture.JPG - author-summary: "

I'm a Senior UX designer at Scott Logic, based in Edinburgh. I love building websites, designing apps and watching football!

" - sgladstone: - name: 'Sam Gladstone' - email: sgladstone@scottlogic.com - author-summary: "I'm a developer based out of our Bristol office. I'm a bit of a generalist; I like to get stuck into a range of problems from the business side to anywhere across the tech stack." - picture: Image.png + author-summary: "

I'm a Senior UX designer at Scott Logic, based in Edinburgh. I love building websites, designing apps and watching football!

" \ No newline at end of file diff --git a/_posts/2023-11-06-testing-with-intent-a-path-to-embedded-accessibility.md b/_posts/2023-11-06-testing-with-intent-a-path-to-embedded-accessibility.md deleted file mode 100644 index ca634b94e0..0000000000 --- a/_posts/2023-11-06-testing-with-intent-a-path-to-embedded-accessibility.md +++ /dev/null @@ -1,143 +0,0 @@ ---- -title: "Testing with Intent: a Path to Embedded Accessibility" -date: 2023-11-06 09:45:00 Z -categories: -- Tech -layout: default_post -tags: -- Testing -- Testing Library -- Automation Testing -- Testing with Intent -- Accessibility -- Embedded Accessibility -summary: "In this post, I explore an approach to testing called Testing with Intent. I look what the approach is—testing from the perspective of a user intending to do something—and the positive impacts it can have on both testing and accessibility. I've written this for a broad audience, so I've steered clear of technical details included. Instead, you should come away with an understanding of why this topic is important and how you can benefit from adopting the approach." -author: sgladstone ---- - -*Embedded Accessibility* is a vision of building accessible products by default. We can consider accessibility embedded when it no longer needs to be prioritised because it is already at the core of the delivery process. - -But generally, the software industry is not there yet—too many products get built while treating accessibility as an afterthought. - -In this post, I will explore a pragmatic and achievable step that software teams can take to tackle this issue. This step centres on adopting an approach to automated testing, *Testing with Intent*, that focuses on user intention. Testing with Intent is all about testing from the perspective of how a user intends to use your app. - -Adopting this approach brings a lot of advantages. Our tests will be more resilient, and will give us more confidence in our code. Our products will also be more accessible by default. But most importantly, this approach breaks down some of the barriers we face when trying to embed accessibility in software delivery. - -So, by taking the step of adopting Testing with Intent, we can move towards accessibility being a core part of delivery. We start down a path of practising Embedded Accessibility. - -For those of you who aren’t technical, don’t worry! I’ve saved the [technical side of Testing with Intent]({{ site.github.url }}/2023/11/06/testing-with-intent-a-technical-view.html) for another post. However, before diving into what exactly this approach is, let’s start by looking at a couple of the barriers that teams often face in implementing accessibility. - -## Barrier 1: Accessibility as a Feature -Consider this scenario: - -> A software delivery team is starting a new project. While discussing high-level requirements, the team gets on to the topic of accessibility. Everyone agrees that it’s important to make the product accessible. But everyone also agrees that it's not an essential part of the Minimum Viable Product (MVP). So they prioritise the work as a future epic in the backlog. -> -> Fast forward in time and the project has been a massive success. The team has launched the MVP. They have completed a further year of productive development. There is a growing user base. Yet, the work on accessibility is still not started. In fact, the product growth means that adding accessibility now requires considerable effort. This growing cost effectively means that the work will never be started. - -Does this sound familiar? It’s certainly a scenario that I’ve seen play out all too often. - -There are many reasons why accessibility is an important issue to address. But it’s easy to approach accessibility as a feature that will be implemented at some point in the future. However, the complexity and cost of this “feature” will grow as other features are completed. The necessary work on accessibility becomes harder and harder to prioritise. There's always some other pressing commercial concern. Most likely, the accessibility “feature” will never get done. - -If we are serious about tackling accessibility, it can’t be an afterthought. We need processes in place that support teams in making it a reality from the start—we need to embed accessibility right at the centre of how we deliver software. - -![You're most likely to implement accessibility if you start tackling it at the beggining of a project]({{ site.github.url }}/sgladstone/assets/twi-likelihood-of-implementing-accesibility.png "You're most likely to implement accessibility if you start tackling it at the beggining of a project") - -*This graph is not backed by any data. But it highlights the problem with delaying the implementation of accessible design.* - -## Barrier 2: A Skills Gap - -Most software professionals I've spoken to feel that accessibility is an important subject. But most also feel that they lack the necessary skills and training. It’s not that there’s a lack of willingness to learn, but a lack of opportunity. - -Treating accessibility as a deprioritised feature is creating a chicken-and-egg situation. When are people meant to learn the necessary skills if we don't prioritise working on accessibility? But we can’t write accessible products without the necessary skills. So, If people can't learn as part of their day-to-day work, they need another option. - -But accessibility is a complex subject. It's not something that's easy to pick up with a little time here and there. Tackling as important an issue as having an equal society can't be about putting the onus on individuals to learn in their spare time—that's simply not a way to bring about the systemic change we need. - -So, we have a skills gap that we need to bridge and, to properly tackle this gap, we need to address it through our regular delivery work. Again, we need to embed accessibility right at the centre of how we deliver software. - -## My Journey to Embedded Accessibility - -Early in my career, I started this journey when I read the excellent book *[Don't Make Me Think](https://sensible.com/dont-make-me-think/)*. This set me down a path of figuring out how to design intuitive applications. Over my career, I have dabbled with accessibility here and there. But I suffered from not having the opportunity to bridge the skills gap I described above. This all changed on one of my recent projects. - -Jim Light—the lead developer—introduced me to *[Testing Library](https://testing-library.com/)*, a tool for automated frontend testing. This was a lightbulb moment for me. I had found a methodology for frontend testing that finally made sense. This methodology is something that Jim and I call *Testing with Intent*—but more on that in a moment. - -I was finding my groove with this new tech over the course of a few weeks. Then, I noticed that something awesome was happening: I was closing my accessibility skills gap in the course of my day-to-day work. Something about the way I was engaging with Testing with Intent was helping me. While coding, I was getting small, achievable learning opportunities around accessibility. We had, unwittingly, started to embed accessibility into our delivery process. - -In the rest of this post, I will explore what I learnt from this experience. I'll begin by looking at why these testing principles make sense to adopt, irrespective of tackling accessibility. Then, I'll build to look at why adopting these principles is a step forward in addressing the two accessibility barriers above. - -## So what is Testing with Intent? - -Testing with Intent is a testing philosophy that is closely related to the [Guiding Principles of Testing Library](https://testing-library.com/docs/guiding-principles). At a high level, it can be summarised by the following statement: - -

The more your tests resemble the way your software is used, the more confidence they can give you.

— Kent C. Dodds 🌌 (@kentcdodds) March 23, 2018
- -When Testing with Intent, we test from the perspective of a user who intends to do something in our system. You might think of this as similar to writing user stories from the perspective of the user. Consider this illustrative example of a user story: - -> As a user, I want to be able to log out of the system by clicking my avatar and selecting “Log out” from the displayed dropdown menu. - -In Testing with Intent, we approach validating a premise within a test in a similar way. To continue this example, consider how to validate the above story. One of our tests would need to go through the very same steps that a user would take to log out. That is to say the test would locate the avatar on the page, click to open the menu, and click the logout option. While this is a straightforward example, the same principles can be applied to more complex test cases. - -We’re also not only looking to test the positive outcome. In Testing with Intent, we want to validate that the user was able to realise their intended outcome. We should also validate that there were no nasty side-effects along the way. - -Testing with Intent is a subtle yet powerful paradigm shift. A shift away from writing tests that are based on the way we structure code. A shift towards testing based on the way the app is actually used. A shift away from testing the technical implementation details of the software. A shift towards capturing a user’s intention within the test itself. - -There are lots of avenues to explore around the awesome impact of Testing with Intent on testing. In this post, I will stay focussed on addressing the two accessibility barriers described above. To do this, I’ll look at Testing with Intent in web frontend automation testing (this, incidentally, is where Testing Library excels, but that’s [something I'll address in another post]({{ site.github.url }}/2023/11/06/testing-with-intent-a-technical-view.html)). Testing Library is an awesome tool, which can enable us to embed accessibility in our delivery process. But it doesn’t require you to write accessible code, so now it's time to look at how we build that in. - -## Describing Intent using Techniques for Accessibility -To make Testing with Intent work, we need a way to describe the intentions of a user. - -This is not necessarily straightforward. We often convey the purpose in ways that are hard to capture in test code. For example, certain images have near universal meanings. Almost everyone knows the purpose of a button with this icon: - -A floppy disk–or save–button - -But it’s not easy to describe an image in code. So often, we look to some technical implementation detail to make our test work. By this, I mean that we would target something technical like an id attribute: `id="progress-save-btn"`. While this works, it doesn’t mean anything to a user. How often are you browsing a web page thinking about what id all the elements have? When a user intends to save their progress, they click the floppy disk button. So, if we are going to Test with Intent, our tests should behave in the way a user behaves. Our tests should also click the floppy disk button. - -These are the same challenges that the tools for accessibility also face. How does someone using a screen reader know to click the floppy disk button? Fortunately, we already have mature technologies that are designed to solve this. [Semantic HTML](https://web.dev/learn/html/semantic-html/) and [ARIA roles & attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) encode context, intention and structure in ways that can be consumed programmatically. By including them in our websites, we assist the tools that people with impairments rely on to access the web. - -Now here’s the trick: we can use those very same technologies to assist our automated tests. By targeting these accessible descriptions, we make our tests behave like users. Gone are any technical implementation details. Our tests start to read like a user interacting with the product. They now capture the intentions of a user. - -~~~js -it('should save the current progress', async () => { - render() - //... - const saveBtn = await menu.findByRole('button', { name: 'Save Progress' }); - userEvent.click(saveBtn); - //... -}); -~~~ -*Clicking a save button in the style of Testing with Intent. Note that, while the above may look technical, the role ‘button’ and the name ‘Save Progress’ are both accessible descriptors rather than implementation details.* - -## Testing with Intent is great for tests -Before we get to those accessibility barriers, I think it’s important to highlight that adopting these techniques is great for our tests. - -Testing is all about giving ourselves confidence that the code we are releasing works. On the one hand, we could invest a lot of time and effort into being 100% certain that our changes work. But that's not the best choice because getting that confidence would take a lot of time and effort. So, instead, we look for the sweet spot where we are really confident in our code, but it hasn't cost the earth to get there. All that extra saved effort can be invested into the product in other ways. So, tests that give a lot of confidence but take relatively little effort are great tests. This is the case when we Test with Intent and describe that intent through accessibility. - -[Stepping away from testing technical implementation details is a good thing](https://kentcdodds.com/blog/testing-implementation-details). It's possible to cover a lot of ground with only a few tests, so we can get a lot of confidence for the effort we put in. Also, as the tests interact with our app in the same way as a user would, they break when something changes for our users. That's the sort of failure we want—the app no longer functions in the expected way for a user. - -This, in turn, gives the team the confidence to make wider technical changes. They can, for example, complete a technical refactor without having to touch these tests. Then the tests run and, hopefully, say, "All good! The app functions the same for the user." No longer does a small technical change break a load of tests, which in turn need to be rewritten. Instead, the tests are more resilient in a way that simplifies technical changes. When a team isn't weighed down by tests that break for the wrong reasons, they are free to be bolder in their work and deliver faster. This is especially true when they need to tackle more complex tasks. - -For me this is a key benefit. If you adopt Testing with Intent, you’ll be reaping benefits in your automated test suite. I think that this value alone is enough to justify Testing with Intent’s adoption. That’s before you even consider adding accessibility into the mix. So, if you look at it from that angle, you can get a bonus here if you also start to address accessibility. It’s pretty awesome that you get to tackle two issues from one investment. - -## Two for the price of one: Good Tests + Addressing the Accessibility Barriers - -So how does adopting these techniques address the two barriers—accessibility as a feature and a skills gap—described above? - -Describing intent using techniques for accessibility enables us to start tackling the skills gap. Through it, we create those small, achievable learning opportunities for our technical teams. These opportunities start to come up during the course of day-to-day work. To highlight this, I’ll turn to an example of one such opportunity that came up for me. - -While writing a test, I found myself asking which role our app’s sidebar should have. It didn’t take long to scan the [list of roles](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) to find [the answer](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/navigation_role), and, what’s more, I learnt about [landmark roles](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles#3._landmark_roles) along the way. Using my new knowledge, I replaced the sidebar’s `div` element with `nav`, which directly improved the app's accessibility. Learning while you work really is a powerful way of closing the skills gap. - -Starting to tackle accessibility also no longer needs to be considered as a future feature. (Unless you consider your tests a feature, and I think you likely have bigger problems if that’s the case!) You will start to tackle accessibility as soon as you start writing tests, and you should be writing tests for every feature. So, you are tackling accessibility from day one. - -Don’t get me wrong, this is not a silver bullet that will produce perfect accessibility in your apps. Think of it more like a starting place that will build a team’s skill set and also improve the app’s accessibility. Other work will be necessary to further improve accessibility. But you’ll have broken down barriers to starting that work: your team becomes more skilled and you don't need to start from scratch. This is an incredibly cost-effective way of approaching the issue. It’s certainly cheaper than retrofitting accessible designs into an application. - -For me, the way that these barriers have been broken down is the most powerful change here. It brings working on accessibility within the reach of delivery teams, and that’s a step towards building a more equal society. - -## On the path to Embedded Accessibility -So, we’ve explored a couple of barriers to embedding accessibility, and how Testing with Intent helps us to break down those barriers. We’ve also seen how Testing with Intent is great for tests. So, adopting Testing with Intent improves your tests, and gives you the bonus of a step towards Embedded Accessibility. - -There is also, of course, a lot more to Embedded Accessibility. The techniques described in this post aren’t going to be enough just on their own. For example, you probably should consider accessibility in your “Definition of Ready” and “Definition of Done”. I also think we have a way to go before we have a clear and well understood picture of what Embedded Accessibility is. But it’s important not to let the perfect be the enemy of the good. We shouldn’t hold back from good, pragmatic, incremental change simply because it doesn’t give a perfect result. As an industry, we have an accessibility journey to go on, and there are many steps in the journey. - -Some teams may have already made good progress on that journey. This can be particularly true for government projects, where the legal requirements are more stringent. For these teams, adopting Testing with Intent can complement existing practices and processes. For many teams, adopting these approaches would be an important first step in tackling the issue. In any case, Testing with Intent is a useful tool for tackling accessibility, as well as a helpful step towards Embedded Accessibility. - -If you’re interested in how this works in practice, you may want to look at my follow-up post about the [Technical Side of Testing with Intent]({{ site.github.url }}/2023/11/06/testing-with-intent-a-technical-view.html). - -Finally, I’d like to give a massive shout out to Jim Light. We developed these principles and practices while working on a project together. Time got the better of us, and we weren’t able to collaborate on writing these posts together. But he certainly had a big influence on the formation of these ideas. Also, a massive thank you to everyone who gave their time to help me shape these posts! diff --git a/_posts/2023-11-06-testing-with-intent-a-technical-view.md b/_posts/2023-11-06-testing-with-intent-a-technical-view.md deleted file mode 100644 index fbca148143..0000000000 --- a/_posts/2023-11-06-testing-with-intent-a-technical-view.md +++ /dev/null @@ -1,343 +0,0 @@ ---- -title: "Testing with Intent: a Technical View" -date: 2023-11-06 09:55:00 Z -categories: -- Tech -layout: default_post -tags: -- Testing -- Testing Library -- Automation Testing -- Testing with Intent -- Accessibility -- Embedded Accessibility -summary: "In my previous post, I introduced and approach to testing called Testing with Intent. Essentially, the approach focuses on testing from the perspective of a user intending to do something. Adopting this approach brings you benefits in both your test suites and your products accessibility. That post discussed why the topic is important and how you can benefit if you adopt it. Now, it’s time to look at the technical side of how this actually works in practice. " -author: sgladstone ---- -In [my first post]({{ site.github.url }}/2023/11/06/testing-with-intent-a-path-to-embedded-accessibility.html), I set out why I think we should be *Testing with Intent*. I set out that, if we focus our tests on the intentions of users, we can improve our test suites and start to tackle accessibility. To keep the content accessible to everyone, I chose to not include anything technical. Now, in this post, I’m going to look at the same subject but through a technical lens. - -The essence of this whole approach to testing can be boiled down to one simple golden rule: “Wherever possible, use `queryByRole`". We’ll take a look at what we mean by this rule, and start to unpack its consequences. - -Those consequences themselves are far reaching. The rule will help direct you to write better tests. The rule will directly improve your web app’s accessibility. The rule will help your team to upskill in accessibility. It’s simple, but it’s powerful. - -So, adopting these principles is win-win for a team. With one technique, with one investment, you get better tests, and you get the bonus of tackling accessibility. But how does it work? - -## What is Testing with Intent? -Testing with Intent is a testing philosophy that is closely related to the [Guiding Principles of Testing Library](https://testing-library.com/docs/guiding-principles). At a high level, it can be summarised by the following statement: - -

The more your tests resemble the way your software is used, the more confidence they can give you.

— Kent C. Dodds 🌌 (@kentcdodds) March 23, 2018
- -When Testing with Intent, we test from the perspective of a user who intends to do something in our system. You might think of this as similar to writing user stories from the perspective of the user. Consider this illustrative example of a user story: - -> As a user, I want to be able to log out of the system by clicking my avatar and selecting “Log out” from the displayed dropdown menu. - -In Testing with Intent, we approach validating a premise within a test in a similar way. To continue this example, consider how to validate the above story. One of our tests would need to go through the very same steps that a user would take to log out. That is to say the test would locate the avatar on the page, click to open the menu, and click the logout option. While this is a straightforward example, the same principles can be applied to more complex test cases. - -We’re also not only looking to test the positive outcome. In Testing with Intent, we want to validate that the user was able to realise their intended outcome. We should also validate that there were no nasty side-effects along the way. - -Testing with Intent is a subtle yet powerful paradigm shift. A shift away from writing tests that are based on the way we structure code. A shift towards testing based on the way the app is actually used. A shift away from testing the technical implementation details of the software. A shift towards capturing a user’s intention within the test itself. - -There are lots of avenues to explore around the awesome impact of Testing with Intent on testing. For this post, I’ll look at Testing with Intent in web frontend automation testing, which is where Testing Library excels. - -## Meet Testing Library -My journey with Testing with Intent started last year, when I started a new project. My lead, Jim Light, enthusiastically introduced me to *[Testing Library](https://testing-library.com/docs/)*. Testing Library describes themselves as “a family of packages that helps you test UI components in a user-centric way”. And, their [Guiding Principles](https://testing-library.com/docs/guiding-principles) opens with that same statement from Kent C Dodds above: - -> The more your tests resemble the way your software is used, the more confidence they can give you. - -Have you ever experienced a lightbulb moment when suddenly everything just falls into place? That happened to me here. I’ve always found testing UIs to be cumbersome. I’ve found unit testing every component to be really laborious. It never seemed to offer the rewards to justify the effort. But I also love the confidence that you can get from good automation testing. So, I’ve lived in this uneasy place where I hadn’t found my groove with frontend testing. Testing Library changed all that. - -I learnt from Jim. I read the docs. I started implementing tests. It just all made sense. Finally, here was a way of writing the right tests. The tests that give me the confidence that I wanted without costing me hours of tedious work. - -Over the course of the project Jim and I discussed lots of aspects of this approach. Those discussions eventually led to this series of blog posts. We both agreed that the ideas here apply irrespective of whether you use Testing Library; Testing with Intent is a way of approaching testing. But, Testing Library provides a set of tools that makes Testing with Intent much more straightforward in frontends. It’s much easier to capture the intentions of a user when you have tools that help you simulate a user interacting with a system. Because of this, Testing Library is a great pairing for this testing approach, and I’ll focus the rest of this post on that pairing. - -While explaining how this works, I’ll focus on automated integration tests, although Testing Library is actually broader in scope. To be clear, these tests are broader than unit tests as they are testing a slice of the app's functionality. These tests can also be run as part of a build pipeline, including as part of automated PR checks. - -So how do we go about using Testing Library to write tests? - -## The Golden Rule: Wherever possible, use queryByRole -In our automated tests, we need a way to identify the elements on the page that are relevant to the test case in hand. For example, if we want to click a submit button, we need a way of identifying that button in our test before clicking it. Testing Library solves this problem with a collection of helper functions called queries. Queries help us in our search for the relevant elements. - -When you have a range of queries available, the question that follows is, “Which query should I use?” Testing Library has some [great guidance](https://testing-library.com/docs/queries/about#priority) about how to select the right query for the job. It sets out the queries in a prioritised order. However, I’ve gone a step further and boiled that list down into a single golden rule: “Wherever possible, use `queryByRole`". If there's one take away from this post, this is it. Following this rule is powerful. By following it, you create some really positive consequences. - -Some might say this rule is a little crude; Testing Library included a priority list for a reason. But, I think there’s a power to following the rule. So, I’m going to unpack how `queryByRole` works, and why it’s powerful. But before that, it’s about time we see an actual test case! - -## Show me some code! -Okay, time for an example test using Testing Library. For this, consider the following acceptance criteria of a user story: - -> When a user clicks the ‘Dashboards’ link in the app’s navbar, they are navigated to the ‘My Dashboards’ page. - -Here’s that acceptance criteria written out as a test case: - -~~~js - describe('When a user clicks the Dashboards link in the App Navigation', () => { - it('should display the My Dashboards page', async () => { - // This is a library method to render the app for testing - render(); - - - // We identify our Dashboards link - const appNavContainer = screen.getByRole('navigation', { name: 'App' }); - const dashboardsLink = within(appNavContainer).getByRole('link', { name: 'Dashboards' }); - - // We use the user-event library to simulate user interactions - userEvent.click(dashboardsLink); - - // By convention, our document has a single h1 element that identifies which page we are on. - // So, we wait for navigation, after which the dashboards heading should appear. - // Otherwise the test fails. - const dashboardPageHeading = await screen.findByRole('heading', { level: 1, name: 'My Dashboards' }); - expect(dashboardPageHeading).toBeInTheDocument(); - }); - - it('should display the current users Dashboards', async () => { - // ... etc ... -~~~ -Hopefully, you’ve found this code fairly intuitive to read. There’s a couple of key qualities for tests in this style that I’d like to highlight. - -First of all, you’ll see that I’m sticking to my principles and always following the golden rule. I’m using `queryByRole`, either `getByRole` or `findByRole` in this test case. - -And secondly, isn’t it simple? Sure, the tests require some extra setup that I haven’t shown. We have a test harness that would help us to mock out parts of the application. That’s always necessary for integration tests. But the test cases themselves really do read like this. They’re simple, and they read like a user interacting with the system. - -This brings us nicely back to what I mean when I say that we are testing with User Intent. - -## Testing with Intent: working with user intentions -To explain this, I need you to put yourself in the shoes of the user in our acceptance criteria: - -> When a user clicks the ‘Dashboards’ link in the app’s navbar, they are navigated to the ‘My Dashboards’ page. - -How would you do this? This question isn’t as silly as it sounds. We, as citizens of the internet, have shared [Mental Models](https://blog.scottlogic.com/2023/08/11/mental-models-and-the-user-experience.html) about the way web pages work. Certain things have a “proper” place. In this example, we generally expect a website’s navigation to be in a bar at the top of the page. - -So, if we think of a someone who intends to click the “Dashboards” link, almost every user will: - -1. Look to the top of the page, where they expect the navigation bar to be -1. Within the navigation bar, scan the available links to find the relevant one -1. Click it -1. Wait for the new page to load - -![The steps taken to navigate using a the navigation bar]({{ site.github.url }}/sgladstone/assets/twi-three-steps-to-navigate.png) - -If you go back and look through the test case above, you’ll see that these steps match up exactly with the steps that are coded into the test. This is by design and is exactly what I mean when I talk about Testing with Intent. - -This also lives up to the [Guiding Principles of Testing Library](https://testing-library.com/docs/guiding-principles): - -> The more your tests resemble the way your software is used, the more confidence they can give you. - -Testing in this style is great for our confidence in the product we are shipping. We are actually testing the way we intend a user to interact with the system. - -But why is this great for our test confidence? To dig into that we need to consider when we want our tests to fail. - -## We want tests that fail for the right reasons -The whole reason we spend lots of time writing tests is the confidence they give us. We need to feel confident that our carefully crafted code works. We need to feel confident that nothing is going to blow up when we ship the shiny new version of our app. We need to feel confident that the only changes our users experience are the fancy new features we’ve added. - -This is key: our application is only broken if something is broken for our users. Our tests should reflect this; our test failures should indicate that something unexpected has changed for our users. A test failure should say that the way a user experiences the app has changed. - -We write our tests to make us feel confident that this is the case. We need to ensure that our app's existing functionality still works. We need to ensure that rules that define our business logic function correctly. We need to ensure that the user experience is consistent. We need to ensure that our acceptance criteria are all being still met. - -Now the opposite of the above is also true. We should never have a test failure if nothing has broken for our users. Have you ever been frustrated by a test that failed due to some unrelated technical change? It’s annoying, and it also costs a lot of time to fix all these incorrectly broken tests. - -But this shouldn't happen. You should be free to dream up whatever whacky technical changes are needed without generating test failures. To go to a theoretical extreme, you should even be able to rewrite your application from Angular to React, with only very minimal changes to your actual test cases. - -## Our tests are failing for the right reasons -Okay, so coming back to the test case we looked at above. When will it fail? - -~~~js -it('should display the My Dashboards page', async () => { - render(); - - const appNavContainer = screen.getByRole('navigation', { name: 'App' }); - const dashboardsLink = within(appNavContainer).getByRole('link', { name: 'Dashboards' }); - - userEvent.click(dashboardsLink); - - const dashboardPageHeading = await screen.findByRole('heading', { level: 1, name: 'My Dashboards' }); - expect(dashboardPageHeading).toBeInTheDocument(); -}); -~~~ -If we work through the test, we can see that our test suite is going to throw an error, and so cause a failure, when: - -* We don’t have an `appNavContainer`. Our navigation bar has gone missing! -* We don’t have a `dashboardsLink` in our `appNavContainer`. The user has lost the option to navigate to the dashboards page -* Clicking the `dashboardsLink` does not cause the `dashboardPageHeading` to appear on screen. Something has gone wrong with navigating to the correct page. - -That’s it! There’s no other failure conditions. These failure reasons are exactly what we are looking for. In each case, something has gone very wrong for our users. I wouldn’t want to ship the code if any of those cases failed. - -Sure, this doesn’t get rid of test failures entirely. You can break the test by doing something like removing the dashboards link. Perhaps you need to move the link to a different menu. But doing so would invalidate an existing acceptance criteria. If we invalidate an acceptance criteria, we should be changing a test; the expected functionality has changed. - -Great, our test is giving us the sorts of failures we want. But there’s actually a bit more depth here. Why are we getting the failures we want? The answer to that lies in something about the direction the golden rule sets us in. It makes our tests more resilient by directing us to test the right things. But how? That has everything to do with focusing our tests on user intention. - -## Testing with Intent or testing implementation details? -When we Test with Intent, our tests are focussed on the way a user intends to use our app. The opposite of that is testing implementation details. We are testing implementation details when any part of our tests touches something that is part of the technical structure of the app. - -Kent C. Dodds has a great article about [why testing implementation details is bad](https://kentcdodds.com/blog/testing-implementation-details), In it he defines implementation details as follows: - -> Implementation details are things which users of your code will not typically use, see, or even know about. - -So, we are making a clear distinction between technical things—things that help us build our app—and things that users interact with. When creating an app, we carefully architect its structure and write line upon line upon line of code. All this is implementation details. The purpose of all of this work on implementation details is simply to put something interactive in front of a user. - -To use an analogy, think of a light in your room. In this case, our implementation details include most of the light switch, the wiring, the light fixture, and the workings of the bulb. Our interactive elements include the bit of the switch you physically touch, the mechanism to screw in the lightbulb, and whether or not any light is actually being emitted. Those are the only bits that we care about as a user of a lightbulb. Everything else is implementation details. - -Let’s look at a simple technical example of what we mean here. Instead of using the above queries in our test case, we could have got the “Dashboards” link using its ID. Something along the lines of: - -~~~js -document.querySelector('#dashboards-link'); -~~~ -But you should ask yourself, does my user interact with my element’s ID? The answer is the same as for the question, am I avoiding testing implementation details? A user simply does not care about an element’s ID; IDs have no consequence for user experience. So, in this case, the answer is no; you’ve not avoided testing implementation details. - -So how do we avoid testing implementation details? You can consider yourself safe if your test cases: - -* Only touch things that a user would interact with, and -* Only touch those things in a way that a user would. - -As a quick aside, part of the beauty of Testing Library is that it gives us the answer to that second point. The whole point of it is that it is a set of tools that help us to code tests that only touch things in a way that a user would. - -This is what Testing with Intent is about. It’s about focussing our tests on users. It’s about avoiding implementation details. Now why’s that good? - -## Test resilience: saying goodbye to implementation details -We’ve already discussed how our tests are failing for the right reasons if something has broken for our users. Well, when testing implementation details, a test failure does not necessarily mean a change to user experience. - - - - - - - - - - - - -
When Testing…Implementation Details…a test failure means…Something changed in our implementation
User IntentionSomething changed for our users
-There’s some consequences to avoiding testing implementation details. Why’s that? - -* If something is an implementation detail, changing it does not impact our users -* If something doesn’t impact our users, it’s for us! We can do what we want with it. - -Avoiding getting bogged down in technical implementation detail is fantastic for test resiliency. It is very freeing. Have you ever had the experience of making some technical change that caused havoc in a test suite? A change that didn’t impact user functionality but still broke a load of tests? It’s annoying, but it also shouldn’t happen. The technical details should be there for us, the delivery team, to tweak as necessary. - -If you free your tests of implementation details, you free yourself to be able to make sweeping technical changes. You free yourself from having to rewrite tests while refactoring. You are giving yourself the confidence that your sweeping changes haven’t broken anything for your users. So be free. Go wild; re-write your Angular app into React! Why shouldn’t you? (Disclaimer: I take zero responsibility for the outcome of that action!) - -Okay, coming back to Earth now. At this point, you may be thinking something along the lines of, “but the example test case above still looks pretty technical”. This brings us back full circle to our golden rule: *“Wherever possible, use `queryByRole`*”. - -## The golden rule revisited -To better understand why we aren’t testing implementation details, we need to unpack what we mean by a role. The role from `queryByRole` is an element’s [ARIA role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles). Essentially, these roles help to convey some semantic meaning about the purpose of an element. Example roles include `link`, `button` and `dialog`. - -Some HTML elements come with a predefined role. An ``, for example, has the `link` role. Similarly, you can probably guess the role for a `