This release includes the following enhancements: Release date: November 4 November, 2024 Support for Additional LLM ProvidersThe LLM integration support in Jtest has been expanded beyond OpenAI and Azure OpenAI to include any LLM provider with a chat completions endpoint compatible with the OpenAI REST API. This allows users enhanced privacy by integrating with locally deployed models instead of cloud-based models. See OpenAI Integration for more information. AI Integration Enhancements- You can now apply AI-recommended fixes directly to your code, with a difference editor that allows you to review the changes and either apply the fix in full or select a part of it to apply. See Improving tests with AI, Generating a Suggested Fix and Working with Recommendations.
- A new feature has been added which allows AI to improve unit tests generated by the Unit Test Assistant (UTA). UTA may create a limited number of failing tests that provide some coverage even though they fail. With this new option, UTA uses LLM integration to update the failing tests to make them pass. See Use AI to fix failing generated tests.
- AI quick fixes are now added to assertion and exception recommendations for failing unit tests. The Fix with AI action link provides a suggestion on how to fix the test along with the ability to apply the fix directly to the test.
- Visual Studio Code plugin now supports AI-generated fixes to resolve static analysis violations. See Generating a Suggested Fix.
Unit Test Creation Enhancements- Unit test creation analyzes a broader set of classes when creating tests, resulting in better initialized and constructed tests.
- When static method and constructor mocking is enabled, all required static mocks are now created by default during unit test creation, with the ability to configure exclusions. (Previously, users had to manually specify entities for static mock creation.) Mocking settings can be fine-tuned in the UTA Preferences. See Configuring Mocking Options.
- The default value for numbers in generated tests that are not required to be a specific value has been changed from 0 to 1.
Unit Test Recommendation Enhancements - Added a new recommendation for identifying potential setup problems when multiple tests fail with the same exception or for similar reasons. This helps diagnose the root cause of recurring failures reported when running a set of tests. See Potential Setup Problems.
- A new action is available for static mocking recommendations that allows you to exclude specific patterns from mocking. For details, see Mocking Static Methods.
Live Static Analysis and Live Unit TestingYou can continuously monitor code quality and changes through Live Static Analysis and Live Unit Testing. - The Live Static Analysis functionality allows you to automatically analyze your code in the background as you make changes to your code. Jtest will notify you when the code you are working on does not comply with your development policy; see Live Static Analysis.
- The Live Unit Testing functionality continuously discovers and executes impacted tests as you make changes to your code. You will be alerted about test failures related to your changes; see Live Unit Testing.
Code Coverage Enhancements- Improved memory efficiency when processing application coverage.
- By default, coverage is not collected for test classes in the IDE (this can be changed in the settings; see Including Tests in Coverage Scope).
In-File Suppressions Enhancements- Added the ability to easily customize the location of suppression files in both the CLI and IDE.
- Enhancements to suppression definitions:
- You can now use a file path containing wildcards for the file attribute.
- You can now specify a rule category, optionally with a severity suffix, for the rule-id attribute.
For details, see Defining Suppressions in Suppression Files. Security Compliance Pack Enhancements Anchor |
---|
| new_and_updated_configs_jtest |
---|
| new_and_updated_configs_jtest |
---|
| New and Updated Test ConfigurationsThe Security Compliance Pack has been extended by adding support for the following test configuration: The following test configurations have been updated: - CERT for Java
- CERT for Java Guidelines
- CWE Top 25 2023
- CWE Top 25 + On the Cusp 2023
- Recommended Rules
- UL 2900
The following test configuration has been removed: Anchor |
---|
| Updated Static Analysis Rules |
---|
| Updated Static Analysis Rules |
---|
| New and Updated Static Analysis RulesThe following rules have been added: Rule ID | Header |
---|
CODSTA.EPC.DNURT | Do not use raw types. | CODSTA.NTX | Removed usage of deprecated parser API. | CODSTA.ORG.EASE | Expressions used in assertions must not produce side effects. | PB.RE.COLNULL | Return empty arrays and collections instead of null. | PB.USC.NASSIGIO | Ensure the return values of specified file I/O methods are used. | PB.USC.NSIF | Do not place a semicolon immediately after an if, for, or while condition. | SECURITY.WSC.ASNF | Avoid implicit file creation when a String is passed as an argument. | SECURITY.WSC.CFAP | Create files with appropriate access permissions. | TRS.SGAS | Use the synchronized keyword on both the getter and setter methods, or on neither. |
The following rules have been updated: Rule ID | Updates |
---|
CODSTA.NTX | Removed usage of deprecated parser API. | EJB.CPIM | Removed usage of deprecated parser API. | EXCEPT.NFE | Removed usage of deprecated parser API. | FORMAT.IND | Removed usage of deprecated parser API. | GLOBAL.AUT | Removed usage of deprecated parser API. | INTER.SEO | Improved support for Java 11 and higher.
| PB.API.CMMT | Extended the list of verified methods.
| PB.USC.AES | Improved accuracy.
| SECURITY.WSC.DSER | Added a parameter allowing the validation of abstract classes. | SECURITY.WSC.SER | Added a parameter allowing the validation of abstract classes.
| PROPS.PLAIN | Improved accuracy. | UC.ARTD | Removed usage of deprecated parser API. | UC.PM | Added a parameter to ignore the readObject and writeObject methods, regardless of Serializable interface implementation. |
Support for IDEsThe following IDEs are now supported: - Eclipse 4.32 (2024-06)
- Eclipse 4.33 (2024-09)
- IntelliJ 2024.2
Additional UpdatesResolved Bugs and FRsBug/FR ID | Description |
---|
FA-9934 | Improve recipes containing conditions "foo() throw E" to be better resolvable by the generation engine | JT-76414 | UL 2900 inbuilt ruleset clarification - SECURITY.WSC.SER | JT-76534 | Fixing CWE SER violation leads to multiple other CWE violations | JT-76607 | The analysis scope is different between 2024.1 and 2023.1 | JT-76619 | Compilation errors in static analysis | JT-76843 | Rules SECURITY.WSC.DSER, SECURITY.WSC.SER reports false negative on abstract class and interface | UTA-7944 | java.lang.Throwable: AWT events are not allowed inside write action in IntelliJ |
|