Testing SVG — Lessons Learned

Written by: Shona McPherson and Craig Dixon, Schema Software Inc.

With the move towards Web publishing with more sophisticated graphical content, there is a prevalent need to convert existing vector graphic formats to and from SVG. This is normally done by adding import and export filters to existing graphic applications. The development of SVG importers and exporters presents a unique set of testing challenges. This presentation will address "lessons learned" that could benefit the testing of any application that reads or writes SVG. Items covered will include procedures implemented and challenges encountered at almost every stage of the software engineering life cycle.

Schema Software Inc.'s core business is the development of file format parsers, translators, and converters. These projects have included the production of a number of SVG importers and exporters. SchemaSoft's Quality Assurance team plays a role in all of the company's software development projects, and as a result has gained extensive experience in testing the importing and exporting of SVG.

The main testing objectives in most of the SVG export projects have been to ensure valid and well-formed SVG, and to maintain high visual fidelity of the exported SVG to the input format. It is also necessary to consider the applications that are intended to consume the SVG. For example, SVG may be constructed differently for an SVG viewer than a graphics-editing application that reads SVG. Testing must be tailored to different objectives, and the lessons learned will be discussed. Among the many projects SchemaSoft has undertaken, the company has developed and currently licenses a Metafile to SVG Converter which will be used to illustrate the SVG export testing experience.

Testing SVG importers presents its own set of challenges. There are often multiple ways of constructing SVG that have the same visual representation. This can lead to an almost infinite number of variations in SVG that may be imported. There are usually fidelity compromises when features are mapped to the target formats data model. The design of an SVG importer may include decisions that affect visual fidelity when SVG is imported into an application in order to maintain editability. The lessons learned in testing SVG importers will be discussed and illustrated with examples.

It is common practice to automate as much of the testing process as possible. Because SVG is a text-based format SVG exporters lend themselves well to simple test harnesses and test automation. Testing SVG importers that target a particular format can also be easily automated. SchemaSoft's QA team has streamlined the process of testing SVG through the development of our own software utilities that take advantage of SVG being an XML language and through the use of 3rd party XML tools and utilities that are available. The lessons learned with respect to using automation and test utilities when testing SVG importers and exporters will be discussed.

Valid XHTML 1.1!