Browse Prior Art Database

Deriving Functional Regression Tests for Patterns in WebSphere Message Broker from Code Analysis

IP.com Disclosure Number: IPCOM000202309D
Publication Date: 2010-Dec-13
Document File: 5 page(s) / 180K

Publishing Venue

The IP.com Prior Art Database

Abstract

There are several technologies that generate source code based on XML configuration files. One of these is JET (Java Emitter Templates), an open source technology built into Eclipse. The solution disclosed herein describes a way to create a meaningful set of configuration files to test a JET template. This solution works by analysing the configuration parameters in combination with any Java code that extends the template.

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

Page 01 of 5

Deriving Functional Regression Tests for Patterns in WebSphere Message Broker from Code Analysis

There are several technologies that generate source code based on XML configuration files. One of these is JET (Java Emitter Templates), an open source technology built into Eclipse.

    Shown below is an example user interface that could be built to allow a user to create an XML configuration for a JET template. The user chooses their configuration values using a straightforward form. When the user is ready, they click a Generate button and the contents of the form is saved into an XML file and then sent to JET to generate the source code. The JET template uses the configuration values from the form to determine what source code should be generated.

    JET also allows extensions to the template to be written in Java. These extensions can be invoked when the template is being processed and allow custom user-defined logic to be invoked.

    For the remainder of this disclosure, the JET template will be referred to as a pattern. A pattern is a reusable template that is fed an XML configuration and generates source code.

1


Page 02 of 5

(This page contains 00 pictures or other non-text object)

    The solution disclosed describes a way to create functional regression tests (non UI tests) by analysing the Java code in a pattern. Each functional regression test is an XML configuration of the pattern. The tests as a whole cover a representative set of different XML configurations for the pattern. With patterns that have many pattern parameters, there are many combinations of pattern parameters that could be tested. This would lead to a huge number of possible XML configuration files. This solution describes a way to select a smaller more meaningful number of combinations so that the number of XML configuration files is kept to a useful minimum.

    At the centre of the disclosed solution is the Pattern Test Generator. This system is responsible for generating the test scripts that implement the functional regression tests. Into this system is fed a variety of information that define the pattern. The generator analyses the information and decides on the most significant combinations of pattern parameters.

A regression test script is generated for each significant combination. The test

2


Page 03 of 5

script creates an instance of the pattern using the pattern parameter values. The code that is generated by the pattern is compared against a known good. If the comparison matches then the test passes. If anything differs from the known good, the test fails.

(This page contains 00 pictures or other non-text object)

    The novel aspect of the disclosed solution is in the algorithm that generates the test cases. In particular the section of the algorithm that analyses the Java code. The algorithm analyses the Abstract Syntax Tree (AST) for the custom Java code looking for code blocks that reference pattern parameters.

    More information...