Today we were pleased to announce the release of Parasoft Jtest 10.3.4, focusing on unit testing and static analysis.
In this release, we have added numerous enhancements, focusing our efforts on unit testing in the context of the following areas:
- Unit Test Creation
- Scaling Unit Tests
On the static analysis side of things, we've added support for the newest OWASP guidelines (2017), along with standard bug fixes and improvements there. We also improved performance and expanded platform support.
Read on to learn more about these enhancements and how to benefit from them!
Unit Test Creation
As you build your testing pyramid, you need a solid foundation of unit tests, but as so many of you express, creating those unit tests can be troublesome and time consuming. As with previous versions of Jtest, the Unit Test Assistant continues its objective of making unit test creation easier for you. With 10.3.4, there are two new features that have been added to help with this:
Support for Factory Methods
Having trouble finding that one factory method in your code that you want to use to initialize some object? Or did you forget the right coding syntax to use to instantiate your factory object? With Jtest 10.3.4, you can now configure the Unit Test Assistant to use the factory methods that are available in your source code to further increase efficiency and productivity of the test creation process.
Easily tag and un-tag factory methods, and the Unit Test Assistant will auto-discover them and allow you to use these factory methods within your unit tests. Instantiate using factory in the Unit Test Assistant view. The action will show up when a relevant factory method is available for the selected type. If more than one factory method is available for a specific type, the Unit Test Assistant will prioritize factory methods whose return type is the closest match to the type of the variable being initialized. The Unit Test Assistant will also prefer factory methods in the same package or in the closest parent package.
Support for Creating Multiple Spring Tests
Tired of creating Spring unit tests one file at a time? With Jtest 10.3.4, we’ve added support for creating unit tests for multiple Spring files, to help optimize the creation process. In the Unit Test Assistant view, you will now have a new action icon for “Add Spring test case(s).” Alternatively, you can right-click in the editor’s package explorer view and get a context menu to create unit tests that way.
Scaling Unit Tests
Once you've started your unit test foundation, you need to scale it out to cover all your code. Trying to scale out Spring unit testing in the past was a bit of a pain point, but with new support for creating multiple Spring tests, you can now build out your Spring test suite simply and easily. The bulk creation of Spring unit tests allows you to quickly select a package or project of Spring classes and generate unit tests for those classes, giving you a quick way to scale out your testing practice. The Unit Test Assistant now gives you a jump start to your Spring testing so that you can spend more time adding the business logic that goes into the test.
In Jtest 10.3.3, the Unit Test Assistant view was the central view for seeing all your unit testing data and actions, which limited the ability to see different data at the same time. To improve viewability of the data and actions, we split the Unit Test Asssistant view into multiple views. The following views are now available in Jtest 10.3.4, allowing you to create and enhance your tests, as well as review test results:
- Unit Test Assistant View
This dynamic interface allows you to create, run, and monitor unit tests. It can detect tests that have been created for the class or method selected in the editor, and display actions available for this particular class or method.
- Recommendations View
This view displays recommendations for test improvements after a test is run.
- Variables View
This view displays variables associated with method calls. You can use this view to compare the state of an object before and after a method call.
- Factory Methods View
This view provides an interface for scanning your code for methods that have been tagged as factory methods and listing them in a tree structure.
For a quick way to set up these views, in 10.3.4, the Jtest perspective in Eclipse has been updated to launch all of these views for you, which we've arranged in a logical order so you can easily see what you need to see.
Static Analysis Improvements
Although unit testing was the major area of focus for Jtest 10.3.4, we didn’t neglect the static analysis portion of the software. In this area, we made several bug fixes to the following code analysis rules:
- Bug Detective [BD]
- Coding Convention [CODSTA]
- Code Duplication Detection [CDD]
- Exception [EXCEPT]
- Formatting [FORMAT]
With Jtest 10.3.4, we have also extended our support for the OWASP standard and added the new OWASP Top 10 2017 built-in test configuration. This includes rules that find issues identified in OWSAP’s Top 10 standard, helping you beef up your application’s security.
But wait, there's more!
For those wanting to speed up the performance of Jtest, we have added a new UI option to improve just that. Now Jtest can launch on IDE startup to speed up the first run analysis.
In Jtest 10.3.4, we continue to extend our reach by now supporting the following platforms, IDEs, and build systems:
- Windows Server 2016
- IntelliJ 2017.2 and 2017.3
- Gradle 4.3
More details regarding all these enhancements can be found in the release notes. If you are an existing customer, you can check out the Parasoft Customer Portal to get access to them and download the latest installers for the latest features. If you’re new to Parasoft, please request a demo and one of our solution experts will be happy to answer questions and give you a more detailed presentation. Happy Java testing!