Welcome!

Linux Authors: Michael Sheehan, Lavenya Dilip, Ian Thain, Bruce Armstrong, Ellen Rubin

Related Topics: Java

Java: Article

Jtest 7.0 From Parasoft

A First Look At Parasoft's Jtest 7.0 Product Release

Java Technology completed its 10-year anniversary recently. Sun announced that there are over 4 million developers using the Java language, with thousands more joining their ranks. While a small percentage of developers can be called experts or skilled in the complete software development life cycle, a vast majority of them typically try to understand the requirements handed down to them and code to meet such requirements. Most projects (about 60%) go above budget and time, which places additional pressure on the developers trying to deliver an application. Coding standards, thorough unit testing, best coding practices - all take a back seat to the primary goal of delivering some code that meets functional requirements. Software architects have long tried to enforce a uniform coding and testing practice on their teams. Now, with the release of Jtest 7.0 from Parasoft, it's possible to deliver code that follows best practices and is well unit tested.

Product Description
Jtest is an automated Java code analysis and unit test generation product. It comes with over 500 coding standard rules built-in and also provides a mechanism to correct over 200 of these violations automatically. Rules can be customized without coding, and user-defined rules can also be created. It automatically generates and executes JUnit tests and allows users to extend these tests. Jtest has been standardized on the now ubiquitous Eclipse platform and is available as a stand-alone and as a plug-in to Eclipse. It's available on Windows, Linux, and Solaris platforms. Jtest makes static code analysis a breeze and it should be easy for even beginners to analyze their code for compliance to standards as well as to generate unit tests.

Installation
I downloaded and installed the stand-alone version of the software, which is available for download from the Parasoft Web site after going through a simple registration process. A license key is e-mailed to the provided address. Installation of the software is straightforward and I just went with the provided default values. I had JDK 1.5 already available on my machine. Jtest stand-alone installs the entire Eclipse runtime and associated files with it. Once you install it, the first time you run the product you can go to the preferences under the Windows menu and put in your license key information. You're now ready to go.

Jtest Usage and Benefits
If you are familiar with Eclipse, there is practically no learning curve. You can switch perspectives, create a Jtest project from existing source folders, and be on your way. There are also several example projects available for newbies to learn how to use Jtest. The Java, CVS, and debug perspectives are all available as a consequence of Jtest built on the Eclipse platform. You can create Jtest configurations that can then be applied to a project to conduct static code analysis. A subset of the available 500 rules can be enabled and custom rules can also be added to a configuration. Figure 1 shows the stand-alone version of Jtest 7.0 with available examples.

I perceived several benefits to using Jtest. It prevents errors from entering into your code in the first place. For new software development projects, code development can be treated in a strict manner and the coding process controlled to follow established coding standards. Applying coding standards is easy with the over 500 built-in coding standard rules that enforces code design and construction.

Issues associated with resources like JDBC connections not being closed properly are eliminated upfront. This ensures that denial of service (internal and external denial) attacks that leverage the exposure of object resources are eliminated. For example, it's possible for a poorly written application to access your applications and induce it to throw an exception. This can leave a connection open if you don't close your connection in a finally clause. This scenario can be easily caught by one of the built-in rules, and good coding practices can be enforced.

The unit testing features of Jtest are exciting and are based on automation. Unit tests designed to break your code are generated automatically. The generated unit tests can run in batch mode overnight on the server.

The prebuilt Jtest configuration has several rules such as avoiding empty try/catch blocks, handling exceptions and errors, and assignment within condition blocks. There is the notion of an object repository where you can create complex structures. Jtest can read this repository when it's generating tests. You can also extend generated unit tests, automatically insert assertions, as well as get reports on the code coverage and metrics.

The team configuration manager (TCM) allows you to enable sharing of a configuration across a team. You can upload test results to TCM. When a developer starts his or her IDE in the morning he or she can see the nightly batch test reports that were run on the server.

Last but not the least, the most exciting of all available features in Jtest 7.0 is test case sniffing. This is the ability of Jtest to monitor JVM execution and based on that create functional tests. Currently, only JDK 1.4.x is supported. The API to hook into the JVM has undergone a revision from JVMPI to JVMTI and that could possibly explain why Parasoft may take some time to catch up on sniffing the JVM under JDK 1.5.

Jtest can send data from various tests to the Parasoft Group Reporting System (GRS). Based on the data sent to GRS, the configuration of Jtest on developer machines can be modified. Project Management can use GRS reports to allow them visibility on overall project progress. GRS provides trending over time, graphics, etc.

Summary
Overall, Jtest 7.0 is definitely an able ally in the software developer camp. It can save a lot of effort in unit testing as well as allow a team to enforce and follow uniform coding standards. For small projects, the price can probably be a little steep. If you have a large project with multiple developers, I would definitely encourage using a code analysis tool and also complement your unit testing efforts. Parasoft's Jtest definitely fits the bill in that regard.

SIDEBAR

Parasoft
101 E. Huntington Drive
Monrovia, CA 91016
Web: www.parasoft.com
Phone: (888) 305-0041
E-mail: info@parasoft.com

Test Platform
JDK 1.4.2 and 1.5, HP Compaq nx9600, Windows XP Professional with Service Pack 2, Pentium 4 @ 3.6 GHz, 1GB RAM, 80GB hard disk

Specifications
Platforms
: Windows, Linux, and Solaris
Pricing: Pricing starts at $3,495 for a single user, machine-locked license.
Support: Online technical support; dedicated technical support with a 1-800 number, 9:00 a.m. to 5:00 pm., Monday through Friday; overall Parasoft solution including testing process, testing analysis, and professional services support.

SIDEBAR 2

Snapshot

Target Audience: Java developers, software architects
Level: Beginner to advanced

Pros:

  • Easy to use for all user levels
  • Static code analysis is quite extensive
  • Unit tests generated are of an excellent standard
  • Integrate existing JUnit tests into Jtest
Cons:
  • Integration only with Eclipse and not NetBeans
  • Limited support for Java 5.0 (JDK 1.5)
  • Sniffer functionality supported for JDK 1.4.x and JDK 1.5 JVMs

More Stories By , Venkat

Venkat has over 13 years of experience in distributed computing, technology strategy, and enterprise architectures. Venkat is the chief technology officer at Red Rabbit Software where he leads the Business and Technology Strategy, the direction of the Red Rabbit Software technology platform, and Research & Development. He has completed PhD courses in Interdisciplinary Studies involving Computers and Aerospace Engineering and has a Bachelor of Technology degree from The Indian Institute of Technology, Madras, India.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.