Parasoft extends your AI coding agent with the ability to create unit tests based on coverage information. The query_line_coverage MCP tool analyzes coverage data and identifies uncovered code, enabling AI agents to create unit tests that help maximize code coverage. For details on the query_line_coverage tool, see Configuring the MCP Server Extension for AI Agents.

Creating Unit Tests Example

Prerequisites:

  • dotTEST 2026.1 or later is installed with the MCP server. 
  • AI Agent is configured to use the MCP server.

In the following example, the AI Agent generates unit tests based on coverage data collected after running dottestcli.

  1. Get a coverage.xml file for your project. The file contains information about covered and uncovered lines of code.
  2. In the AI Agent chat window, ask the LLM to improve your code coverage based on the provided coverage.xml file.
  3. The AI Agent will: 
    1. Use the query_line_coverage tool to process the coverage.xml file and get information about uncovered lines of code.
    2. Add relevant tests to cover the missing lines.
  • No labels