Інформаційна система з використанням GenAI для автоматичної генерації юніт тестів у код (з можливою інтеграцією його в CI/CD процес)
Loading...
Date
Journal Title
Journal ISSN
Volume Title
Publisher
Національний університет "Львівська політехніка"
Abstract
Бакалаврська кваліфікаційна робота присвячена розробці інформаційної системи, яка використовує можливості генеративного штучного інтелекту (GenAI) для автоматичної генерації юніт тестів у програмному коді з потенційною інтеграцією цього процесу в CI/CD пайплайни. Актуальність теми зумовлена зростаючою складністю програмних рішень, вимогами до високої якості коду та обмеженим часом, доступним на написання тестів вручну. Інтеграція штучного інтелекту в процес розробки дозволяє значно підвищити ефективність та продуктивність розробників, а також забезпечити автоматизацію тестування в рамках сучасних методологій DevOps та MLOps.
У роботі здійснено аналіз предметної області, зокрема сучасних підходів до генерації юніт тестів, переваг і обмежень використання LLM-моделей у розробці програмного забезпечення, та практик CI/CD. Проведено порівняльний аналіз існуючих рішень та платформ, зокрема testim.io, GitHub Copilot та CodiumAI. На основі дослідження сформульовано вимоги до функціональності системи та побудовано дерево цілей, що дозволило структурувати ключові задачі.
Архітектура системи реалізована за принципами мікросервісності із розділенням на окремі компоненти: бекенд (FastAPI), фронтенд (React), база даних (PostgreSQL) та сервіс генерації тестів. Система підтримує авторизацію, завантаження репозиторіїв користувача, виклик GenAI-модуля на основі змін у коді, та збереження згенерованих тестів у вигляді комітів. Передбачено механізм введення GitHub-токена для можливості пушу змін у приватні репозиторії. Окрема увага приділена створенню GitHub Actions-воркфлоу для обробки згенерованих тестів, що дозволяє автоматично очищати зайві рядки та оптимізувати формат тестів.
У процесі реалізації використано низку сучасних технологій: Docker для контейнеризації, GitHub API для інтеграції з репозиторіями, pytest для структурування юніт тестів, та GitHub Actions для CI/CD. Проведено налаштування середовища розробки, побудову логічної та фізичної моделі бази даних, розробку REST API та графічного інтерфейсу користувача.
Система підтримує авторизовану взаємодію користувача з репозиторіями, автоматичне оновлення змін, генерацію тестів, їх перегляд та редагування. Проведено тестування розробленої системи: функціональне, інтерфейсне, а також тестування GitHub інтеграцій, що підтвердило коректність і надійність реалізації. Здійснено обґрунтування вибору технологій, створено інструкцію користувача та визначено можливі напрями для подальшого розвитку системи, зокрема впровадження багатокористувацької аналітики, інтеграції з іншими платформами (Bitbucket, GitLab) та підтримку інших типів тестування (інтеграційного, E2E).
Розроблена система є ефективним інструментом для автоматизації створення тестів, що значно знижує навантаження на команду розробників, сприяє підвищенню якості коду та відповідає сучасним вимогам до розробки програмного забезпечення в умовах швидких ітерацій та високих вимог до надійності.
The bachelor’s thesis is dedicated to the development of an information system that utilizes Generative Artificial Intelligence (GenAI) to automatically generate unit tests for source code, with the potential for integration into CI/CD pipelines. The relevance of the topic arises from the increasing complexity of software systems, growing demands for code quality, and the limited time developers can allocate to manual test creation. The integration of artificial intelligence into the development lifecycle enhances developer productivity and enables the automation of testing processes in line with modern DevOps and MLOps practices. The study includes an in-depth analysis of the domain, exploring current approaches to unit test generation, advantages and limitations of using LLM models in software development, and best practices for continuous integration and delivery. A comparative review of existing solutions such as testim.io, GitHub Copilot, and CodiumAI was conducted. Based on the analysis, system requirements were defined and a goal tree was developed to structure key objectives. The system architecture follows microservice principles and is divided into distinct components: backend (FastAPI), frontend (React), database (PostgreSQL), and the test generation service. The platform supports user authentication, repository management, interaction with the GenAI module based on code changes, and saving generated tests as Git commits. A mechanism for GitHub token input is provided to enable pushing to private repositories. Special attention was given to implementing a GitHub Actions workflow that automatically processes generated test files—removing unnecessary lines and improving their structure. Modern technologies were utilized in the implementation: Docker for containerization, GitHub API for repository integration, pytest for unit test structuring, and GitHub Actions for CI/CD automation. The development environment was configured, and the logical and physical database models were designed alongside a REST API and user interface. The system allows authenticated users to interact with repositories, track changes, trigger test generation, review and manage generated tests. Extensive testing was conducted, including functional, interface, and GitHub integration testing, confirming the system's correctness and reliability. The choice of technologies was justified, user documentation was created, and potential areas for future improvement were identified, such as multi-user analytics, integration with other platforms (e.g., GitLab, Bitbucket), and support for other testing types (integration, E2E). The developed system provides an efficient tool for automating test generation, significantly reducing the workload on development teams, enhancing code quality, and aligning with modern software engineering demands that prioritize speed, reliability, and automation.
The bachelor’s thesis is dedicated to the development of an information system that utilizes Generative Artificial Intelligence (GenAI) to automatically generate unit tests for source code, with the potential for integration into CI/CD pipelines. The relevance of the topic arises from the increasing complexity of software systems, growing demands for code quality, and the limited time developers can allocate to manual test creation. The integration of artificial intelligence into the development lifecycle enhances developer productivity and enables the automation of testing processes in line with modern DevOps and MLOps practices. The study includes an in-depth analysis of the domain, exploring current approaches to unit test generation, advantages and limitations of using LLM models in software development, and best practices for continuous integration and delivery. A comparative review of existing solutions such as testim.io, GitHub Copilot, and CodiumAI was conducted. Based on the analysis, system requirements were defined and a goal tree was developed to structure key objectives. The system architecture follows microservice principles and is divided into distinct components: backend (FastAPI), frontend (React), database (PostgreSQL), and the test generation service. The platform supports user authentication, repository management, interaction with the GenAI module based on code changes, and saving generated tests as Git commits. A mechanism for GitHub token input is provided to enable pushing to private repositories. Special attention was given to implementing a GitHub Actions workflow that automatically processes generated test files—removing unnecessary lines and improving their structure. Modern technologies were utilized in the implementation: Docker for containerization, GitHub API for repository integration, pytest for unit test structuring, and GitHub Actions for CI/CD automation. The development environment was configured, and the logical and physical database models were designed alongside a REST API and user interface. The system allows authenticated users to interact with repositories, track changes, trigger test generation, review and manage generated tests. Extensive testing was conducted, including functional, interface, and GitHub integration testing, confirming the system's correctness and reliability. The choice of technologies was justified, user documentation was created, and potential areas for future improvement were identified, such as multi-user analytics, integration with other platforms (e.g., GitLab, Bitbucket), and support for other testing types (integration, E2E). The developed system provides an efficient tool for automating test generation, significantly reducing the workload on development teams, enhancing code quality, and aligning with modern software engineering demands that prioritize speed, reliability, and automation.
Description
Keywords
6.126.00.01, інформаційна система, генеративний штучний інтелект, unit tests, тестування, генерація коду, GenAI, FastAPI, React, PostgreSQL, GitHub Actions, CI/CD, автоматизація, information system, generative AI, unit testing, test automation, GenAI, FastAPI, React, PostgreSQL, GitHub Actions, CI/CD, software quality
Citation
Полапа М. О. Інформаційна система з використанням GenAI для автоматичної генерації юніт тестів у код (з можливою інтеграцією його в CI/CD процес) : кваліфікаційна робота на здобуття освітнього ступеня магістр за спеціальністю „6.126.00.01 — Інтелектуальні інформаційні технології“ / Максим Олександрович Полапа. — Львів, 2024. — 73 с.