## 7 Discussion  
The present research focused on source code fault assessment and classification. In software engineering and programming education, logic error assessment in source code is challenging for both student and professional programmers. We conducted experiments to assess and detect logic, semantic, and syntax errors in source code and classify source code as correct or incorrect using various models. The experimental results were compared with those for traditional unsupervised and other neural-network-based unsupervised models. The proposed model had the best performance. The performance of a seq2 seq language model strongly depends on the selection of the optimal number of hidden layers. This selection is based on the perplexity value. We calculated the perplexity during the training period. Figure 5 shows the perplexity of the RNN, LSTM, and LSTM-AttM models with various numbers of hidden layers at last epoch for various problems. The perplexity of 100, 150, and 300 layers are much higher than the 200 layers. Figure 6 shows the epoch-wise perplexity of models with 200 hidden layers for various problems. The perplexity was lowest for the 200-layer models that is why we selected 200-layer models for all experiments. We measured the training accuracy of the proposed language model and other models. The proposed LSTM-AttM model had the highest training accuracy (see Table 2). In software engineering and programming education, the assessment and detection of logic errors in source code is a challenge. To address this problem, we used an attention-based language model using a deep LSTM neural network. After slight modification in source code pre-processing phase, the proposed model can be useful for any type of source code (Python, C++, Java, etc.). While a software system may be large, it has several functions (routines) that each have a limited number of lines. Some source codes are similar to such a routine. The difficulty level of each source code is not one, some source code uses complex mathematical logic and functions and some use simple. To evaluate our model, we used mixed (easy, medium, and hard) source code for error detection. The syntax error assessment and detection accuracy (see Table 4) for the proposed LSTM-AttM model was better than those for the LSTM and RNN models. The average accuracy of the proposed LSTM-AttM model was 94.8%, whereas those of LSTM and RNN models were 84.2% and 77.4%, respectively. The logic error assessment and detection accuracy is shown in Table 6. For logic error detection, the proposed model \begin{table}
\begin{tabular}{l l c} \hline \hline \multicolumn{1}{c}{**Model**} & \multicolumn{1}{c}{**Description**} & \multicolumn{1}{c}{**F-Measure**} \\ \hline RF+DBN [43] & RF is used for classification based on hidden features & 0.50 \\  & extracted using DBN. & & 0.50 \\ RNN & A basic RNN is used to develop a language model for & & 0.55 \\  & source code fault detection and prediction. & & \\ LSTM & A standard LSTM network is adapted to develop a & & \\ LSTM & language model for source code error detection, & & 0.79 \\  & prediction, and classification. & & \\ DP-ARNN [30] & DP-ARNN is a defect prediction model that uses & & 0.56 \\  & attention-based RNNs. & & 0.83 \\ LSTM [29] & A source code error detection and prediction model & & \\  & based on a deep LSTM-based language model. & & \\  & A deep seq2 seq language model that uses an attention & & \\  & mechanism + LSTM [29] network with customized & & \\ LSTM-AttM (Proposed) & hyperparameters for source code error assessment and & & 0.94 \\  & detection and source code classification based on & & \\  & estimated error probability. & & \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Comparison with baseline models for defective source code classification. (92.2%) outperformed LSTM (78.2%) and RNN (60.2%). To assess and detect logic errors in source code, the attention mechanism considers all input sequences because logic error detection is more complex than other error detection.