Parasoft Logo Search

Discover TÜV-certified GoogleTest with Agentic AI for C/C++ testing!
Get the Details »

Try Parasoft Jtest!

Make unit testing easier & faster with AI assistance.

Start Free Trial

WEBINAR

Watch Smarter Pull Requests: AI That Tests, Fixes, & Validates Java Code

New AI code generation workflows are speeding up Java application development. But many teams are still figuring out how to scale testing and code quality practices alongside them. As code changes increase, development teams face new pressure—tasks like unit test creation and static analysis remediation still require meaningful engineering effort.

 

In this video, see how agentic AI supports testing and code analysis directly within the pull request workflow.

You’ll learn how to:

  • Automatically trigger static analysis and unit testing workflows on every pull request using agentic AI.
  • Detect, fix violations, and verify those fixes using LLM agents before merging code.
  • Generate unit tests for modified code to strengthen quality at the PR level and meet quality gates.
  • Combine static analysis remediation and unit test generation into one autonomous CI/CD workflow.

The Evolution to Intelligent Workflows

Traditionally, when a pull request is created, it triggers a CI/CD job that runs static analysis and unit tests. If issues are found, it’s up to the developer to manually review the reports, understand the problems, fix them, and then wait for the process to run again. This manual remediation is time-consuming and leads to context switching, slowing down development and increasing the risk of defects.

The new approach involves intelligent, agentic workflows. Instead of just identifying problems, these workflows can autonomously:

This modern workflow leads to lower technical debt, faster feedback cycles, improved regression confidence, and allows developers to focus more on writing code rather than fixing issues.

How It Works: A Technical Look

The typical pull request workflow starts with a developer creating a feature branch and then a pull request. This triggers a CI/CD process that runs static analysis and unit tests. If violations or test failures occur, the developer manually addresses them. This is followed by a manual code review before the pull request can be merged.

An agentic workflow replaces the human-driven remediation process with an AI agent. This agent accesses the analysis results and can automatically fix issues. It then creates its own pull request with these fixes, which the developer can review before merging it into their original pull request. This significantly reduces the manual effort involved in fixing code violations and generating tests.

Live Demonstration

In a demonstration using IntelliJ and GitHub, a developer creates a branch and makes a code change. This change triggers a GitHub workflow configured to use an AI agent. This agent performs static analysis, fixes violations, and generates unit tests for uncovered code. It then creates a new pull request containing these automated fixes.

The developer can then review the AI-generated changes in this new pull request. If satisfied, they can merge these fixes into their original pull request. This process streamlines the remediation of code issues and ensures that quality gates are met without significant manual intervention.

Key Takeaways

  • AI is accelerating code generation but creating a quality gap.
  • Traditional validation and remediation workflows are slow and manual.
  • Agentic AI workflows can autonomously test, fix, and validate code changes.
  • This reduces developer effort, lowers technical debt, and improves code quality.
  • Keeping the human in the loop for review is essential for trust and control.
  • Combining traditional automation with agentic AI offers the best results.

Addressing Concerns: Trust and Cost

A common concern is how to trust AI-generated tests and fixes. The key is to keep the developer in the loop. Human review of AI-generated pull requests is crucial. Implementing these workflows within the pull request process, rather than on the main branch, allows for controlled oversight.

Another concern is the cost of LLM usage. Strategies to manage this include:

  • Optimizing the AI agent’s prompts and skills to reduce token usage.
  • Leveraging non-LLM-based tools for tasks like static analysis and unit test generation directly in the IDE or through build plugins. This pushes much of the work left, meaning the AI agent has less to do.
  • Implementing smart scripting to only invoke LLMs when necessary (e.g., when Java files are modified).
  • Using proprietary AI algorithms for tasks like bulk regression test suite generation, which are often more efficient than LLM-based approaches.

By combining robust, traditional testing tools with agentic AI workflows, teams can achieve significant benefits without sacrificing quality or breaking existing functionality. AI is still evolving, and a hybrid approach, where AI augments human expertise, is the most effective path forward.