Automated Program Code Checking in Student Programs Using Unit Tests and Special Static Code Analyzers
Year: 2025
Type: article
Abstract: When studying programming and other disciplines that involve writing programs, the program code written by students is very often checked by teachers exclusively manually.An increase in the number of students, assignments or their complexity, and attempts to pass will automatically increase the workload on the teacher several times.The paper describes methods for automated verification of program code with their advantages and disadvantages.The first option based on Black Box is most often used in Olympiad programming.The second option based on Unit tests (White Box) facilitates writing and checking assignments, but, unfortunately, is not widespread.Passing all Unit tests does not mean that the program code is of high quality.This code must be additionally checked by static code analyzers built into the platform (compiler) or such as SonarQube, Deepsource, Clang Static Analyzer, CppCheck.As an example, the task based on Unit tests of the Vector-And-Matrix-Education-Project was used, which contains 4 projects: MatrixDemo.Tests; MatrixDemo; VectorDemo.Tests; VectorDemo; and involves the implementation of 2 separate classes Vector and Matrix and requires the implementation of 26 methods and properties by the student.It is demonstrated that manipulations of the compilation process and influence on the assessment, access to personal information or causing harm (damage) can occur.The need to use special code analyzers during automated task verification is justified.Requirements for a special code analyzer are formulated.The use of two configuration files is proposed, namely: anticheater-rules.json with a full list of rules and active-rules.jsonwith active rules and settings for projects.The active-rules.jsonfile should contain the ActiveCodeRules and ProjectConfigurations sections.Based on the formulated № 8(49) 2025 990 requirements, the AntiCheater program was created, consisting of 3 projects, namely: AntiCheaterCore, AntiCheaterConfigurator and AntiCheaterConsole.The process of compiling, testing and analyzing students' work was carried out using command line utilities.The effectiveness of the special AntiCheater code analyzer is demonstrated using examples.
Source: Наука і техніка сьогодні
Author: Yuriy Antonov
Institution: Vasyl' Stus Donetsk National University
Language: Ukrainian
Subfield: Computer Science Applications
Field: Computer Science
Domain: Physical Sciences
Open Access status: bronze
OpenAlex ID: W4414062224
