Summary: | The IT community contains a vast amount of code snippets, but the quality of these codes cannot be guaranteed, causing inconvenience for users in discovering and utilizing them. If quality evaluation can be conducted on these codes to provide reference for users, it will greatly improve the user experience. Existing code quality evaluation methods primarily analyze the source code, which is more suitable for complete program in software projects and not applicable to fragmented codes in IT communities. To address this issue, this paper proposes a code quality evaluation model(CQCS) based on the sentiment analysis of user comments. The model collects user sentiment comments from the IT community as training data using a semi-supervised approach, balances the data using the Synthetic Minority Oversampling Technique(SMOTE), applies Word2Vec for text vectorization, performs sentiment analysis on the user comment using a Long Short-Term Memory(LSTM) model, and finally evaluates code quality according to the sentiment analysis results. A higher proportion of positive sentiment data indicates better code quality. The performance and practicality of the CQCS model are experimentally evaluated using data obtained from the Chinese Software Developer Network(CSDN) developer community. The experimental results demonstrate the practicality and effectiveness of the proposed method. © 2023 IEEE.
|