Shayan's Software & Technology

My adventure as a Software Engineer continues..,

WebVTT 0.1 Release – Cue Text Testing


The WebVTT tests that we wrote were to test Parsers that were written by the Open Source Community. A TestSuit was created. The test data from the suite will be used when we begin to develop our own WebVTT Parser in C/C++. Our group is responsible for testing the cue text portion of a .vtt file. I personally tested the escape characters.  The test cases were divided into groups to tackle a specific area of the WebVTT specification.

A Link to the WebVTT specification can be found here:

A Link to the Online JavaScript Based WebVTT parser can be found here.

Testing Format

Before testing can be done there needs to be a set of rules defined for how the tests are going to be coordinated. We need to ultimately feed the parser with VTT files and analyze the input and judge whether or not the behavior we want exists in the parser or do we need to change something. The filenames of the vtt files need to follow a format so that some form of indexing and cataloging exists within our large team. Together, we came up with the following file format.

tc + 1 Digit Group Number + 3 Digit Test Case Number + <Description of Test Case Separated with underscores>



This however was not enough. It simply is not enough to write a vague description in the filename. There also needs to be an area within the VTT file where we can write comments to better explain what is being tested and how it related to the WebVTT specification. Normal VTT files do not support comments, so we had to create our own filetype. This filetype is the .test file. a .test file contains the ability to add comment descriptions in between “/*” “*/” characters. These characters must appear on the first line of a test file with no trailing or preceding characters including white space or newlines. The parser does not need to be modified because a script simply replaces the .test extension with a .vtt extension and strips away the comment so that “WEBVTT” is the first line in the new .vtt file and runs it through the parser.

Here is one of my .test files:

WebVTT Specification Version:
WebVTT – Living Standard Last Updated 2 October 2012

Relates to:
Cue Text Escape Characters:

Incorrect Space Character Escape : ‘&nsp;’ instead of ‘&nbsp;’

00:11.000 –> 00:13.000
Test Space Character escape: &nsp;

Now I can begin testing.

My Role in Testing

My duty in testing the WebVTT parser was ensuring that the special characters detailed in the specification were implemented in the parser. Characters such as Ampersand and Space character need to be escaped when you want to display them in a caption. so if you wanted to display “&” you would type: “&amp;”. To my surprise I noticed that the JavaScript parser did not recognize some valid escapes listed in the specification. These escapes were: Space Character (&nbps;), Left to Right Mark (&lrm;) and Right to Left Mark (&rlm;). These issues were then reported so that they can be implemented in our parser. My testing included testing every possible combination of an invalid escape sequence and to ensure the parser considers this invalid instead of outputting garbage to the users In our case: people watching online videos.

Here is my test of the Ampersand Character Escape (Note that these are 6 .vtt files):


00:11.000 –> 00:13.000
Test Ampersand escape: &a;

00:11.000 –> 00:13.000
Test Ampersand escape: &am;


00:11.000 –> 00:13.000
Test Ampersand escape: &m;

00:11.000 –> 00:13.000
Test Ampersand escape: &mp;

00:11.000 –> 00:13.000
Test Ampersand escape: &p;

00:11.000 –> 00:13.000
Test Ampersand escape: &ap;

Still Interested? Here is our Wiki Page for our group.,_including_replacements


Learning Git. I had previously worked with Git and GitHub but not in great detail. I sure had a lot to learn with this project and i’m very happy I had to opportunity to truly understand how it works. I’m still learning but i’m sure with time I will be an expert!

Developing on Windows. This was rather annoying because we needed to use a Linux simulated environment in order to run the commands that were needed to run makefiles, git and all the other sorts of Linux specific jazz. I had to therefore shift some of my development to my mac book. As you may know that the MAC OS Terminal application supports UNIX commands which made my life a bit easier.

Communication: In order to work on a large scale project such as this you need to be able to communicate with a lot of different people at the same time. To solve this problem we used IRC and we used the IRC server to meet up and discuss the project together. This was my first time on Irc and I found it to be pretty engaging and fun. It’s not everyday you can talk to you professor in real – time away from a class environment!

All in all, these weren’t really challenges but learning experiences, and I hope to have more soon for the 0.2 Release!.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: