Block-based visual programming languages enable programmers to focus on programming thinking without excessive coding or syntax attention. We find that projects written in visual programming languages like Scratch also have bugs and code smells that cannot be avoided automatically. Existing studies analyze these problems by converting code into Abstract Syntax Trees (ASTs) before analysis. This process is time-consuming and analyzing the AST directly can be complex. In this paper, we propose a novel code image-based static analysis approach for visual programming languages, which mines code patterns in images to pre-determine whether there are problems in projects without parsing them first. We train a code image object detection network to judge whether the input projects are likely to have bugs or smells. Further analysis is performed only on potentially problematic projects. Based on the proposals of the detection network, we analyze the key areas of the AST and identify the specific code problems. Experiments show that compared with others, our method can quickly determine code problems and accurately locate them. For the code image detection task, the improved model can achieve higher mean average precision (MAP) faster in the training phase, while the model is smaller and faster in inference.
- Article type
- Year
- Co-author
Open Access
Issue
Open Access
Issue
As one of the most popular visual programming languages, Scratch has a lot of evaluation around it. Reasonable evaluation can help programmers understand their projects better. At the same time, it can also provide a reference for them to browse other projects in the online community. Most of the existing evaluations on Scratch are carried from three perspectives: Computational Thinking (CT) ability, visual presentation aesthetics, and code quality. Among them, the assessment of CT and code quality is mainly carried out from the program script, while the evaluation of visual aesthetics is analyzed from the perspective of image sequences generated by project execution. The single-view evaluation focuses on the performance of a program in a certain aspect and is one-sided. In this paper, we propose a multi-view evaluation framework to integrate various evaluations using different policies. We quantitatively analyze the assessment of different views driven by data. Combined with overall evaluations that represent human opinions, we analyze their differences and connections. Through experiments, we determine the weights of different integration policies, the proposed multi-view evaluation method can generate evaluation results similar to human opinions.
京公网安备11010802044758号