EEG: Identification of concentration level under Pair Programming∗ Ananga Thapaliya a.thapaliya@innopolis.ru Innopolis University December 9, 2019 Abstract In this paper we present preliminary research outcomes of an exper- imental investigation identified with the use of electroencephalography (EEG) device in estimation of various well defined programming tasks. We examine current strategies and problems of carrying out this experi- ment and specifically, we focus on the pair programming activity implied by modern EEG devices with given particular condition and specific cali- bration. 1 Introduction Programming and solving tasks is the result of our capacity to expand thoughts into calculations and is therefore mostly the immediate consequence of mental exercises [2]. As an outcome, programming best practices (factors) must work on the grounds that in some design they initiate productive behavior in pro- grammers. Clearly it is of extraordinary enthusiasm to see an ever increasing number of recommended practices influence mental movement to advance pro- ductivity. One of the most studied factor that affects the productivity is pair programming [4, 16, 1]. This paper examines the relation between brain and behavior for programmers when they program in pairs and alone and compares the result. 2 Related work Di Bella et al. [11] evidences that pair programming boosts productivity, prac- tically identical or much better than that accomplished by two individual pro- grammers; previous research has also evidenced the advantages of pair program- ming when introducing novices in teams [15], improves job satisfaction [25], and ∗ Copyright c 2019 for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). 1 promotes specific collaborations between team members [5]. Speculations have been made; a case of such theories is that pair programming prompts more elevated amount of focus, in this way decreasing the measure of imperfections embedded in the code [19, 7, 24]. Our paper continues the same research that was carried out two years ago which also deals with the concentration in brain wave between pair programming and solo programming [3]. Based on the previous literature works, it is known that pair programming is not only the key factor that affects the concentration level of brain-behavior relation but also we observe that the fundamental case of brainwave estimations are affected by a combination of different unspecific factors such as program- ming with (without music) and specific factors such as age, gender and job or programming experiences [13], [12], [22]. EEG is one of the common way to car- ryout the experiment but there are different other devices such as functional near infrared spectroscopy (fNIRS), functional magnetic resonance imaging (fMRI), and magnetoencephalography (MEG) that has been used to perform the exper- iment of data collection during the analysis of brain [20], [14]. 3 Methodologies The experiment was performed using 24 channel two Mitsar SMART-BCI Blue- tooth device with the default settings of this device as these settings were appli- cable for our experiment. The subjects were undergraduate students who were given some tasks from CodeForce to solve on the given amount of time. The tasks difficulty was based on the rating on the site itself. Participants had to solve the task on a pair programming set (being a navigator and driver) and on a solo programming set based on their own choice of programming language [10]. We used the EEG device with more than one channel, the underlying advance to endeavor is to pick the channels that are the focal point of the processing [6]. For this analysis, we chose the central terminals as we found that the frontal electrodes cannot be cleaned with EEG inclined methods [8]. For the central electrodes, cleaning was done with the use of filters that are notch filter (for removal of noise), high and low pass filters (for alpha and beta range) and amplitude filtering (for artifacts) [17], [18]. The processing and collection of data was carried out with the use of the official EEG software and for the analysis we use python programming language with the library MNE python version 0.16.1. 4 Experiment Between each participants, a pair was formed. Each experiment was held in one month period with similar environment and conditions on each day. The experiment consists of two phases. The initial phase is calibration phase which consist of two parts. The first one is that participant rests with the closed eyes doing nothing in a calm state and the second one is same with opened eyes. 2 The calibration phase quantifies the synchronization of alpha and theta wave. The second phase is the phase with actual roles and tasks. Participants now get started with solo programming. This continues for exactly sixty minutes. Now after the end of solo programming, participants are given five minutes break before the start of pair programming. During pair programming, one behaves as a driver and another as a navigator. The roles doesn’t matter because both participants have to start the experiment again with different roles. This also continues for sixty minutes. After the second phase of pair programming, participants are given 30 minutes break. During the break, participants are in complete rest state. After the break, the phase of pair programming starts just with the reversed roles of navigator and driver. 5 Analysis 5.1 Event Related Desynchronization (ERD) Data is stored in edf format and for the analysis purpose the formula of ERD is used. (amplitude)rest − (amplitude)programming ERD = × 100% (amplitude)rest For the experimental data, fast fourier transform is used to figure out the ERD for 2000ms window of the signal. Subsequently, we acquire a period ar- rangement or conveyance of ERD for each sub-band for each unique program- ming action. We give more consideration on theta waves as we believe them to be associated with higher memory load and on alpha waves as they have a solid reliance with consideration level and semantic memory handling. Using such data from section 4 gives us a comprehensive observation of how to analyze sub-band esteems. 5.2 Correlation The analysis of the connection of brainwaves recognizes the connections exist- ing among theta and alpha waves (upper and lower). Solid connections of these brainwaves clarify distinctive mental exercises and statuses. The connection analysis was not connected for EEG data previously, which implies that we con- nected this method so as to comprehend on the off chance that it may be utilized for future research. Using the relationship we analyze the Pearson’s connection coefficients between every one of the roles of pair programming. We consider the distinction between waves as the increment of neuron synchronization which suggests the expanding of consideration and memory burden forms. Utilizing this experimental data we can compute the connection on some sub-groups and contrast the outcomes with ERD. 3 6 Early Results And Discussion The analysis demonstrates to us that if there should be an occurrence of pair programming, the ERD is higher for navigator mode and the qualities are iden- tical for the other mode because of the non-concurrent lower alpha band. It may infer that pair programming in navigator mode requires more thought, and this mirrors the sense that the navigator role requires evaluating and controlling the improvement, which intuitively requires a gigantic effort of thought, also because of the way that the navigator isn’t locked in with a physical contact with the input device. With respect to the theta esteem, solo programming, navigator, and driver have values in the dropping request separately. In this way we discovered that theta and alpha waves are conversely relative to one another. The examination of the relationship for pair programming appears similar with the cases made with the examination of ERD. Actually, the small dataset isn’t unquestionable, so far watching a second investigation drove with a substitute procedure insinuating a comparative example as the main which gives some observational assertion of the clarification that the navigator in pair programming has more focus. 7 Problems The experiment was quite new, so finding suitable articles and references was not easy because of which defining the experimental protocol was difficult. Our EEG device being old, got a lot of muscle activity causing the participants to stay still and blink as less as possible [23] which decreased the number of participants. We were unable to experiment on the participants with thick hair because the EEG device was unable to reach the scalp of such participants. This decreased the range of our participants. Because of the environmental noise, more filtering was necessary for the data [26]. Also it is very difficult to find participants (dataset) as the experimental process is time consuming and effort intensive. Initiating the experiment and analyzing the experiment also takes a lot of time. This also depends on the experience of the researcher. 8 Conclusion We carried out this research with limited number of participants. We identified and compared the concentration level during pair-programming using the anal- ysis process of ERD and correlation with EEG device. We found out that the ERD of navigator mode in pair programming is higher and some qualities being same for the other mode of pair-programming. When compared with correla- tion, the results were quite similar supporting the exactness of the experiment. Although there were some problems encountered, we can say that the research and the experiment under a small data set gave us good results. 4 9 Future research We will carry out the research with a large dataset and extend the experi- ment to industry with professional software developers and the research will not be limited to EEG but also we will use other available devices. This will let our research to be more vivid and exact. These other devices can have less confinements and issues making the experiment less dreary and less exertion concentrated with progressively strong results [9], [21]. References [1] L. Ahonen, B. U. Cowley, A. Hellas, and K. Puolamäki, “Biosignals re- flect pair-dynamics in collaborative work: Eda and ecg study of pair- programming in a classroom environment,” Scientific reports, vol. 8, no. 1, p. 3138, 2018. [2] P. Brereton, B. A. Kitchenham, D. Budgen, M. Turner, and M. Khalil, “Lessons from applying the systematic literature review process within the software engineering domain,” Journal of systems and software, vol. 80, no. 4, pp. 571–583, 2007. [3] S. Busechian, V. Ivanov, A. Rogers, I. Sirazitdinov, G. Succi, A. Tormasov, and J. Yi, “Understanding the Impact of Pair Programming on the Minds of Developers,” in Proceedings of the 40th International Conference on Soft- ware Engineering Companion, ser. ICSE-NIER’18. Gothenburg, Sweden: ACM, May-June 2018. [4] E. A. Chaparro, A. Yuksel, P. Romero, and S. Bryant, “Factors Affecting the Perceived Effectiveness of Pair Programming in Higher Education,” 17th Workshop of the Psychology of Programming Interest Group, no. June 2005, pp. 5–18, 2005. [5] I. D. Coman, P. N. Robillard, A. Sillitti, and G. Succi, “Cooperation, collaboration and pair-programming: Field studies on backup behavior,” Journal of Systems and Software, vol. 91, pp. 124–134, 2014. [Online]. Available: http://dx.doi.org/10.1016/j.jss.2013.12.037 [6] I. Crk and T. Kluthe, “Toward using alpha and theta brain waves to quan- tify programmer expertise,” in 2014 36th Annual International Conference of the IEEE Engineering in Medicine and Biology Society. IEEE, 2014, pp. 5373–5376. [7] I. Crk, T. Kluthe, and A. Stefik, “Understanding programming expertise: an empirical study of phasic brain wave changes,” ACM Transactions on Computer-Human Interaction (TOCHI), vol. 23, no. 1, p. 2, 2016. [8] S. Das, D. Tripathy, and J. Raheja, An Insight to the Human Brain and EEG, 01 2019, pp. 13–24. 5 [9] R. DeCharms, “Methods for measurement and analysis of brain activity,” May 13 2004, uS Patent App. 10/628,875. [10] D. P. Delorey, C. D. Knutson, and S. Chun, “Do programming languages affect productivity? A case study using data from open source projects,” First International Workshop on Emerging Trends in FLOSS Research and Development, FLOSS’07, pp. 0–4, 2007. [11] E. di Bella, I. Fronza, N. Phaphoom, A. Sillitti, G. Succi, and J. Vlasenko, “Pair programming and software defects–a large, industrial case study,” IEEE Transactions on Software Engineering, vol. 39, no. 7, pp. 930–953, 2013. [12] Z. G. Doborjeh, N. Kasabov, M. G. Doborjeh, and A. Sumich, “Modelling peri-perceptual brain processes in a deep learning spiking neural network architecture,” Scientific reports, vol. 8, no. 1, p. 8912, 2018. [13] M. Fisher, A. Cox, and L. Zhao, “Using sex differences to link spatial cognition and program comprehension,” in 2006 22nd IEEE International Conference on Software Maintenance. IEEE, 2006, pp. 289–298. [14] B. Floyd, T. Santander, and W. Weimer, “Decoding the representation of code in the brain: An fmri study of code review and expertise,” in 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE). IEEE, 2017, pp. 175–186. [15] I. Fronza, A. Sillitti, and G. Succi, “An Interpretation of the Results of the Analysis of Pair Programming During Novices Integration in a Team,” in Proceedings of the 2009 3rd International Symposium on Empirical Software Engineering and Measurement, ser. ESEM ’09. IEEE Computer Society, 2009, pp. 225–235. [Online]. Available: http://dx.doi.org/10.1109/ESEM.2009.5315998 [16] A. Janes and G. Succi, Lean Software Development in Ac- tion. Heidelberg, Germany: Springer, 2014. [Online]. Available: http://dx.doi.org/10.1007/978-3-642-00503-9 [17] X. Jiang, G.-B. Bian, and Z. Tian, “Removal of artifacts from eeg signals: A review,” Sensors, vol. 19, p. 987, 02 2019. [18] A. Keil, S. Debener, G. Gratton, M. Junghöfer, E. Kappenman, S. Luck, P. Luu, G. A Miller, and C. M Yee, “Committee report: Publication guide- lines and recommendations for studies using electroencephalography and magnetoencephalography,” Psychophysiology, vol. 51, 10 2013. [19] W. Klimesch, “Eeg alpha and theta oscillations reflect cognitive and mem- ory performance: a review and analysis,” Brain research reviews, vol. 29, no. 2-3, pp. 169–195, 1999. 6 [20] N. Kosmyna and A. Lécuyer, “A conceptual space for eeg-based brain- computer interfaces,” PLOS ONE, vol. 14, p. e0210145, 01 2019. [21] C. Mulert, L. Jäger, R. Schmitt, P. Bussfeld, O. Pogarell, H.-J. Möller, G. Juckel, and U. Hegerl, “Integration of fmri and simultaneous eeg: to- wards a comprehensive understanding of localization and time-course of brain activity in target detection,” Neuroimage, vol. 22, no. 1, pp. 83–94, 2004. [22] S. C. Müller and T. Fritz, “Stuck and frustrated or in flow and happy: sensing developers’ emotions and progress,” in 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering, vol. 1. IEEE, 2015, pp. 688–699. [23] A. Puce and M. Hämäläinen, “A review of issues related to data acquisition and analysis in eeg/meg studies,” Brain sciences, vol. 7, no. 6, p. 58, 2017. [24] A. Sillitti, G. Succi, and J. Vlasenko, “Understanding the Impact of Pair Programming on Developers Attention: A Case Study on a Large Industrial Experimentation,” in Proceedings of the 34th International Conference on Software Engineering, ser. ICSE ’12. Piscataway, NJ, USA: IEEE Press, June 2012, pp. 1094–1101. [Online]. Available: http://dl.acm.org/citation.cfm?id=2337223.2337366 [25] G. Succi, W. Pedrycz, M. Marchesi, and L. Williams, “Preliminary analysis of the effects of pair programming on job satisfaction,” in Proceedings of the 3rd International Conference on Extreme Programming (XP), May 2002, pp. 212–215. [26] K. Wendel, O. Väisänen, J. Malmivuo, N. G. Gencer, B. Vanrumste, P. Durka, R. Magjarevic, S. Supek, M. L. Pascu, H. Fontenelle, et al., “Eeg/meg source imaging: methods, challenges, and open issues,” Compu- tational intelligence and neuroscience, vol. 2009, p. 13, 2009. 7