Criação de um modelo automático (baseado no Google Gemini) para fazer inspeção de issues de projetos da Apache foundation para classificar se o issue tem algum tipo de impacto arquitetural ou não.
Trabalho principal: ATDCodeAnalyzer Evaluation in Open-source projects
Requisitos básicos da implementação
Instruções detalhadas dos prompts
Input: issues.csv e critical_issues
critical_issues = [
{
"summary": "Memory leak in core service",
"description": "The service responsible for handling user requests seems to be experiencing a memory leak. Memory usage keeps increasing over time, eventually leading to crashes and service disruptions.",
"comments": "[User C] This issue has caused several outages in the past week. High priority to fix."
},
{
"summary": "Database schema not optimized for frequent writes",
"description": "The current database schema involves complex joins and aggregations, leading to slow performance when writing large amounts of data. This is causing bottlenecks in our data ingestion pipeline.",
"comments": "[Tech Lead] We need to investigate database optimization techniques to improve write performance."
}
]
Rode o programa principal:
python3 myinspection.py
Output: resultados dos issues analisados pelo modelo
Issue Summary: summary do issue
Gemini Answer (Architectural Issue): YES ou NO
Explanation: Justificativa do Architectural Issue
--- chain_of_thought_prompt ---
Few-Shot prompts generated and saved to prompts.txt
Wait for Train with Few-Shot prompts...
Send prompt to Gemini and get response...
##################################################
Resultado da analise do issue Memory leak in core service
Issue Summary: Memory leak in core service
Gemini Answer (Architectural Issue): YES
Explanation:
The issue of a memory leak inthe core service has an architectural impact because it affects the overall design and structure of the system. A memory leak occurs when a program allocates memory but fails torelease it, leading to a gradual increase in memory usage over time. This can have several negative consequences:
Code Structure: A memory leak can indicate a flaw in the code structure, such as improper memory management practices or missing cleanup routines. This can make the code difficult to maintain and debug.
Maintainability: A memory leak can make it challenging to maintain the system, as it can be difficult to track down the source of the leak and implement a fix.
Scalability: A memory leak can limit the scalability of the system, as it can lead to performance degradation and crashes as memory usage increases.
Design Flaws: A memory leak can be a symptom of a deeper design flaw in the system, such as a lack of proper resource management or a failure to consider memory usage in the design.
Wait for Train with Few-Shot prompts... Send prompt to Gemini and get response... ################################################## Resultado da analise do issue Database schema not optimized for frequent writes Issue Summary: Database schema not optimized for frequent writes Gemini Answer (Architectural Issue): YES Explanation: The issue has an architectural impact becausethe database schema is not optimized for frequent writes. This means that the database is not designed to handle the high volume of write operations efficiently. This can lead toperformance problems, such as slow write times and data integrity issues.
The following are some of the potential architectural impacts of this issue: