Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2021 Mar 27;21(7):2338.
doi: 10.3390/s21072338.

Can EEG Be Adopted as a Neuroscience Reference for Assessing Software Programmers' Cognitive Load?

Affiliations

Can EEG Be Adopted as a Neuroscience Reference for Assessing Software Programmers' Cognitive Load?

Júlio Medeiros et al. Sensors (Basel). .

Abstract

An emergent research area in software engineering and software reliability is the use of wearable biosensors to monitor the cognitive state of software developers during software development tasks. The goal is to gather physiologic manifestations that can be linked to error-prone scenarios related to programmers' cognitive states. In this paper we investigate whether electroencephalography (EEG) can be applied to accurately identify programmers' cognitive load associated with the comprehension of code with different complexity levels. Therefore, a controlled experiment involving 26 programmers was carried. We found that features related to Theta, Alpha, and Beta brain waves have the highest discriminative power, allowing the identification of code lines and demanding higher mental effort. The EEG results reveal evidence of mental effort saturation as code complexity increases. Conversely, the classic software complexity metrics do not accurately represent the mental effort involved in code comprehension. Finally, EEG is proposed as a reference, in particular, the combination of EEG with eye tracking information allows for an accurate identification of code lines that correspond to peaks of cognitive load, providing a reference to help in the future evaluation of the space and time accuracy of programmers' cognitive state monitored using wearable devices compatible with software development activities.

Keywords: bio-signal processing; biofeedback; electroencephalogram; human error; software engineering.

PubMed Disclaimer

Conflict of interest statement

The authors declare no conflict of interest.

Figures

Figure 1
Figure 1
Representative schematics of one trial procedure, involving the fixed cross, in a screen, before and after the relevant tasks for analysis, i.e., the reading control task and the code comprehension task.
Figure 2
Figure 2
Complexity level of each code tasks according to each one of the five software complexity metrics used.
Figure 3
Figure 3
Schematic representation of the acquisition setup.
Figure 4
Figure 4
Examples of some artifact components that were identified and removed: (i) In component IC1, an eye blinking artifact component can easily be recognized; (ii) component IC2 contains cardiac artifact; (iii) component IC3 shows another example of ocular artifacts, the saccades/microsaccades; and (iv) component IC10 contains involuntary muscle movement.
Figure 5
Figure 5
Schematic representation of the feature normalization and transformation steps.
Figure 6
Figure 6
p-values of the pairwise comparison of the classification model options, with Bonferroni correction. The values higher than the significance level of 0.05 are colored with light blue, while the intermediate blue is related to a significance level of 0.05 and dark blue to a significance level of 0.01. PCA: Principal Component Analysis; Krusk: Kruskal-Wallis H test; NMI: Normalized Mutual Information; Reli: ReliefF Algorithm; SVM: Support Vector Machine; FLDA: Fisher Linear Discriminant Analysis classifier; kNN: k-nearest neighbors algorithm; Naive: Naive Bayes classifier.
Figure 7
Figure 7
Mental effort felt by the participants and written on the NASA-TLX for the three different Code tasks.
Figure 8
Figure 8
Topographic map representing the percentage of the features corresponding to each electrode after feature selection with Kruskal–Wallis H test, for the multiclass scenario C1 vs. C2 vs. C3 vs. Control.
Figure 9
Figure 9
Radar plot depicting which type of features are more frequent (in %) in the dataset obtained after feature selection, for the multiclass scenario C1 vs. C2 vs. C3 vs. Control.
Figure 10
Figure 10
Example of the fusion of EEG with eye tracking, for an intermediate participant during Code task 1. (A) Density of gaze points with the red line as a reference of 50% of the maximum row density; (B) clusters of gaze points over time and the y-axis; (C) code task figure overlapped with gaze points; and (D) discriminant EEG features values over time.
Figure 11
Figure 11
Example of the fusion of EEG with eye tracking, for an expert participant during the Code task 2. (A) Density of gaze points, with the red line as a reference of 50% of the maximum row density; (B) clusters of gaze points over time and the y-axis; (C) code task figure overlapped with gaze points; and (D) discriminant EEG features values over time.

References

    1. McConnell S.C. Code Complete: A Practical Handbook of Software Construction. Microsoft Press; Redmond, WA, USA: 2004.
    1. Shah S.M.A., Morisio M., Torchiano M. The impact of process maturity on defect density; Proceedings of the 2012 ACM-IEEE International Symposium on Empirical Software Engineering and Measurement; Lund, Sweden. 19–20 September 2012; New York, NY, USA: ACM/IEEE; 2012. pp. 315–318. - DOI
    1. Boehm B., Port D., Jain A., Basili V. Achieving CMMI Level 5 improvements with MBASE and the CeBASE method. CrossTalk. 2002;15:9–16.
    1. Honda N., Yamada S. Empirical Analysis for High Quality SW Development. Am. J. Oper. Res. 2012 doi: 10.4236/ajor.2012.21004. - DOI
    1. Zhang H. An investigation of the relationships between lines of code and defects; Proceedings of the 2009 IEEE International Conference on Software Maintenance; Edmonton, AB, Canada. 20–26 September 2009; pp. 274–283. - DOI

LinkOut - more resources