ValueMomentum Logo
AI & Emerging Technologies
View Only

Iterative Unit Tests Generation & Validation V2

V1V2

This showcases our approach to generating unit tests for TypeScript, Cobol and Python files. V2 provides improved test case generation

Example Screenshots Demonstrating the Implementation of Generated Unit Test Cases using LLM's

Directory structure before test cases were generated

Processing Screenshot

Directory structure after test cases were generated

Processing Screenshot

Sample unit tests generated

Processing Screenshot

Sample unit tests generated

Processing Screenshot

Cobol test cases generated

Processing Screenshot


Business Context

Legacy applications often lack unit tests, making updates and refactoring risky and time-intensive. Manual test creation is laborious and inconsistent, especially for unsupported codebases. Automating unit test generation improves code coverage, reliability, and modernization efficiency, enabling organizations to enhance software quality, reduce technical debt, and save time while minimizing risks during legacy system updates.

Problem Statement

This PoC focuses on automating unit test generation for legacy systems, eliminating inefficiencies and inconsistencies in manual processes. It enhances test creation speed, ensures better coverage and stability, and supports reliable code updates, ultimately streamlining modernization efforts and improving the quality and reliability of legacy applications.

Impact and Importance

Automating unit test generation for legacy applications saves time, ensures consistent and comprehensive code coverage, and improves code quality by catching regressions during updates. It accelerates modernization efforts by reducing technical debt and enabling confident refactoring. Additionally, automated tests minimize the risk of undetected bugs, leading to more stable, reliable, and efficiently managed legacy systems.

Developer Setup

To set up and run this PoC locally, follow these steps:

  1. Ensure you have Python 3.9+ on your system.
  2. Clone the repository containing the PoC code. Navigate to the folder and install the dependencies:
    pip install -r requirements.txt
  3. Ensure you have Jest Configuration set up for running TypeScript files and Pytest configuration set up for running Python files.
  4. Navigate to src/flow_manager, to run the file:
    python flow_manager.py --source_directory <dir> --target_directory <dir> --mode <mode> --ignore <patterns>

V2 Unit Tests Generator Demo