# Mining on Students' Execution Logs and Repairing Compilation Errors Based on Deep Learning
## 3 Mining on Students' Execution Logs
The number of capsules in the capsule network was set to three, with a dynamic routing count of three. During the training phase, a dropout rate of 0.3 was set. The Adam optimization method was used for parameter optimization, with a gradient clipping value of 1.0. Thebatch size was set to 30, and the learning rate was set to 0.00005. In the predicting phase, a beam size of 20 was used for the beam search. For programs containing multiple lines of errors, we employed an iterative repair strategy where we took the first error message provided by the compiler as input. The GCC compiler was utilized to assess the acceptability of patches. If the patched program resulted in fewer compiler errors, the repair patch was accepted. The verification process continued iteratively, with a threshold of five iterations. Once the maximum number of iterations was reached or the patch passed the compiler verification, the repair process stopped. The process of program iteration repair is illustrated in Figure 5. Here, \"compiler err msg\" represents the description of the first error provided by the compiler, and \"compiler err line#\" indicates the line number where the first error occurs according to the compiler's suggestion. \"pred err line#\" denotes the line number predicted by the model as the error location and the position to be modified for patching. It is important to note that \"pred err line#\" may differ from \"compiler err line#\", as the suggested error location by the compiler is often distinct from the actual correct modification position. \"pred_code_candidate\" refers to the predicted candidate patch suggested by the model, while \"pred code (edit)\" signifies the repair patch that has been verified and accepted through the compiler. As observed, multiple errors were detected in code line #2. In each iteration, the first feedback provided by the compiler is used as input to the model for prediction. The predicted patch is then validated by the compiler, and the final decision to apply the repair patch is made before proceeding to the next iteration. Figure 5: Process of program iteration repair. The modifications made after each round of iteration are highlighted in red font. ### Results Analysis

#### 6.5.1 RQ1: Repair Performance Comparison

The performance comparison results of different repair models on the three datasets are shown in Table 3. Our method demonstrated significant improvements compared to models such as DeepFix and SampleFix, which do not have compiler feedback information. Additionally, on the raw dataset, our RepairAcc increased by 4.8%, 4.9%, and 2.3%, respectively, compared to the previously best-performing DrRepair model. It is worth noting that the DeepFix dataset consists of more complex programs with multiple lines of errors, which is why the complete repair rate is relatively lower compared to the other datasets. In the validation set of perturbation-generated data, our model outperformed the DrRepair model in terms of both LocalizeAcc and SingleAcc. Furthermore, it exhibited even greater improvement on the DeepFix dataset, indicating that our model was capable of better capturing the intricacies of program semantics. #### 6.5.2 RQ2: Performance of the RS

We used the RS separately on the TEGCER and SUES-COJ datasets to generate repair examples, resulting in the RS-generated dataset. We then conducted a statistical analysis to determine the quantities and proportions of different error types in both the raw and generated data. The results are presented in Tables 4 and 5. For common high-frequency error types--E1, E2, and E3--the RS can generate a large number of corresponding erroneous code samples while maintaining the high frequency of occurrence of these errors. Errors E4 and E6 are commonly observed in certain programming tasks but have a generally low overall frequency. Due to their complexity, it is challenging to extract semantic features for these types of errors, making it difficult to accurately simulate and reproduce them.