W3C

Guidelines for writing device independent tests

Editors:
Carmelo Montanez, National Institute of Standards and Technology

Abstract

This is a supporting document for authors of tests in the Mobile Web Test Suites Working Group. It defines the key properties for Mobile web tests. It proposes various guidelines for tests authors to follow when writing tests.

Status of this document

These guidelines were produced by members of the Mobile Web Test Suite working group which is part of the Mobile Web Initiative (see About).

Comments on, and discussions of this document can be sent on the (archived) public mailing list public-mwts@w3.org (see instructions). W3C Members can also send comments directly to the Mobile Web Test Suites working group.

These guidelines represent the current thinking of the working group and as such may be updated, replaced or rendered obsolete by other W3C documents at any time. Its publication does not imply endorsement by the W3C membership or the Mobile Web Test Working Group.

Patent disclosures relevant to the Mobile Web Test Suites Working Group may be found on the Working Group's public patent disclosure page.

Table of contents

1.0 Overview

This document provide a set of guidelines for writing effective and comprehensive tests for Mobile devices. They should be followed as much as possible. These guidelines are intended for writing mobile devices tests and should not be taken as general guidelines for non mobile devices tests.

2.0 Guidelines

2.1 Simplicity

Tests should be simple and evaluate a specific feature of the specifications.

2.2 Device Independent

Tests should be in conformance to the specifications it is targeting. No test should be dependent on any device and/or browser in particular.

2.3 Self Explanatory

Test users should be able to run the tests without having a deep understanding of the specifications.

2.4 Technical Explantions

Test cases should not provide a lot of technical explantions in teh text given the limited screen space available.

2.5 Expected Results

The tests should be self explanatory of what the expected results should be. Whenever alternate expected results are possible, it should also be self explanatory.

2.6 Short

Test should contain the minimum number of lines necessary to evaluate the feature.

2.7 Scrolling and Pagination

Scrolling and pagination should be keep to a minimum unless the test is specifically addressing those features.

2.8 Validity

Tests should be positive, that is conformant to the addressed specifications, unless they are specifically designed to catch negative/error conditions.

2.9 Error Conditions

Whenever a test is addressing an error condition, it should clearly indicate so.

2.10 Link to Specifications

Whenever possible a test should contain a link back to the specific area of the specifications it is evaluating.

2.11 Background Coloring

Whenever possible tests should not contain background colors as part of the test as some colors (such as red and green) are usually used to indicate pass/failure.

2.12 Green Coloring as Part of Execution Results

Whenever possible execution results should use green coloring to indicate success.

2.13 Red Coloring as Part of Execution Results

Whenever possible execution results should use red coloring to indicate failure.

2.14 Yellow Coloring as Part of Execution Results

Whenever possible execution results should use yellow coloring to indicate uncertain results.

2.15 Encoding

Tests should use UTF-8 or UTF-16 encoding as much as possible unless the feature under test is encoding.

2.16 Special Fonts

Tests should be written as to avoid any special fonts unless the purpose of the test is to evaluate special fonts.

2.17 Long Tests

In general test should be short in nature. However For tests that must be long (e.g. scrolling tests), it is important to make it clear that the filler text is not relevant, otherwise the tester may think he is missing something and therefore waste time reading the filler text. Good text for use in these situations is, quite simply, "This is filler text. This is filler text. This is filler text.". If it looks boring, it's working!

2.18 Unobvious Tests

Test writers should avoid test, whose purpose and expected results are not obvious. For instance a test for which half of a sentence is normal text and the other half is half bold is not very obvious. Exception will be tests, whose nature and purpose will require such combinations.

Test writers should provide an easy, non-obstrusive navigation across test cases.

2.20 Test Harness

Test writers should provide a test harness, that loads one test case at a time rather than many at once.

2.21 Naming conventions

In general test writers should avoid cryptic test names. It is suggested that tests follow a test-topic-xxx.ext where:

where: