'. '

SignatureTests

From APIDesign

(Difference between revisions)
Jump to: navigation, search
(Signature Testing Tools)
Line 5: Line 5:
== Signature Testing Tools ==
== Signature Testing Tools ==
-
This is the Ant task that we use in NetBeans:
+
The [[NetBeans]] project is using its [http://wiki.netbeans.org/view/APITests NetBeans own extension] to [http://sigtest.dev.java.net sigtest]] open source testing tool. The '''sigtest''' is the official [http://openjdk.dev.java.net OpenJDK] tool and since version 2.1 (which has been release in Mar 2009) it supports also [[BackwardCompatibility]] tests.
-
* [http://wiki.netbeans.org/view/APITests NetBeans signature tests]
+
Whenever you make a release of your [[API]], you can use the '''sigtest''' [[Ant]] task to generate a golden file and store it in your version control next to your [[API]] sources. Since then, you can always verify that the [[API]] that you are creating is still compatible with the golden file by running the signature check against new version of your library.
 +
 
 +
Simple and useful. I cannot imagine [[API]] design without such verification tool. Thanks the ''sigtest'' team for release such good 2.1 version!

Revision as of 19:23, 17 March 2009

Since the rise of XP and other Agile methodologies testing become more and more popular. Not only among dedicated quality departments, but also among developers. It is not surprising that these days a successful projects is not just code, but also set of tests to verify that the release is good enough and that the project moves into correct direction.

The API Design is not exceptional in this aspect. Proper API Design requires testing and verification. The goal when designing an API is to prevent the amoeba shaking effect - e.g. prevent each new release to completely destabilize existing usages. This requires standard unit testing as well, as something special - testing for binary compatibility.

Signature Testing Tools

The NetBeans project is using its NetBeans own extension to sigtest] open source testing tool. The sigtest is the official OpenJDK tool and since version 2.1 (which has been release in Mar 2009) it supports also BackwardCompatibility tests.

Whenever you make a release of your API, you can use the sigtest Ant task to generate a golden file and store it in your version control next to your API sources. Since then, you can always verify that the API that you are creating is still compatible with the golden file by running the signature check against new version of your library.

Simple and useful. I cannot imagine API design without such verification tool. Thanks the sigtest team for release such good 2.1 version!

Personal tools
buy