Applying Algebraic Specifications And Testing To Java

Stc
Date: 2008-10-30

Time: 11:45

Room: BBL room 471

Speaker: Wishnu Prasetya

Title: Applying Algebraic Specifications and Testing to Java

Abstract

In-code specifications are specifications written directly in a programming language; e.g. in our case it is Java. Because in-code specifications do not need any additional skill to master, they are more likely to be adopted by engineers on the field. Because they need no additional tools to parse and to keep them in-sync with the programs they specify, they are also much cheaper to maintain. However, the freedom to use the full expresiveness of Java also poses a real danger that such specifications become too cluttered with low level details.

In this talk we will discuss a style of specifications called "algebraic specifications". Such specifications tend to be clean; so it seems plausible to try to apply this to keep our in-code specifications abstract. I will show the approach through an example, which is an applet implementing the Reversi game (many of you may remember this from your first year Imperative Programming assignment).

Another benefit of algebraic specifications is that we can expose them directly to an automated testing tool; we will use our own home grown tool T2. However, now we have another problem. Since we no longer have a direct control on the tests that we do, we need to make sure that the tests generated by T2 are adequate. That is, that they deliver sufficient coverage. Measuring coverage is actually already a problem. We will discuss how this problem can be circumvented. If there is some time left, we can also discuss about adding adaptiveness into our testing framework, which we will need to recreate certain scenarios.