1. Introduction
There are currently many test procedures and tools available which aid their users in testing web content for conformance to accessibility standards such as the Web Content Accessibility Guidelines (WCAG) [WCAG] . As the web develops in both size and complexity, these procedures and tools are essential for managing the accessibility of resources available on the web.
This format is intended to enable a consistent interpretation of how to test for accessibility requirements and promote consistent results of accessibility tests. It is intended to be used to describe both manual accessibility tests as well as automated tests performed by accessibility testing tools (ATTs).
Describing how to test certain accessibility requirements will result in accessibility tests that are transparent, with test results that are reproducible. The Accessibility Conformance Testing (ACT) Rules Format defines the requirements for these test descriptions, known as Accessibility Conformance Testing Rules (ACT Rules).
2. Scope
The ACT Rules Format defined in this specification is focused on the description of rules that can be used in testing content created using web technologies, such as Hypertext Markup Language [HTML] , Cascading Style Sheets [CSS2] , Accessible Rich Internet Applications [WAI-ARIA] , Scaleable Vector Graphics [SVG2] and more, including digital publishing. The ACT Rules Format, however, is designed to be technology agnostic, meaning that it can conceivably be used to describe test rules for other technologies.
The ACT Rules Format can be used to describe ACT Rules dedicated to testing the accessibility requirements defined in Web Content Accessibility Guidelines [WCAG] , which are specifically designed for web content. Other accessibility requirements applicable to web technologies can also be testable with ACT Rules. For example, ACT Rules could be developed to test the conformance of web-based user agents to the User Agent Accessibility Guidelines [UAAG20] . However, the ACT Rules Format may not always be suitable to describe tests for other types of accessibility requirements.
Because ACT Rules rarely test the entirety of an accessibility requirement, passing ACT rules does not necessarily mean that an accessibility requirement is met. It is important to understand that ACT Rules test non-conformance to accessibility requirements. In some cases conformance can be inferred from the absence of failures. Unlike WCAG sufficient techniques, ACT Rules can not be used for conformance claims unless the rule explicitly states it can be used that way. See Rule Aggregation for details.
3. ACT Rule Types
In accessibility, there are often different technical solutions to make the same type of content accessible. These solutions could be tested in a single rule; however, such a rule tends to be quite complex, making it difficult to understand and maintain. The ACT Rules Format solves this by providing two types of rules:
-
Atomic rules describe how to test a specific type of solution. It contains a precise definition of what elements, nodes or other parts of a web page are to be tested, and when those elements are considered to fail the rule. These rules should be kept small and atomic. Meaning that atomic rules test a single "failure condition", and do so without using results from other rules.
-
Composite rules describe how results from atomic rules should be used to decide if an accessibility requirement was failed. If there are multiple failures necessary for an accessibility requirement to fail, each "type" of failure should be written as separate atomic rules, and the logic for determining the ´pass´ or ´fail´ for the accessibility requirement, across the atomic rules, should be handled by a composite rule.
The
separation
between
atomic
rules
and
composite
rules
creates
a
division
of
responsibility.
Atomic
rules
test
if
web
content
is
correctly
implemented
in
a
particular
solution.
Composite
rules
test
if
a
combination
of
pass
outcomes
from
atomic
rules
is
sufficient
for
an
accessibility
requirement
not
to
fail
.
Not
all
atomic
rules
have
to
be
part
of
a
composite
rule.
Atomic
rules
only
have
to
be
part
of
a
composite
rule
if
failing
that
atomic
rule
does
not
directly
fail
Accessibility
Requirements
.
An
atomic
rule
MAY
be
part
of
multiple
composite
rules.
Composite rule: Header cells in HTML tables ( WCAG 2 Success Criterion 1.3.1 ).
This rule uses results from the following atomic rules:
- Header indicated through implicit scope
-
Header
indicated
through
the
scope
attribute -
Header
indicated
by
using
the
headers
attribute - Header indicated by using ARIA labels
If any one of these rules passes, the test result of the composite rule for the table cell is "passed".
4. ACT Rule Structure
ACT Rules MUST be written in an format that conforms to the Web Content Accessibility Guidelines [WCAG] or a comperable accessibility guidelines recommendation. ACT test cases are allowed to contain inaccessible content. If any test case contains accessibility issues listed in WCAG 2.1 Section 5.2.5 Non-Interference , users MUST be warned of this in advance. Using an accessibility format supports people with disabilities. It also makes internationalisation of ACT rules easier.
An ACT Rule MUST consist of the following items.
-
Descriptive Title
-
Accessibility Requirements , if any
-
Aspects Under Test (for atomic rules) OR Atomic Rules List (for composite rules)
-
Accessibility Support (optional)
5. Rule Identifier
An ACT Rule MUST have a unique identifier that can be any unique text value, such as plain text, URL or a database identifier.
6. Rule Description
An ACT Rule MUST have a description that is in plain language and provides a brief explanation of what the rule does.
7. Accessibility Requirements
Accessibility
requirements
are
just
that:
A
requirement
that
a
particular
web
page
must
conform
to
for
it
to
be
considered
accessible.
This
can
(and
usually
does)
include
the
WCAG
success
criteria.
Often
organizations
have
additional
requirements
which
may
come
from
different
sources,
such
as
local
laws,
internal
standards,
etc.
These
too
are
considered
accessibility
requirements
and
can
be
tested
using
the
ACT
Rules
Format.
What
the
precise
requirements
are
for
any
test
is
beyond
the
scope
of
the
ACT
Rules
Format.
Atomic
rules
and
composite
rules
SHOULD
identify
the
accessibility
requirements
that
fail
are
not
satisfied
when
the
outcome
of
a
rule
is
Fail.
An
ACT
Rule
is
a
complete
or
partial
test
for
one
or
more
accessibility
requirements.
This
means
that
most
ACT
rules
test
only
part
of
an
accessibility
requirement,
but
it
MUST
NOT
test
more
than
the
accessibility
requirement
it
lists.
Because
ACT
Rules
often
have
a
smaller
scope
than
the
accessibility
requirement
they
test,
passing
a
rule
does
not
necessarily
mean
that
the
accessibility
requirement
has
passed.
is
satisfied
.
ACT
Rules
MUST
indicate
when
whether
or
not
they
can
not
be
used
to
determine
that
the
accessibility
requirement
passed.
is
satisfied
.
The following rule could not be used to satisfy WCAG 2.1 Success criterion 2.4.2 Page Titled
This rule tests that an HTML page has a
title
element.
The following rule could be used to satisfy WCAG 2.1 Success criterion 2.4.2 Page Titled
This rule tests that the first
title
element of an HTML page describes the topic or purpose of that page.
Outcomes
from
an
ACT
Rule
SHOULD
MUST
be
consistent
with
the
accessibility
requirement,
e.g.
a
rule
only
returns
the
outcome
Fail
when
the
content
fails
does
not
satisfy
the
accessibility
requirement.
If
an
ACT
Rule
indicates
it
can
be
used
to
satisfy
the
accessibility
requirement,
a
Pass
or
Inapplicable
result
for
that
rule
MUST
satisfy
the
accessibility
requirement.
This means that the rule maps to the accessibility requirement, as opposed to it merely being related to the requirement, thematically or otherwise. Because of this, atomic rules used in composite rules often do not map to any accessibility requirement. Failing the composite rule fails the accessibility requirement, but failing any of its atomic rules may not. In such cases the atomic rules MUST NOT list the accessibility requirements. These could be provided as background information instead.
The ACT Rule is a best practice that is not required by any accessibility standard
The ACT Rule is an atomic rule and its result is used in a composite rule that does map to an accessibility requirement. See: ACT Rule Types
8. Aspects Under Test (Atomic rules only)
An aspect is a distinct part of the test subject or its underlying implementation. For example, rendering a particular piece of content to an end user involves multiple different technologies, some or all of which may be of interest to an ACT Rule. Some rules need to operate directly on the Hypertext Transfer Protocol [http11] messages exchanged between a server and a client, while others need to operate on the Document Object Model [DOM] tree exposed by a web browser. Rules may need to operate on several aspects simultaneously, such as both the HTTP messages and the DOM tree.
Atomic rules MUST list the aspects used in the applicability and expectations .
Some aspects are already well defined in a formal specification within the context of web content, such as HTTP messages, DOM tree, and CSS styling [CSS2] . These do not warrant a detailed description further than a reference to the corresponding section in this specification (see Common Aspects under Test ).
For other aspects that are not well defined, an ACT Rule MUST include either a detailed description of the aspect in question or a reference to to a well defined description.
Test aspects for a rule that checks if a transcript is available for videos:
- DOM Tree
- CSS Styling
- Audio output
- Visual output
Test aspects for a rule that checks for use of (language specific) generic link texts like "click here" and "more":
- DOM Tree
- CSS Styling
- Language
9. Atomic Rules List (Composite rules only)
A composite rule uses results from atomic rules and applies a logic to them so that for each test target a single outcome can be determined. The identifiers of each atomic rules used in the expectations MUST be listed in the composed rule. The atomic rules list describes the input for composed rules, similar to how aspects under test describe the input for atomic rules.
10. Applicability
The applicability describes "what" (parts of) the test subject should be tested (the test target).
10.1. Applicability for Atomic Rules
The applicability section is a required part of an atomic rule . It MUST contain a precise description of the parts of the test subject to which the rule applies. For example, specific nodes in the DOM [DOM] tree, or tags that are incorrectly closed in an HTML [HTML] document. These are known as the test targets . The applicability MUST only use information provided through test aspects of the same rule. No other information should be used in the applicability.
Applicability
MUST
be
described
objectively,
unambiguously
and
in
plain
language.
When
a
formal
syntax,
such
as
a
CSS
selector
[css3-selectors]
or
XML
Path
Language
[XPATH]
,
can
be
used,
that
(part
of
the)
applicability
MAY
use
that
syntax
in
addition
to
the
plain
language
description.
While
testing,
if
nothing
within
the
test
subject
matches
the
applicability
of
the
rule,
the
outcome
is
inapplicable
.
An objective description is one that can be resolved without uncertainty in a given technology. Examples of objective properties in HTML are element names, their computed role, the spacing between two elements, etc. Subjective properties on the other hand, are concepts like decorative, navigation mechanism and pre-recorded. Even concepts like headings and images can be misunderstood. For example, describing that the rule examines the tag name, the accessibility role, or the element’s purpose on the web page. The latter of which is almost impossible to define objectively. When used in applicability, these concepts MUST have an objective definition. This definition can be part of a larger glossary shared between rules.
The applicability of an atomic rule testing WCAG 2.1 Audio Control:
Any
video
oraudio
element(s) with theautoplay
attribute, as well as anyobject
element(s) that is used for automatically playing video or audio when the web page loads.
10.2. Applicability for Composite Rules
A composite rule defines how the outcomes from its atomic rules are used to determine a single outcome for each applicable test target.
The applicability of a composite rule is defined as the union of all the applicability sections of its atomic rules . Because of this, applicability of a composite rule can be inferred from the atomic rules it uses results from. Since the applicability can be inferred, rule authors MAY omit applicability for a composite rule. This can be useful if it is difficult to express the combined applicability in plain language.
Note that atomic rules in a composite rule MAY have different applicability. Because of this, not every element applicable within the composite rule is tested by every atomic rule.
A
composite
rule
about
img
elements
uses
results
from
atomic
rules
that
have
the
following
applicability:
-
Atomic
rule1
:
All
img
element with analt
attribute -
Atomic
rule1
:
All
img
element without analt
attribute
The applicability of the composite rule combines the applicability of both atomic rules. This becomes:
All
img
elements.
11. Expectations
The expectations describe what the requirements are for the test targets defined in the applicability section.11.1. Expectations for Atomic Rules
An atomic rule MUST contain one or more expectations. An expectation is an assertion that must be true about each test target (see Applicability ). Each expectation MUST be distinct, unambiguous, and be written in plain language. Unlike in applicability, a certain level of subjectivity is allowed in expectations. Meaning that the expectation has only one possible meaning, but that meaning isn’t fully quantifiable.
When
all
expectations
are
true
for
a
test
target,
the
test
target
passed
the
rule.
If
one
or
more
expectations
are
false,
the
test
target
failed
the
rule.
If
the
atomic
rule
is
used
in
a
composed
rule
,
the
composed
rule
may
be
passed
when
the
atomic
rule
failed
,
depending
on
the
applicability
and
[exxpectations-composed]
of
the
composed
rule.
A
rule
for
labels
of
HTML
input
elements
may
have
the
following
expectations:
- The test target has an accessible name (as described in Accessible Name and Description: Computation and API Mappings 1.1 ). [accname-aam-1.1]
- The accessible name describes the purpose of the test target.
An atomic rule expectation MUST only use information available in the test aspects , from the applicability, and other expectations of the same rule. No other information can be used in the expectation. So for instance, an expectation could be "Expectation 1 is true and ...", but it can’t be "Rule XYZ passed and ...". This ensures the rule is encapsulated.
11.2. Expectations for Composite Rules
A
composite
rule
MUST
contain
one
or
more
expectations
that
describes
the
logic
that
is
used
to
determine
a
single
pass
or
fail
result
based
on
the
results
of
its
atomic
rules
.
An
expectation
is
an
assertion,
written
in
plain
language,
that
must
be
true
about
the
outcomes
of
atomic
rules
listed
in
atomic
rules
list
.
A
composite
rule
expectation
MUST
NOT
use
information
from
test
aspects
or
from
the
test
applicability
.
When
all
expectations
are
true
for
a
test
target,
the
test
target
passed
the
rule.
If
one
or
more
expectations
is
false,
the
test
target
failed
the
rule.
This
works
the
same
way
for
atomic
rules.
A composite rule for WCAG 2.1 Audio Description or Media Alternative applies a logic across results from three atomic rules. The expectation of the composite rule is as follows:
For each test target, the outcome of one of the following rules is
passed
:
- Video elements have an audio description (video-audio-desc)
- Video elements have a media alternative (video-text-alt)
12. Limitations, Assumptions or Exceptions
An ACT Rule MUST list any limitations, assumptions or any exceptions for the test, the test environment, technologies being used or the subject being tested. For example, a rule that would partially test WCAG 2.0 Success Criterion 1.4.3 Contrast (Minimum) based on the inspection of CSS properties could state that it is only applicable to HTML text content stylable with CSS, and that the rule does not support images of text.
Sometimes there are multiple plausible ways that an accessibility requirement can be interpreted. For instance, it is not immediately obvious if emoji characters should be considered "text" or "non-text content" under WCAG 2.0. Whatever the interpretation is, this MUST be documented in the rule.
13. Accessibility Support
ACT Rules are designed to test the conformance of content using web technologies to accessibility requirements. However, not every feature of a web technology is implemented in all assistive technologies or user agents that a website may need to support. The concept of accessibility supported use of a Web technology is defined in WCAG [WCAG] . Because of this, ACT Rules are not necessarily applicable in all test scenarios. For instance, a web page that has to work in assistive technologies that have no WAI-ARIA [WAI-ARIA] support, wouldn’t be tested with an ACT Rule that relies on WAI-ARIA support, since this rule could give results that are inconsistent with the accessibility experience of users of those assistive technologies.
Even within a composite rule , some atomic rules may not always be applicable. This leaves one fewer solution for passing that particular composite rule. To support users of ACT Rules in properly defining the accessibility support baseline in their test scenarios, an ACT Rule SHOULD include a warning if there are significant accessibility support concerns known about a rule.
14. ACT Data Format (Output Data)
With ACT Rules, it is important that data coming from different sources can be compared. By having a shared vocabulary, accessibility data that is produced by different auditors can be compared and, where necessary, aggregated. Therefore, every ACT Rule MUST express the output in a format that has all of the features described in the ACT Data Format.
Rules are tested in two steps. Firstly, the applicability is used to find a list of Test Targets (elements, tags or other "components") within the web page or other test subject . Then each test target is tested to see if all of the expectations are true. This will give the outcome for each test target. For contextual information, the output data must also include test subject and the rule identifier .
This will mean that every time a rule is executed on a page, it will return a set with zero or more results, each of which MUST have at least the following properties:
-
Rule Identifier (test)
-
Test Subject (Web page)
-
Test Target (pointer)
-
Outcome (
Passed
,Failed
, orInapplicable
)
{ "@context" : "https://raw.githubusercontent.com/w3c/wcag-act/master/earl-act.json" , "@type" : "Assertion" , "subject" : "https://example.org/" , "test" : "auto-wcag:rules/SC1-1-1-css-image.html" , "result" : { "outcome" : "Failed" , "pointer" : "html > body > h1:first-child" } }
14.1. Test Subject
When a single URL can be used to reference the web page, or other test subject, this URL MAY be used. In scenarios where more complex actions are required to obtain the test subject (in the state that it is to be tested), it is left to ATT developers to determine which method is best used to express the test subject.
14.2. Test Target
When representing the test target in the output data, it is often impractical or impossible to serialize the test target as a whole. Instead of this, a pointer can be used to indicate where the test target exists within the web page or other test subject . There are a variety of pointer methods available, such as those defined in Pointer Methods in RDF 1.0 [Pointers-in-RDF] .
The pointer method used in the output data of an ACT Rule MUST include the pointer method used in Test cases .
14.3. Outcome
The definition of a rule MUST always result in one of the following outcomes:
-
Passed : All expectations for the Test Target were true
-
Failed : One or more expectations for the Test Target was false
-
Inapplicable : There were no Test Targets in the Test Subject
Passed
Failed
and
Inapplicable
,
[EARL10-Schema]
also
defined
an
Incomplete
outcome.
While
this
should
never
be
the
outcome
of
a
rule
when
applied
in
its
entirety,
it
often
happens
that
rules
are
only
partially
executed.
For
example,
when
applicability
was
automated,
but
the
expectations
have
to
be
evaluated
manually.
Such
"interim"
results
can
be
expressed
with
the
"Incomplete"
outcome.
15. Rule Quality Assurance
15.1. Test Cases (Atomic rules only)
Test cases are (snippets of) content that can be used to validate the implementation of an atomic rule . They consist of two pieces of data, a snippet of each test aspect for a rule, and the expected result that should come from that rule. Test cases serve two functions, firstly as example scenarios for readers to understand when a rule passes, when it fails, and when it is inapplicable. But also for developers and users of automated accessibility test tools to validate that a rule is correctly implemented.
When executing a test, the test aspect(s), for instance an HTML code snippet, is evaluated by applying the rule’s applicability and expectations . The result is then compared to the expected result of the test case. The expected result consists of a list of test targets and the expected outcome (Passed, Failed, Inapplicable) of the evaluation.
15.2. Accuracy Benchmarking
The web is ever changing, and technologies are used in such diverse and creative ways that it is impossible to predict in advance, all the ways that accessibility issues can occur and all the ways they can be solved for. When writing ACT Rules, it is almost inevitable that exceptions will be overlooked during the design of a rule, or that new technologies will emerge that introduce new exceptions.
This makes it important to be able to regularly test if the rule has the accuracy that is expected of it. This can be done by benchmark testing. In benchmark testing, the accuracy of a rule is measured by comparing its results to those obtained through accessibility expert testing.
The accuracy of a rule is the average between the false positives and false negatives, which are in turn calculated as follows:
-
False positives : This is the percentage of test targets , that were failed by the rule, but were not failed by an accessibility expert.
-
False negatives : This is the percentage of test targets, that were passed by the rule, but were failed by an accessibility expert.
There are several ways this can be done. For instance, accessibility test tools can implement a feature which lets users indicate that a result is in error, or pages that for which accessibility results are known, can be tested using ATT, and the results are compared. To compare results from ACT Rules to those of expert evaluations, data aggregation may be necessary.
16. Rule Aggregation
As described in section §14 ACT Data Format (Output Data) a rule will return a list of results, each of which contain 1) the Rule ID , 2) the test subject , 3) the test target , and 4) an outcome (Passed, Failed, Inapplicable). Data expressed this way has a great deal of detail, as it gives multiple pass / fail results for each rule.
Most expert evaluations do not report results at this level of detail. Often reports are limited to giving a single outcome (Passed, Failed, Inapplicable) per page, for each success criteria (or other accessibility requirement). To compare the data, results from rules can be combined, so that they are at the same level.
When all rules pass, that does not mean that all accessibility requirements are met. Only if the rules can test 100% of what should be tested, can this claim be made. Otherwise the outcome for a criterion is inconclusive.
Example: An expert evaluates a success criterion to fail on a specific page. When testing that page using ACT Rules, there are two rules that map to this criterion. The first rule returns no results. The second rule finds 2 test targets that pass, and a 3rd test target that fails.
In this example, the first rule is inapplicable (0 results), and the second rule has failed (1 fail, 2 pass). Combining this inapplicable and fail, means the success criterion has failed.
See Appendix 1: Aggregation examples, using JSON-LD and EARL on how this could be expressed using JSON-LD and EARL.
17. Update Management
17.1. Change Log
It is important to keep track of changes to the ACT rules so that users of the rules can understand if changes in test results are due to changes in the rules used when performing the tests, rather than changes in the content itself. All changes to an ACT Rule that can change the outcome of a test MUST be recorded in a change log. The change log can either be part of the rule document itself or be referenced from it.
Each new release of an ACT Rule MUST be identifiable with either a date or a version number. Additionally, a reference to the previous version of that rule MUST be available. For extensive changes, a new rule SHOULD be created and the old rule SHOULD be deprecated.
Example:
An
example
of
when
a
new
rule
should
be
created
is
when
a
rule
that
tests
for
the
use
of
a
blink
element
changes
to
instead
look
for
any
animated
style
changes.
This
potentially
adds
several
new
failures
that
were
previously
out
of
scope.
Using
that
same
rule
as
an
example,
adding
an
exception
to
allow
blink
elements
positioned
off
screen
should
be
done
by
updating
the
existing
rule.
17.2. Issues List
An ACT Rule MAY include an issues list. When included, the issues list MUST be used to record cases in which the ACT Rule might return a failure where it should have returned a pass or vice versa. There are several reasons why this might occur, including:
-
Certain scenarios or the use of technologies that are very rare and were not included in the rule for that reason.
-
Certain accessibility features are impossible to test within the test environment. For instance, they might only be testable by accessing the accessibility API, require screen capturing, etc.
-
The scenario did not exist (due to changing technologies) or was overlooked during the initial design of the rule.
The issues list serves two purposes. For users of ACT Rules, the issues list may give insight into why an inaccurate result occurred, as well as provide confidence in the result of that rule. For the designer of the rule, the issues list is also useful to plan future updates to the rule. In a new version of the rule, resolved issues would be moved to the change log.
Appendix 1: Aggregation examples, using JSON-LD and EARL
Example:
{ "@context" : "https://raw.githubusercontent.com/w3c/wcag-act/master/earl-act.json" , "@type" : "Assertion" , "subject" : "https://example.org/" , "test" : "auto-wcag:SC1-1-1-css-image.html" , "result" : { "outcome" : "Failed" , "source" : [{ "test" : "auto-wcag:SC1-1-1-css-image.html" , "result" : { "outcome" : "Failed" , "pointer" : "html > body > h1:first-child" } }, { "test" : "auto-wcag:SC1-1-1-css-image.html" , "result" : { "outcome" : "Passed" , "pointer" : "html > body > h1:nth-child(2)" } }] } }
Example: Aggregate rules to a WCAG success criterion
{ "@context" : "https://raw.githubusercontent.com/w3c/wcag-act/master/earl-act.json" , "@type" : "Assertion" , "subject" : "https://example.org/" , "test" : { "@id" : "wcag20:#text-equiv-all" , "title" : "1.1.1 Non-text Content" }, "result" : { "outcome" : "Failed" , "source" : [{ "test" : "auto-wcag:SC1-1-1-css-image.html" , "result" : { "outcome" : "Failed" , "pointer" : "html > body > h1:first-child" } }, { "test" : "auto-wcag:SC1-1-1-longdesc.html" , "result" : { "outcome" : "Passed" , "pointer" : "html > body > img:nth-child(2)" } }] } }
Example: Aggregate a list of results to a result for the website
{ "@context" : "https://raw.githubusercontent.com/w3c/wcag-act/master/earl-act.json" , "@type" : "Assertion" , "subject" : { "@type" : [ "WebSite" , "TestSubject" ], "@value" : "https://example.org/" } "test" : "http://www.w3.org/WAI/WCAG2A-Conformance" , "result" : { "outcome" : "Failed" , "source" : [{ "test" : "wcag20:text-equiv-all" , "result" : { "outcome" : "Failed" , "source" : [ …] } }, { "test" : "wcag20:media-equiv-av-only-alt" , "result" : { "outcome" : "Passed" , "source" : [ …] } }, { "test" : "wcag20:media-equiv-captions" , "result" : { "outcome" : "Inapplicable" , "source" : [ …] } }, …] } }