Open main menu

CDOT Wiki β

Changes

0.1 Release 2012 WebVTT Test Suite

1,166 bytes added, 10:36, 20 September 2012
Introduction
In order to write our parser, we'll need a way to prove it's correct as per the spec. Doing so involves the creation of a spec conformance test suite, consisting of good and bad WebVTT files. Each test file makes sure that a particular part of the spec is true, and forces the parser to do various things.
 
The [http://www.w3.org/QA/WG/2005/01/test-faq#why W3C defines Conformance Testing] as follows:
 
<blockquote>Focuses on testing only what is formally required in the specification in order to verify whether an implementation conforms to its specifications. Conformance testing does not focus on performance, usability, the capability of an implementation to stand up under stress, or interoperability; nor does it focus on any implementation-specific details not formally required by the specification.</blockquote>
 
They [http://www.w3.org/QA/WG/2005/01/test-faq#good go on to say] that good tests are:
 
* Mappable to the specification (you must know what portion of the specification it tests)
* Atomic (tests a single feature rather than multiple features)
* Self-documenting (explains what it is testing and what output it expects)
* Focused on the technology under test rather than on ancillary technologies
* Correct
When writing test files, remember that each test should test only one thing. Make them simple, small, and discrete. All you're doing is writing a WebVTT file with enough data in it to trigger a rule in the parser.
 
Also make sure you capture metadata about your test. What is it testing? Which part(s) of the spec? How did you generate the file? See http://lists.w3.org/Archives/Public/public-texttracks-contrib/2012Aug/att-0000/webvtt_test_cases.html.
== Example ==