Browse Prior Art Database

Generation of data objects for model based testing from XML (Extended Markup Language) schema

IP.com Disclosure Number: IPCOM000019278D
Original Publication Date: 2003-Sep-09
Included in the Prior Art Database: 2003-Sep-09
Document File: 3 page(s) / 49K

Publishing Venue

IBM

Abstract

Part or all of the data required for model based testing is generated from the XML schema for the software under test.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 53% of the total text.

Page 1 of 3

  Generation of data objects for model based testing from XML (Extended Markup Language) schema

Model Based Software Testing uses a model in software of the product under test. The model and the software under test are executed and their behaviours are compared. Any differences are used to discover faults in the software under test.

  Many products store data in various, often complex, formats. Often the format of the data is specified as an XML schema which is part of the software specification. One of the major requirements for a model is that it accurately represents the data structures stored by the software under test. Usually, this requires creating data classes manually, which is expensive, slow, tedious and error prone.

  For a model to be useful, it should be able to create and populate as many data structures as possible so that it can cover the widest variety data inputs for the software under test. This is usually done by manually coding a small selection of possible data objects and values for the data. Better coverage of the behaviour of the software under test is obtained by generating data with some element of randomness.

  Generating the model from a schema describing the required interface greatly reduces the work involved and chance of errors in the model. The schema can be in the form of an XML document or any other format. The generation process can create the basic data structures, generator functions that create random valid and invalid instances (i.e. values not in the range specified by the schema), and functions to print out, compare and convert each data structure.

  The same methods can be used whenever the data structures are defined precisely enough, whatever format the information is in.

  The schema directly represents the structure of the data required in the data model, and may also give some information as to the range of possible values for each item.

From the schema, it is possible to generate:

the basic data structures generator functions for each structure that create a random valid instance generator functions for each structure that create a random invalid instance (i.e. values not in the range specified by the schema) functions to print out, compare and convert each data structure to match those in the software under test.

  An example implementation is written in Java*, and produces rule based Jython for use in a model.

  The method works by parsing the XML schema as an XML document using a Java DOM parser. Each XML element in the schema is processed to build up a list of defined types (simple and complex). Top level element references are then resolved. For each top level ele...