7
Test design and practice

Formal Methods: (We have something to simulate, described below in our method.)

    1.   Hoare Axiomatic Verification
         Testing each part of our code by Hoare inference rule(Pre-condition, invariant, Post-condition)
    2.   Mills' functional verification method
    3.   Axiomatic Specs for Abstract Data Types (ADT)
         testing our data structure implementations. Verifying if it meet our specification.
    4.   Verification via Model Checking

Informal Methods:

1. microsoft method.

Do not test. User (Lars) Test. b version.

2. Our Method:

We treat each class as a independent part of software to be tested.

When a class was designed and built, we test it separately with others, giving it all possible input, seeing if it produce reasonable outputs.

Here is an example, //

// Test the event sequence class. The primary purpose of this test program

// (at the moment) is to validate the parser. No effort at full testing is

// yet being made.

//

import java.io.*;

import EventSequence;

class EventSequenceTest

private final String smallTestFile = "esTestFile.1";

public static void main(String[] s) {

EventSequenceTest testApp = new EventSequenceTest();

System.out.println("EventSequenceTest:");

private final String smallTestFile = "esTestFile.1";

public static void main(String[] s) {

EventSequenceTest testApp = new EventSequenceTest();

System.out.println("EventSequenceTest:");

// Create an event sequence using the smallest of the test files.

File testFile = null;

testFile = new File(testApp.smallTestFile);

EventSequence sequence = null;

try {

sequence = new EventSequence(testFile);

}

catch(IOException exception) {

System.out.println("Unable to parse the file.");

System.exit(-1);

}

catch(ParserException exception) {

System.out.println("Unable to parse the file: " + exception.getMessage());

System.exit(-1);

}

// Verify that the file related data has been properly read.

// Parse through the events from beginning to end. Display them to

// stdout in order to provide diff-able output for testing.

// Create a subsequence.

}

}

We run as many times as we can. See if the result of the program meet our design

purpose.

 

Luke Gao
Last modified: Sat April 16 2:40:33 EST 1999