LLM Unit Test Automation

AI-Powered Automated Unit Test Generation for Spring Boot Projects

Master Thesis Overview

This master thesis explores the application of Large Language Models (LLMs) in automated unit test generation for Java Spring Boot applications. The research demonstrates how ChatGPT can be integrated into Maven build processes to automatically analyze code coverage and generate unit tests, significantly improving testing efficiency.

Academic Achievement

  • Master of Science (M.Sc.) - Software Engineering
  • Frankfurt University of Applied Sciences
  • Focus: AI-Driven Software Testing Automation
  • Conducted at INFOMOTION GmbH

Innovation Impact

  • First comprehensive LLM-based Maven testing plugin
  • Significant cost & time reduction in test development
  • Enhanced test coverage through AI automation
  • Privacy-compliant enterprise LLM integration

Technology Stack & Architecture

LLM Integration

OpenAI GPT-3.5/GPT-4 with custom prompt engineering for Java test generation

Maven Plugin

Custom Maven plugin for seamless Spring Boot project integration

Coverage Analysis

JaCoCo integration for intelligent test coverage analysis and reporting

Enterprise Security

Azure-hosted private GPT instance ensuring data privacy and compliance

Research & Development Process

  1. 1

    Literature Review & Problem Analysis

    Comprehensive analysis of existing automated testing tools and LLM applications in software engineering, identifying gaps in Java Spring Boot testing automation.

  2. 2

    Design Science Research Methodology

    Applied systematic DSR approach with relevance, rigor, and design cycles to develop an innovative artifact addressing real-world testing challenges.

  3. 3

    Prompt Engineering Optimization

    Systematic development and evaluation of prompt strategies using Zero-Shot, One-Shot, and Few-Shot learning techniques for optimal test generation.

  4. 4

    Maven Plugin Development

    Built UTestGenLLM plugin with automated JaCoCo integration, intelligent class analysis, and seamless LLM communication for production environments.

  5. 5

    Comprehensive Evaluation

    Multi-project validation with quantitative metrics and expert evaluation, demonstrating significant improvements in test coverage and development efficiency.

Key Features & Capabilities

Intelligent Coverage Analysis

Automated JaCoCo integration analyzes existing test coverage, identifies untested classes and methods, and prioritizes test generation based on coverage gaps.

JaCoCo IntegrationSmart Analysis

LLM-Powered Test Generation

Advanced prompt engineering with context-aware test case generation using GPT-3.5/GPT-4, producing executable JUnit 5 tests with proper imports and structure.

GPT IntegrationJUnit 5

Maven Lifecycle Integration

Seamless integration into Maven build phases with configurable execution timing, automated error handling, and build process continuity.

Maven PluginBuild Integration

Enterprise-Grade Security

Private Azure-hosted GPT instances ensure sensitive code remains secure, with configurable API endpoints and comprehensive privacy compliance.

Azure SecurityPrivacy Compliant

Research Impact & Findings

95%
Time Reduction
Compared to manual test development
74%
Error-Free Tests
Generated without modification
84%
Success Rate
After minimal adjustments

Key Research Contributions

  • First comprehensive study integrating LLMs with Maven build processes for automated testing
  • Demonstrated significant cost reduction (€566 to €2.13) and time savings in test development
  • Validated effectiveness of prompt engineering techniques for technical code generation
  • Established framework for enterprise LLM integration in software development workflows

Technical Achievements & Validation

Coverage Improvements

Academy Project26% → 43%
Infomapper Project0% → 39%
Chart Checker Project0% → 43%
Average Improvement+33%

Quality Metrics

  • 71% test success rate on first execution
  • Automated JaCoCo integration and reporting
  • Context-aware test generation with imports
  • Configurable prompt engineering strategies
  • Enterprise-ready security and compliance
  • Seamless Spring Boot project integration