Skip to main content

AutoDev 1.5.3 Precision Test Generation

· 3 min read

At the beginning of last year, our original intention for open-sourcing AutoDev was:

AutoDev is an open-source AI-assisted programming plugin for JetBrains IDEs. It can directly integrate with your requirement management systems (such as Jira, Trello, Github Issues, etc.). Within the IDE, with simple clicks, AutoDev automatically generates code based on your requirements. All you need to do is perform quality checks on the generated code. @

Today we've taken another step toward this goal: one-click generation of precision unit tests. In this article, we'll introduce features from version 1.4 (Team AI for teams) to version 1.5.3:

  • Precision automated test generation. Enhanced static code analysis for more accurate constructor generation; optimized prompts distinguishing testing approaches for Spring Controllers vs Services; added multiple test template types.
  • Local model enhancements. Provided AutoDev Coder dataset and models tailored for AutoDev; supported local data recording for knowledge distillation; allowed partial system prompt overriding for better custom model utilization.
  • Multi-language documentation. Added support for JavaScript, Rust, Python, and improved Kotlin documentation generation logic.
  • Automation workflow optimization. Introduced PrePush Review for AI-assisted code review before commit; streamlined commit message context with differentiated file/dependency change handling to reduce token usage.

Join us at: https://github.com/unit-mesh/auto-dev/ to build your own AI-assisted full-cycle coding companion.

During development, we selected ArchGuard - an open-source architecture governance platform built with Kotlin - as the pilot project for AutoDev's full-cycle AI assistance, continuously accumulating data and experience to better support Kotlin development.

1. Precision Test Generation

Drawing from experience generating 200+ tests across 90 test classes in ArchGuard, we've continuously optimized test generation logic (though some bugs may remain).

AutoDev can now directly generate ready-to-use unit tests with certain probability.

Precise Context

Current version provides test context containing:

  • Related class information
  • Complete input/output class details
  • Static analysis of Service-related information
  • Function parameter/return type analysis
  • Spring component detection (Controller/Service) with testing rule suggestions

See implementations: JavaTestContextProvider, KotlinTestContextProvider

Unit Test Templates: Team AI

To handle project-specific requirements (like special annotations in ArchGuard), we introduced customizable test templates for Controllers, Services, and other components. Manage templates through prompt-as-code approach and share within teams.

Documentation: https://ide.unitmesh.cc/customize/custom-test-template.html

Accurate API Test Data Generation

Enhanced static analysis for API test data generation through JavaTestDataBuilder and KotlinTestDataBuilder.

2. Local Model Optimization

Configure private model settings via AutoDev Coder in plugin preferences:

Public Model Knowledge Distillation

New Recording Instruction In Local feature enables:

  • Recording AI interaction data
  • Internal model fine-tuning samples
  • AutoDev debugging support

Plugin Prompt Overriding

Override core chat prompts:

  • Explain code
  • Refactor code
  • Fix issue
  • Generate test

More context interfaces coming via template approach.

3. Multi-Language Documentation

Added documentation generation support for:

  • Python
  • Rust
  • JavaScript

Optimized Kotlin handling to prevent redundant function comments from OpenAI.

4. Automation Workflow Optimization

PrePush Review

AI-assisted preliminary code review before commit.

Streamlined Commit Messages

Refined commit message generation through 167 real-world cases in ArchGuard, implementing token-efficient context handling.

Future Focus

  • Enhanced workflow automation: Better forward/backward process integration
  • UX improvements: Loading states and error handling upgrades
  • Test coverage expansion: Adding more unit tests for stability

Contribute at: https://github.com/unit-mesh/auto-dev/