The Daikon Invariant Detector User Manual_ 3. Example usage for Java, C_C++, Perl, and Eiffel

The Daikon Invariant Detector User Manual_ 3. Example usage for Java, C_C++, Perl, and Eiffel

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
[ < ] [ > ] [ << ] [ Up ] [ >> ] [ Top ] [ Contents ] [ Index ] [ ? ] 3. Example usage for Java, C/C++, Perl, and Eiffel Detecting invariants involves two steps: Obtain one or more data trace files by running your program under the control of a front end (also known as an instrumenter or tracer) that records information about variable values. You can run your program over one or more inputs of your own choosing, such as regression tests or a typical user input session. You may choose to obtain trace data for only part of your program; this can avoid inundating you with output, and can also improve performance. 1. Run the Daikon invariant detector over the data trace files (see section Running Daikon ). This detects invariants in the recorded information. You can view the invariants textually, or process them with a variety of tools. 2. Often, you can run a single command that performs both steps. Among other benefits, this can avoid the need to create the data trace file by sending trace information directly from the instrumented program to Daikon, which is called “online execution” of Daikon. This section briefly describes how to obtain data traces for Java, C, Perl, and Eiffel programs, and how to run Daikon. For detailed information about these and other front ends that are available for Daikon, Front ends (instrumentation) . 3.1 Detecting invariants in Java programs 3.2 Detecting invariants in C/C++ programs 3.3 Detecting invariants in Perl programs 3.4 Detecting invariants in Eiffel programs [ < ] [ > << ] [ ] [ >> ] [ Contents ] [ Index ] [ ? ] 3.1 Detecting invariants in Java programs In order to detect invariants in a Java program, run the program using the Chicory front end (see section Java front end Chicory ) to create a data trace file, then run Daikon itself to detect invariants. With the ‘ --daikon option to Chicory, a single command performs both steps. For example, if you usually run java mypackage.MyClass arg1 arg2 arg3 then instead you would run java daikon.Chicory --daikon mypackage.MyClass arg1 arg2 arg3 and the Daikon output is written to the terminal. The Daikon Invariant Detector User Manual: 3. Example usage for Java, . .. file:///C:/Users/tyalanf/AppData/Local/Temp/Temp1_daikon.zip/daikon/d. 2/24/2012 12:16 PM You created this PDF from an application that is not licensed to print to novaPDF printer ( http://www.novapdf.com )
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
3.1.1 StackAr example 3.1.2 Using DynComp with Java programs 3.1.3 Understanding the invariants 3.1.4 Understanding DynComp 3.1.5 A second Java example [ < ] [ > ] [ << ] [ Up ] [ >> ] [ Top ] [ Contents ] [ Index ] [ ? ] 3.1.1 StackAr example The Daikon distribution contains some sample programs that will help you get practice in running Daikon. To detect invariants in the StackAr sample program, perform the following steps. Compile the program with the ‘ -g ’ switch to enable debugging symbols. (The program and test suite appear in the ‘ DataStructures ’ subdirectory directory.) cd examples/java-examples/StackAr javac -g DataStructures/*.java 1.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

The Daikon Invariant Detector User Manual_ 3. Example usage for Java, C_C++, Perl, and Eiffel

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online