tests for free
play

Tests for free Fully Automatic Generator-Driven Tests of XSL - PowerPoint PPT Presentation

Tests for free Fully Automatic Generator-Driven Tests of XSL Transformations Adam Duracz Walid Taha Halmstad University July 16, 2012 Motivation XML Popular to specify XML formats using XML Schema XSL Transformations (XSLT)


  1. Tests for free Fully Automatic Generator-Driven Tests of XSL Transformations Adam Duracz Walid Taha Halmstad University July 16, 2012

  2. Motivation • XML • Popular to specify XML formats using XML Schema • XSL Transformations (XSLT) • Language for expressing transforms of XML docs • Complete XML Schema-based type checking of full XSLT is not possible * • Common to test XSLTs by hand-crafting input data • Expensive / error-prone / tedious * Alon et al 2001

  3. Initial idea Since type checking of XSLTs isn’t possible, can we at least use generator-driven testing?

  4. XSLT - Transformations from XML to XML S in S out XML Document XSLT XML Document • Common application areas • Systems integration , data migration, publishing • Often XML Schema for I/O formats are available • Tells us how valid input should look • Allows us to automatically validate output

  5. Generator-driven test method S in S out T(d) d Generator T Validator

  6. How XML Schema define XML documents <xsd:element name="people" <people> type="PeopleType"/> <person id="P001"> <name>Anna</name> <xsd:complexType <age>66</age> name="PeopleType"> </person> <xsd:sequence> <person id="P002"> <xsd:element <name>Jan</name> name="person" <age>35</age> type="PersonType" </person> minOccurs="2"/> </people> </xsd:sequence> </xsd:complexType>

  7. How XML Schema define XML documents <xsd:element name="people" <people> type="PeopleType"/> <person id="P001"> <name>Anna</name> <xsd:complexType <age>66</age> name="PeopleType"> </person> <xsd:sequence> <person id="P002"> <xsd:element <name>Jan</name> name="person" <age>35</age> type="PersonType" </person> minOccurs="2"/> </people> </xsd:sequence> </xsd:complexType>

  8. How XML Schema define XML documents <xsd:element name="people" <people> type="PeopleType"/> <person id="P001"> <name>Anna</name> <xsd:complexType <age>66</age> name="PeopleType"> </person> <xsd:sequence> <person id="P002"> <xsd:element <name>Jan</name> name="person" <age>35</age> type="PersonType" </person> minOccurs="2"/> </people> </xsd:sequence> </xsd:complexType>

  9. How XML Schema define XML documents <xsd:element name="people" <people> type="PeopleType"/> <person id="P001"> <name>Anna</name> <xsd:complexType <age>66</age> name="PeopleType"> </person> <xsd:sequence> <person id="P002"> <xsd:element <name>Jan</name> name="person" <age>35</age> type="PersonType" </person> minOccurs="2"/> </people> </xsd:sequence> </xsd:complexType>

  10. How XML Schema define XML documents <xsd:element name="people" <people> type="PeopleType"/> <person id="P001"> <name>Anna</name> <xsd:complexType <age>66</age> name="PeopleType"> </person> <xsd:sequence> <person id="P002"> <xsd:element <name>Jan</name> name="person" <age>35</age> type="PersonType" </person> minOccurs="2"/> </people> </xsd:sequence> </xsd:complexType>

  11. Generator-driven test method S in S out T(d) d Generator T Validator

  12. XML Schema Instance Generation <xsd:element name="family" <xsd:complexType> <xsd:sequence> <xsd:element name="person" type="..." minOccurs="2" <xsd:element name="pet" ...

  13. Parsing Internal Repr. XML Schema <xsd:element Element name="family" <xsd:complexType> <xsd:sequence> <xsd:element name="person" type="..." minOccurs="2" <xsd:element name="pet" ...

  14. Parsing Internal Repr. XML Schema <xsd:element Element name="family" <xsd:complexType> <xsd:sequence> ComplexType <xsd:element name="person" type="..." minOccurs="2" <xsd:element name="pet" ...

  15. Parsing Internal Repr. XML Schema <xsd:element Element name="family" <xsd:complexType> <xsd:sequence> ComplexType <xsd:element name="person" Sequence type="..." minOccurs="2" <xsd:element name="pet" ...

  16. Parsing Internal Repr. Internal Repr. XML Schema <xsd:element Element Element name="family" <xsd:complexType> <xsd:sequence> ComplexType ComplexType <xsd:element name="person" Sequence Sequence type="..." minOccurs="2" Element Element Element Element <xsd:element name="pet" ...

  17. Generator construction Internal Repr. Generator genElement Element genComplexType ComplexType genSequence Sequence genElement genElement Element Element

  18. Instance generation XML Schema Generator Schema instance <xsd:element ? genElement name="family" <xsd:complexType> <xsd:sequence> genComplexType <xsd:element name="person" genSequence type="..." minOccurs="2" genElement <xsd:element genElement name="pet" ...

  19. Instance generation XML Schema Generator Schema instance <xsd:element genElement name="family" <xsd:complexType> <xsd:sequence> genComplexType <xsd:element name="person" genSequence type="..." minOccurs="2" genElement <xsd:element genElement name="pet" ...

  20. Instance generation XML Schema Generator Schema instance <xsd:element <family> genElement name="family" <xsd:complexType> <xsd:sequence> genComplexType <xsd:element name="person" genSequence type="..." </family> minOccurs="2" genElement <xsd:element genElement name="pet" ...

  21. Instance generation XML Schema Generator Schema instance <xsd:element <family> genElement name="family" <xsd:complexType> <xsd:sequence> genComplexType <xsd:element name="person" genSequence type="..." </family> minOccurs="2" genElement <xsd:element genElement name="pet" ...

  22. Instance generation XML Schema Generator Schema instance <xsd:element <family> genElement name="family" <xsd:complexType> <xsd:sequence> genComplexType <xsd:element name="person" genSequence type="..." </family> minOccurs="2" genElement <xsd:element genElement name="pet" ...

  23. Instance generation XML Schema Generator Schema instance <xsd:element <family> genElement name="family" <xsd:complexType> <xsd:sequence> genComplexType <xsd:element name="person" genSequence type="..." </family> minOccurs="2" genElement <xsd:element genElement name="pet" ...

  24. Instance generation XML Schema Generator Schema instance <xsd:element <family> genElement name="family" <person name="Anna"/> <xsd:complexType> <person name="Jan"/> <xsd:sequence> genComplexType <xsd:element name="person" genSequence type="..." </family> minOccurs="2" genElement <xsd:element genElement name="pet" ...

  25. Instance generation XML Schema Generator Schema instance <xsd:element <family> genElement name="family" <person name="Anna"/> <xsd:complexType> <person name="Jan"/> <xsd:sequence> genComplexType <xsd:element name="person" genSequence type="..." </family> minOccurs="2" genElement <xsd:element genElement name="pet" ...

  26. Instance generation XML Schema Generator Schema instance <xsd:element <family> genElement name="family" <person name="Anna"/> <xsd:complexType> <person name="Jan"/> <xsd:sequence> genComplexType <pet <xsd:element name="Moxy" name="person" genSequence species="rabbit"/> type="..." </family> minOccurs="2" genElement <xsd:element genElement name="pet" ...

Recommend


More recommend