My favorites | Sign in
Project Logo
Project hosting will be READ-ONLY Wednesday, 7AM PST due to brief network maintenance
                
Search
for
Updated Sep 07, 2008 by jeni.tennison
Labels: Featured, Phase-Deploy
UserGuide  
A guide for users of XSpec

Introduction

XSpec is a Behaviour Driven Development (BDD) framework for XML processing, currently focused on XSLT.

BDD is like Test Driven Development (TDD) in that it encourages you to develop your code by

  1. describing a behaviour (or writing a test)
  2. testing whether your code gives that behaviour
  3. if it doesn't, fixing the code until it does and the test passes

The difference between BDD and TDD is about how you write the tests. In BDD, your focus is on the behaviour of the code: the descriptions form the double role of both a human-readable documentation of what the code should do and runnable tests that can test whether the code does what it should do.

In BDD, we describe scenarios and the expected behaviour of the application with these scenarios. Scenarios fit particularly well with XSLT's source-driven (or template-driven) approach. For example, a scenario might be:

when processing a <para> element, it should create a <p> element.

or something more complex like:

when processing a <fn> element with a label attribute in footnote mode, it should create a <p> element with a <sup> child holding the value of the label element.

Scenarios written like this naturally map onto XSLT templates.

From Here


Comment by cms...@blackmesatech.com, Oct 26, 2009

Suggestion: a list of known current limitations, issues, shortcomings, gotchas, and other items new users may trip on would be helpful.

An entry in that list:

If the stylesheet being tested has an xsl:output parameter with public and system identifiers for a DTD, they will show up in the report document (where they do not, strictly speaking, belong), complicating life for everyone.


Sign in to add a comment
Hosted by Google Code