Bild mit Unilogo
homeicon university sucheicon search siteicon sitemap kontakticon contact impressicon legal notice
unilogo University of Stuttgart 
Institute of Formal Methods in Computer Science

jMoped - A Test Environment for Java Programs

 

The information on this website is no longer up-to-dated. You will be redirected in 10 seconds to our new website.

Overview

jMoped is a test environment for Java programs written as an Eclipse plug-in.

Given a Java method, jMoped can simulate the execution of the program for all possible arguments within a finite range and generate coverage information for these executions. Moreover, it checks for some common Java errors, i.e. assertion violations, null pointer exceptions, and array bound violations. When an error is found, jMoped finds out the arguments that lead to the error. A JUnit test case can also be automatically generated for further testing. Details are described in Felix Berger's diploma thesis.

Note: jMoped was first released as a text-based translator from Java bytecode into Remopla. For more information, see the translator page.

Screenshots Not Covered Partially Covered Covered Assertion Violation Heap Overflow NullPointerException ArrayIndexOutOfBoundException

See some examples in the screenshots.

Requirements

  • Linux/Unix system.
  • Java 5.0 or later.
  • Eclipse 3.1 or later.
  • JUnit 3.8.1.

Downloads

Installation

The installation process is divided into two parts: Moped library and the Eclipse plug-in.
  1. Moped library
    • Set the environment variable JAVA_HOME to where Java is, e.g.
      export JAVA_HOME="/usr/java/jdk1.5"
      Set the following variables:
      export LDFLAGS="-L$JAVA_HOME/jre/lib/i386/client"
      export CPPFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
    • Unpack the Moped libaray Moped-x.x.x.tar.gz with the following command:
      tar -xzvf Moped-x.x.x.tar.gz
      This will generate a directory named Moped-x.x.x.
    • Go inside the directory and call the script:
      ./autogen.sh
    • Call the configure script.
      ./configure --prefix=$HOME/Moped-x.x.x
    • Build the library.
      make
    • Install the library.
      make install
    • Tell the plug-in where to find the library.
      export LD_LIBRARY_PATH="$HOME/Moped-x.x.x/lib"
      Make sure that Eclipse is started from an environment where this variable is set.
  2. Eclipse plug-in
    • Inside Eclipse, select Help -> Software Updates -> Find and Install....
    • Select the checkbox Search for new features and install and click the Next button.
    • Add the update site by clicking the button Show Remote Site... and enter the followings:
      Name:jMoped Plug-in
      URL:http://www.fmi.uni-stuttgart.de/szs/tools/moped/jmoped/plugin/
    • Select the site you just added and click the Next button. Follow the instructions and restart Eclipse afterwards.
Detailed instructions can be found in the user manual (Section 4.2 of the thesis).

Usage

See section 4.4 and 4.5 in the thesis.

Limitations

The current jMoped supports common Java features, however some obvious limitations are:
  1. Negative integer is not supported.
  2. Multi-threading is not supported.
  3. Very limited support of String.
  4. Programs that use Java library might not work correctly, since they sometimes involve native library.

Changes

  • 09.02.07: Some bugfixes, small changes in the interface.
  • 17.10.06: First public release.

Contact

jMoped was written by Felix Berger, Stefan Schwoon, and Dejvuth Suwimonteerabuth.

Links