This article is old and is being consolidated into the book.
Please refer to the corresponding chapter(s) therein.
If the chapters or sections are not completed yet, you can use this article.
Refer to the examples as they are tested against the latest code.
Java White-Box Testing with Embedded JudoScriptBy James Jianbo Huang March 2002 non-printer versionAbstract JudoScript allows seamless Java code invocation, hence is perfect for Java code white-box unit testing. The language engine explicitly supports this by allowing JudoScript code to be embedded in (the comments in) Java source files. Special tags enclose JudoScript code, and the engine extract and run them. JudoScript is also great for batch black-box and load testing.
JudoScript has two characteristics that make it an ideal testing language especially for Java software. They are a) seamlessly invoking Java code and b) rich application features. If you go through its readily available feature list, plus the potential to use any Java software as its extension libraries, you will find why JudoScript is a powerful batch black-box and load testing language.
This article focuses on JudoScript's white-box testing capability for Java. It has a feature
that is designed especifically for this purpose -- embedded JudoScript code. It is like
JUSP, except that this is not for generating web pages
but rather embedding scripts in Java source files. It is very simple to use. In the
Java source file, use a pair of special tags, the language engine will extract all the JudoScript code and run. The following is the source code:java judo Foo.java
This incredibaly simple scheme is incredibly effective and efficient. It is better than Java unit testing with Java code for these reasons:
JudoScript source code itself uses embedded JudoScript code. In file MethodOrdinals.java, JudoScript code is used to detect ambiguous or replicated function ordinals. In file VariableAdapter.java, JudoScript code tests the basic methods used by all the value types. |