Technical information about Takuan

Takuan uses internally the following systems:

Instrumentation step:
  • JavaCC and JJTree to generate the XPath expression parser.
  • XSLT 2.0 (using the Saxon-B 9.1 engine) to modify the WS-BPEL compositions.
  • Java 6 code to glue everything together.
Execution step:
  • Tomcat 5.5 application server.
  • ActiveBPEL 4.1 WS-BPEL 2.0 engine, patched to make it more robust against incorrect process definitions.
  • Our own XPath extension functions, which have been installed into ActiveBPEL.
Postprocessing step:
  • Perl (5.10+) for the scripts, using the Graph::UnionFind and Parallel::ForkManager modules from CPAN.
  • Daikon 4.3.4, patched to allow annotations for constraints extracted from the services' schemata.
  • Optionally, Simplify (SVN r71394) for simplifying the invariants used. Simplify requires a Modula-3 distribution: CM3 5.6.0 and 5.8.1 are used.

High-level code structure and build infrastructure

The code for Takuan is hosted in an SVN repository that is shared with other WS-BPEL testing tools, such as MuBPEL or Rodan. We use Maven to generate every night a website with more information about the projects, collect code quality metrics and run tests.

Not all of the code in that repository is part of Takuan. A simplified dependency tree for Takuan (starting from the Java "glue" project, takuan-launcher) is as follows:

 +- es.uca.webservices:takuan-java:jar:2.0.2-SNAPSHOT:compile
 |  \- es.uca.webservices:bpel-packager:jar:1.2.2-SNAPSHOT:compile
 |     +- es.uca.webservices:xpath-xml2text:jar:1.2.1-SNAPSHOT:compile
 |     |  \- es.uca.webservices:xpath-parser:jar:1.2.1-SNAPSHOT:compile
 |     +- es.uca.webservices:service-analyzer:jar:1.1.3-SNAPSHOT:compile
 |     |  \- es.uca.webservices:wsdl2xsdtree:jar:1.0.4-SNAPSHOT:compile
 |     |     \- es.uca.webservices:xml-utils:jar:1.3.1-SNAPSHOT:compile
 |     |        \- net.sourceforge.saxon:saxon:jar:xpath:
 |     +- net.bpelunit:framework:jar:1.6.2-SNAPSHOT:compile
 |     \- wsdl4j:wsdl4j-debug:jar:1.6.2:compile
 +- es.uca.webservices:activebpel-path-coverage:jar:1.2.1-SNAPSHOT:compile
 +- es.uca.webservices:PrintXMLInvariants:jar:1.2.1-SNAPSHOT:compile
 +- es.uca.webservices:takuan-activebpel:jar:2.0.2-SNAPSHOT:runtime
 +- es.uca.webservices:takuan-perl:exe-x86_64-linux-gnu-thread-multi:dist:2.0.2-SNAPSHOT:runtime
 +- net.sf.jopt-simple:jopt-simple:jar:3.2:compile
 +- org.yaml:snakeyaml:jar:1.9:compile
 +- org.activebpel:rt.jetty:jar:4.1-uca15:compile
 +- com.hp.hpl:simplify:zip:binary_linux:1.5.4:runtime
 +- com.sun:tools:jar:1.6.0_31:system
 +- net.bpelunit:datasource-csv:jar:1.6.2-SNAPSHOT:runtime
 \- junit:junit:jar:4.8.2:test

The dependencies that start with es.uca.webservices have subfolders named after their Maven artifact identifiers in the SVN repository, and the others are external dependencies that are retrieved from our Nexus repository.

As said above, takuan-launcher is the Java-based "glue" that connects all the pieces together:
  • takuan-java has the pure Java code that implements the generation of the Daikon .decls files and the instrumentation of the .bpel files:
    • This project uses in turn bpel-packager, which repackages BPEL processes into the .bpr files required by ActiveBPEL.
      • bpel-packager uses xml-xpath2text to parse XPath code into an AST, modify the AST and turn the modified AST back into an XPath expression.
      • bpel-packager uses service-analyzer to analyze WSDL files, providing additional functionality over WSDL4J.
      • bpel-packager also integrates the BPELUnit unit testing framework for running the tests that will drive the invariant generation process.
  • activebpel-path-coverage is a Java tool that computes path coverage metrics from ActiveBPEL execution logs.
  • PrintXMLInvariants is a Java tool that prints the invariants in the Daikon serialized format as XML.
  • takuan-activebpel contains the XPath extension functions that are used in the instrumented BPEL processes to provide Takuan with the variable values.
  • takuan-perl is a set of Perl modules that convert the .decls files generated by takuan-java and the .log files generated by ActiveBPEL into the formats expected by the Daikon dynamic invariant generator. In particular, we integrate a slightly modified version of Daikon which allows for suppressing certain kinds of unnecessary or unwanted invariants that are common in WS-BPEL. The patch itself is hosted in the daikon subdirectory.
  • takuan-launcher also integrates a Mavenized version of the ActiveBPEL 4.1 engine which runs on an embedded Eclipse Jetty 8 application server.

The command-line options are implemented through JOptSimple, and the YAML-based configuration files are implemented through the reflection-based approach implemented by the SnakeYAML library.

Checking out the code

Working on the Takuan Java-based components requires following these steps:

  1. Check out the code from the repository and generate Eclipse projects:
    svn checkout takuan
    cd takuan
    mvn -am -pl takuan-launcher compile eclipse:eclipse
  2. Import the generated Eclipse projects into Eclipse and work on them.
  3. To package Takuan, use the following command:
    mvn -am -pl takuan-launcher package
  4. The generated takuan-launcher-dist-*.zip distribution will be available at the takuan-launcher/target directory. This distribution can be then unpackaged and run normally from the command line.

To work on the Perl modules, please refer to the README file within the takuan-perl project.