Lourenço, Carlos Eduardo Ramos dos SantosSantos, Núria Carmélia Jalali Pinto dos2025-04-072025-04-0720252025http://hdl.handle.net/10400.5/100045Trabalho de projeto de mestrado, Informática, 2025, Universidade de Lisboa, Faculdade de CiênciasThis thesis explores the implementation of clean code best practices in Golang, a language designed for performance and efficiency. Emvenci is transitioning its codebase to a new architecture, adhering to modern software design principles. The primary objective is to refactor and optimize all e-learning service endpoints under this new architecture, with a focus on enhancing performance through parallelization and concurrency. A secondary objective is to propose additional guidelines, as needed. During the implementation, a systematic routine was established to streamline the process, documenting key steps and highlighting improvements to aid testers who lack direct access to the code. Performance optimization techniques were carefully applied to maintain a balance between complexity and efficiency. These techniques included parallelizing independent database accesses, consolidating repeated queries, and eliminating redundant code and unnecessary processing. Testing was conducted in two phases: clean code analysis and performance evaluation. Clean code metrics, such as maintainability index, cyclomatic complexity, and cognitive complexity, were assessed. In the performance phase, load tests measured processing time, CPU, and memory usage across endpoints. The results demonstrated significant improvements in system performance, though clean code metrics showed a decline due to the increased volume and complexity of the refactored functions. While the new architecture initially risked degrading performance, the applied optimizations ensured improvements in most endpoints. This suggests that similar techniques may yield benefits when refactoring other parts of the code. Additionally, the newly established documentation for both the clean architecture and performance testing will provide a foundation for future work at the company, setting expectations for quality and consistency.engCódigo limpoOtimizaçãoGoLangMelhores práticasDesenvolvimento de SoftwareTeses de mestrado - 2025Enhancing Software Code’s Quality and Performance for Optimal Resultsmaster thesis