| Code quality determines the cost of software development and maintenance.Highquality code with high maintainability,robustness,and extensibility can reduce the time and effort of a large number of developers.Code quality is important for both programming learners and developers.However,the current programming education,whether in the traditional programming education class or online programming learning platform,focuses on whether the learner’s code completes the task and the functionality of the code,but ignores the evaluation and guidance of the learner’s code quality.As a result,the programming quality of learners is generally low,and there is a huge gap between the code quality level of learners and the level required by industrial software development.The static code analysis tool is one of the key technologies to improve code quality.The static code analysis tool can help developers quickly and easily locate quality problems in code,so as to improve code quality.However,it has the defect of too many code alerts,which makes code alerts that are really important to developers less likely to be found,greatly reducing the ”effectiveness” of static code analysis tools.To make static code analysis tools work better,to save time and effort for developers,and to give programming learners more comprehensive and effective guidance on the quality of their code.This paper focuses on the alarm information of Sonar Qube,a static code analysis tool,and carries out analysis and research on the assessment and guidance of learners’ code quality assessment from different perspectives.The main work and contributions are summarized as follows:Static code analysis tools generate a lot of alerts in the real world,but only a small fraction of the alerts that actually cause software bugs and are important to developers are valid.First,the defect-related code alarm sequencing technology.First,we designed a set of automatic alarm labeling methods,including classifying the versions in the project into defect repair version and containing defect version through the SZZ algorithm,conducting analysis and scanning by incremental scanning,and then further obtaining the alarm of the corresponding line.Then,we took the alarm as the feature and the version type as the classification value,used three classification model algorithms,conducted experiments on a total of about 30,000 versions,and selected the optimal model and used its feature importance as the basis for the alarm ranking.This sort provides a prioritized reference for developers when fixing alerts and sets the stage for future student code quality assessments.Second,code quality assessment methods for programming learners.On the basis of our predecessors,we designed a code quality classification model for teaching purposes by combining the alarm categories in Sonar Qube static code tools.The classification model contains six first-level classifications,and we filter the 61 Sonar Qube alerts by specific rules and divide them into specific categories.In the classification results,we listed the alarms contained in each category and made an example analysis of the alarms in some categories.Furthermore,we applied the classification system to the online programming project data to analyze the overall code quality of students.Compared with the original category,this classification of code quality is more in line with learners’ cognitive characteristics when it is also suitable for static code analysis.Thirdly,the design of online programming learning comprehensive ability evaluation system.Based on Edu Coder platform,we developed a set of online programming learning comprehensive ability assessment method based on students’ code data and behavior data,which includes three key indicators,namely basic statistics,code quality assessment and programming efficiency.Then we designed the basic hierarchical structure of the system and the corresponding code quality feedback interface. |