Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This topic explains how to generate an AI-suggested fix to a violation and replace your code with the generated code. To use this functionality, the LLLM LLM provider must first be configured in the Parasoft Preferences. For details, see see Configuring Open AI Settings.

...

  1. In the Findings view, right-click the finding you want to generate a fix for, then choose Generate Suggested Fix for [rule].

    Note: This feature does not support the CDD and METRIC rules, as well as .xml files. The Generate Suggested Fix for [rule] with Generative AI option  option is not available for these items.

     
  2. AI-generated code and recommendations will appear in the AI Suggested Fix panel.

  3. To apply the AI-generated solution, copy the recommended code snippet using the Copy code option and replace the appropriate code section with it. If multiple snippets are returned, only the first code snippet is copied. You can also highlight a fragment of the suggested solution, and then copy and paste it using keyboard to the appropriate place.click the Apply fix button. A diff view of the code will open, allowing the user to edit the code if needed before appending it to the test class.