Multilingual investigation of theory-based intervention for program comprehension
Abstract
Grado en Ingeniería Informática de Servicios y Aplicaciones
Full text
MULTILINGUAL INVESTIGATION OF THEORY-BASED INTERVENTION FOR PROGRAM COMPREHENSION Bachelor Thesis Celia García Ledesma Supervised by Birte Heinemann Paderborn University
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 1 DECLARATION OF AUTHORSHIP I hereby declare that I have authored this thesis independently, that I have not used other than the declared sources/resources, and that I have explicitly marked all material which has been quoted either literally or by content from the used sources. According to my knowledge, the content or parts of this thesis have not been presented to any other examination authority and have not been published. I am aware that the respective work can be considered as “fail” in the event of a false declaration. In case of justified suspicion, the thesis in digital form can be examined with the help of “Turnitin”. For the comparison of my work with existing sources [X] I agree to storage in the institutional repository to enable comparison with future theses submitted / [ ] I do not agree to storage in the repository. Further rights of reproduction and usage, however, are not granted here. In any case, the examination and evaluation of my work has to be carried out individually and independently from the results of the plagiarism detection service. _______________________________________________________________________ Signature, city, date ACKNOWLEDGEMENTS I would like to thank everyone who helped me during these months. To the professionals in the Computing Education Department. To all participants that took part in the experiment. Thank you Birte for helping me and showing me that working can be also fun. Thanks to my friends Daniel and Miriam for helping me editing the intervention, to my mother Raquel for letting me enjoy this opportunity and to my family, who has sent love everyday along these months. Finally, thank you Pablo for supporting me always even though you do not understand anything about Computer Science.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 2 Content Figures ........................................................................................................................................... 3 Tables ............................................................................................................................................ 3 Introduction .................................................................................................................................. 4 Problem Analysis ....................................................................................................................... 4 Theoretical Background ................................................................................................................ 5 The Block Model ........................................................................................................................ 5 Bloom’s Taxonomy .................................................................................................................... 6 Related Work ................................................................................................................................. 7 Explanation of the Experiment ...................................................................................................... 8 Method ...................................................................................................................................... 8 Participants ................................................................................................................................ 8 Design ........................................................................................................................................ 8 Apparatus and Materials ......................................................................................................... 17 Example ................................................................................................................................... 19 Results of the Experiment ........................................................................................................... 20 Conclusions ................................................................................................................................. 26 Discussion and Follow up Study Ideas ......................................................................................... 27 References ................................................................................................................................... 30
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 3 Figures Figure 1: The Block Model. ................................................................................................................... 6 Figure 2: Welcome Message. ................................................................................................................ 8 Figure 3: Calibration. ........................................................................................................................... 10 Figure 4: Introduction to Read the Source Code. ............................................................................... 12 Figure 5: Block Model and Bloom's Taxonomy in the Multiple-Choice Questions. ............................ 13 Figure 6: End of the Experiment. ........................................................................................................ 17 Figure 7: Master Workstation. ............................................................................................................ 17 Figure 8: 20 Equipped Workstations with SMI REDn Scientific Eye Trackers. .................................... 18 Figure 9: Workstation. ........................................................................................................................ 18 Figure 10: Logitech Camera with Integrated Microphone. ................................................................ 19 Figure 11: SMI REDn Scientific Eye Tracker......................................................................................... 19 Tables Table 1: Questionnaire. ......................................................................................................................... 9 Table 2: German Intervention. ............................................................................................................ 10 Table 3: English Intervention. ............................................................................................................. 11 Table 4: Spanish Intervention............................................................................................................. 11 Table 5: List Program and Comprehension Questions. ....................................................................... 15 Table 6: Rectangle Program and Comprehension Questions. ............................................................ 16 Table 7: Vehicle Program. ................................................................................................................... 20 Table 8: Correct Answers. ................................................................................................................... 21 Table 9: Length. ................................................................................................................................... 21 Table 10: Number of Fixations. ........................................................................................................... 22 Table 11: Number of Saccades............................................................................................................ 22 Table 12: Programming Expertise. ...................................................................................................... 22 Table 13: Java Expertise. ..................................................................................................................... 23 Table 14: Gender................................................................................................................................. 23 Table 15: List Heat Maps. .................................................................................................................... 24 Table 16: Rectangle Heat Maps. ......................................................................................................... 25 Table 17: Conclusions. ........................................................................................................................ 27
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 4 Introduction Eye movement modeling examples (EMME) are demonstrations of a computer-based task by a human model (e.g., a teacher), with the model’s eye movements superimposed on the task to guide learners’ attention (Tim van Marlen, 2016) along with the model’s verbal explanations (Jarodzka, Van Gog, Dorr, Scheiter, & Gerjets, 2013). This thesis is the continuation of an experiment called “Eye-movement Modeling Examples in Source Code Comprehension: A Classroom Study”. This first experiment studies how effective is showing novice programmers how experts read code with a video with the expert’s gaze guided by a verbal explanation. Therefore, this thesis studies, using a similar experiment, whether only verbal explanation and visual stimuli without the expert’s gaze could be also helpful for the programming novices. The goal is to find teaching methods and ideas how to help novice programmers, so that they can overcome the obstacle of program code comprehension faster. If it is understood how novices read source code, and what hardships they face during initial learning, better tools and working environments can be designed (Beelders & du Plessis, 2016). In order to achieve this, it might be helpful to use Eye-movement Modeling Examples (EMME) at some point of the beginning of their studies. Problem Analysis When novice programmers read source code for the first time, they usually do not know how to read it since reading program text differs from reading natural text (Busjahn, et al., 2015) (Busjahn, Bednarik, & Schulte, What influences dwell time during source code reading?: analysis of element type and frequency as factors, 2014) and it is also difficult for them to comprehend how the code works. Due to this, is interesting to find how EMME can support reading and comprehending source code. The experiment that is going to take place is based on the concept of Block - and Relation - reading (BR-reading). BR-Reading is that (Reading) Blocks are basic entities capturing a coherent idea to be understood while reading. Understanding the hole text thus requires understanding the parts (the blocks) and how they are connected (the relation between blocks) (Bednarik, Budde, Heinemann, Schulte, & Vrzakova, 2018). The Block Model is explained carefully in the section “Theoretical Background” below. In the previous experiment, it is hypothesized that an EMME-based intervention should be effective by guiding attention to important parts of the code and provide ways to integrate elements of the code to a meaningful whole and thereby aid comprehension (Bednarik, Budde, Heinemann, Schulte, & Vrzakova, 2018). However, for motor tasks, the central steps are directly observable, but for cognitive tasks this is not the case. Instead, the model has to be asked to unravel these covert processes by verbalizing them while performing the task (Collins, Brown, & Newman, 1989). In this thesis, it is hypothesized that the verbal explanation is an important part of the process. As the learner is told what to look at, why and how to look at some points of the
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 5 source code, he/she should understand the process and should be able to achieve better performance in comprehension (quicker or better understanding). Nevertheless, EMME with verbal explanations might not be always a helpful resource, since sometimes the given information, both the gaze and the verbal explanation, instead of complementing each other, result not being effective for learning. When verbal explanations are sufficient to guide visual attention, displaying the eye movements would be redundant (Sweller, 2005). In addition, research has shown that redundant information tends to distract students’ attention, which can lead to detrimental effects on learning outcomes (Kalyuga, Chandler, & Sweller, 1999). Van Gog presented in other study that the verbal explanation and the eye movements of the model were probably redundant. This was the case because the students could easily infer from the verbalizations alone where to look (Jarodzka, Van Gog, Dorr, Scheiter, & Gerjets, 2013). In consequence of the ideas presented, the goal of this experiment is to know whether verbal explanation in reading source code foster learning source code reading by novice programmers. Theoretical Background In this section, two main references that we used to design the multiple-choice comprehension questions are shortly explained. The multiple-choice questions are defined in the section “Design”. The Block Model The Block Model (Schulte, 2008) is an educational model for program understanding that suggests three dimensions and four distinct abstraction levels: firstly atoms/words are read and build the Atom Level, where it is understood the language elements, the operation of the statements and its function. Then, they are joined in semantic units, known as blocks, which are a sequence of statements that function as a sub-goal of the program, this is called the Block Level. After that, relations between blocks are considered and it is understood how they are related to the goals (Relation Level). As the last step the Macrostructure Level, where the overall structure of the program is understood, the algorithm and the final purpose of the program (Bednarik, Budde, Heinemann, Schulte, & Vrzakova, 2018). The intervention video that is used in the experiment is based in this model as well as in the previous study because of the purpose of comparing both studies after, therefore it was desired to maintain the intervention as similar as possible to the previous one.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 6 Figure 1: The Block Model. Bloom’s Taxonomy Bloom’s taxonomy establishes a hierarchy of six levels with an increasing level of student learning. Each level presupposes the training of the student at the preceding levels (Hernán- Losada, Velázquez-Iturbide, & Lázaro, 2019). - Level 1 or level of knowledge. The student can recognize or remember the information without needing any kind of understanding or reasoning about its content. - Level 2 or level of comprehension. The student can understand and explain the meaning of the information received. - Level 3 or application level. The student may select and use data and methods to solve a given task or problem. - Level 4 or level of analysis. The student can distinguish, classify and relate hypotheses and evidences of the given information, as well as to decompose a problem in their parts. - Level 5 or synthesis level. The student can generalize ideas and apply them to solve a new problem. - Level 6 or assessment level. The student can compare, criticize and evaluate methods or solutions to solve a problem or to choose the best one. To test the level of comprehension that the participants reach, Bloom taxonomy as well as the Block Model are used to design the experiment’s multiple-choice questions, since it allows a better overview about how deep the participants comprehend the given source code. As in “Design” section below, there are three different multiple-choice questions that reach three different levels in the Block Model as in the Bloom’s taxonomy from the lowest to the highest to test how well the student understood the program. There is a free text answer as
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 7 well, where the participants may explain themselves what they understood, which is in level 2 or level of comprehension. Related Work There are two main documents that guide me and are related to the topic treated in this thesis. The first one is the previous study called “Eye-movement Modeling Examples in Source Code Comprehension: A Classroom Study”, that is like this one and is thought to be used to compare the results of this study. The authors created a classroom experiment in which their comprehension strategies were cued by an educational intervention based on theories of program comprehension and companied by a visualization of eye-movement strategies of an advanced programmer (Bednarik, Budde, Heinemann, Schulte, & Vrzakova, 2018). The other related work is the Eye Movements in Programming Dataset, which establishes that programming education and practice mainly focus on writing code, while the reading skills are often taken for granted. Reading occurs in debugging, maintenance and the learning of programming languages. It provides the essential basis for comprehension. By analysing behavioural data such as gaze during code reading processes, we explore this essential part of programming (Bednarik, et al., 2018). Related to this dataset, in this thesis it is used some of the stimulus material (rectangle and vehicle source codes) and at first, we wanted to use the same questions, but we found them to be not enough accurate to show if the participant understood properly or not, so we decided to change them, as explained in “Design” section. As the previous experiment is also related to the EMIP dataset, the limitations of these works are similar. First, there is only one question to find if the participant has understood the program shown. I find it difficult to know if the participant really understood the code with just one question, therefore in this study there will be three comprehension questions plus a free text answer based in the Block Model and in Bloom taxonomy with different levels to know how deeply the participant understood the code. Later in “Design” section these questions and their design are explained. The source codes used to test the participants’ comprehension in these experiments were obvious since they have the class, methods and variables names related to their function. Therefore, it can be thought that the person did not understand but read carefully the content and he/she was able to answer the question without having understood the code. In this experiment, it is changed to names that do not give any cue to the participants (mystery, calculation, etc), so they must do the effort to understand the code and read it carefully. Even though it is known that any experienced programmer would name a class “Mystery” and a method “calculation”, we thought that it could be more helpful to know if they really comprehend the program and its purpose.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 8 Explanation of the Experiment Method This study is drawing on a previous experimental design called “Distributed Collection of Eye Movement Data in Programming” (Bednarik, et al., 2018), where a large data set was collected as above mentioned. The intervention instructions and the source code of both short programs are changed in the design. Participants The participants which take part in the experiment are recruited from Paderborn University, for the English version and from different universities from Spain, such as Universidad Carlos III de Madrid, Universidad Pública de Navarra, Universidad de Valencia, Universidad de Murcia, among other, for the Spanish version. The demographic data and expertise levels were collected according to the EMIP experiment design. A total of 27 participants took part in the experiment, 14 male and 13 female participants, with a mean age of 23’9 years old. Design The design of the experiment was based in the EMIP dataset (Bednarik, et al., 2018). At first, the whole intervention is explained by the person in charge. Each of the participants will be seated in each workstation prepared for this purpose. Then, the intervention will take place. First, the students will see a welcome message, as shown in Figure 2, and after that, the intervention will begin. Second, they must answer some demographic and expertise questions, which are defined in Table 1. Figure 2: Welcome Message.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 15 Table 5: List Program and Comprehension Questions. List public class Mystery1{ public static void mystery1(int[] list){ int var1 = 0; int count = 0; int index = 0; int sent = 9; int element = list[index]; while(element != sent){ if(element > 0){ var1 = var1 + element; count += 1; } index += 1; element = list[index]; } if(count > 0){ System.out.println("var1: " + var1 + " count: " + count + "var/count: " + var1/count); } else { System.out.println(-1); } } public static void main (String args[]){ int[] list = {2, -1, 3, 0, 1, 0, -1, 2, 9, 1, 2, 3}; mystery1(list); } } Comprehension Questions for List 1. This program: a. Prints ("var1: " + var1 + " count: " + count + "var/count: " + var1/count) if count = 0 b. Prints (-1) if count = 0 c. Prints ("var1: " + var1 + " count: " + count + "var/count: " + var1/count) if index = 0 d. Prints (-1) if index = 0 e. I am not sure 2. Imagine there is a new list = {3, -2, 4, 0, -1, 0, 2, -2, 0, 9, 0, 3}. What would System.out.println("var1: " + var1 + " count: " + count + "var/count: " + var1/count); print? a. var1: 9, count: 3, var/count: 3 b. var1: 12, count: 3, var/count: 4 c. var1: 18, count: 3, var/count: 6 d. I am not sure 3. This program: a. Sums the numbers in the list and then divides the sum by the total of numbers found until reached a “9”. b. Sums the natural numbers until reached a number greater than or equal to “9” and then divides the sum by the quantity of the numbers found. c. Sums the natural numbers until reached a “9” and then divides the sum by the quantity of the numbers found. d. Sums the numbers in the list and then divides the sum by the total of numbers until reached a number greater than or equal to “9”. e. I am not sure. 4. Free text answer.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 16 Table 6: Rectangle Program and Comprehension Questions. Rectangle public class Mystery2 { private int x1, y1, x2, y2; public mystery2(int x1, int y1, int x2, int y2 ) { this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; } public int calculation1 (){ return this.x2 - this.x1; } public int calculation2 (){ return this.y2 - this.y1; } public double calculation3 (){ return this.calculation1() * this.calculation2(); } public static void main ( String[] args ) { Mystery2 m1 = new Mystery2 ( 0, 0, 10, 10 ); System.out.println ( m1.calculation3 () ); Mystery2 m2 = new Mystery2 ( 5, 5, 10, 10 ); System.out.println ( m2.calculation3 () ); } } Comprehension Questions for Rectangle 1. This program: a. Calculates x1 – x2 in calculation1 b. Calculates x2 – y2 in calculation1 c. Calculates x1 – y1 in calculation1 d. Calculates x2 – x1 in calculation1 e. I am not sure 2. Imagine a Mystery m3 with variables x1 = 2, y1 = 2, x2 = 4, y2 = 4, what would calculation3 return? a. 4.0 b. 2.0 c. 8.0 d. I am not sure 3. This program: a. Calculates the area of a Square. b. Calculates the area of a Rectangle. c. Calculates the area of a Trapezium/Trapezoid. d. I am not sure. 4. Free text answer. At the end, the participants will be asked to wait until the rest of the participants are finished as shown in Figure 6 and then they will leave, and the intervention will be finished.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 17 Figure 6: End of the Experiment. Apparatus and Materials The experiment was taken in the PIN-Lab of Paderborn University, located in the Furstenalle building. The explanation about the setup of this laboratory is based in this Master Thesis (Schlichtig, 2018). The PIN-Lab is a class- and a seminar room of the Computing Education Research chair at Paderborn University. It provides 20 equal workstations equipped with SMI REDn Scientific eye trackers attached to 27-inch LCD screens and Logitech webcams with integrated microphones, as shown in Figure 10. The SMI REDn Scientific eye tracker is attached under the display as shown in Figure 11. Group experiments can be conducted using another workstation administrated by the educator. This setup enables recording of up to 20 subjects at once and tracking eye movements when participants are working at the workstations, for instance, pupils during class. Figure 7: Master Workstation.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 18 Figure 8: 20 Equipped Workstations with SMI REDn Scientific Eye Trackers. Figure 9: Workstation.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 19 Figure 10: Logitech Camera with Integrated Microphone. Figure 11: SMI REDn Scientific Eye Tracker. Example In this subsection the example used in the intervention video is shown. This example was taken from the EMIP experiment (Bednarik, et al., 2018). This program was originally used in the previous experiment as the other program apart from the Rectangle program, as we decided to use List program instead, we use Vehicle for the explanation part. We decided not to use Vehicle program since the variables in the code give a lot of information about what the program does and instead of renaming them all, we decided to use another program code. In Table 7 below the code is shown.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 20 Table 7: Vehicle Program. Vehicle public class Vehicle { String producer, type; int topSpeed, currentSpeed; public Vehicle (String p, String t, int tp){ this.producer = p; this. type = t; this.topSpeed = tp; this.currentSpeed = 0; } public int accelerate (int kmh) { if ((this.currentSpeed + kmh) > this.topSpeed){ this.currentSpeed = this.topSpeed; } else { this.currentSpeed = this.currentSpeed + kmh; } return this.currentSpeed; } public static void main ( String args [] ) { Vehicle v = new Vehicle ("Audi", "A6", 200); v.accelerate(10); } } Results of the Experiment In this section the results of the experiment are explained. First thoughts were to compare the outcomes from this experiment with the ones in the previous study, but due to time constrictions the results are going to be presented with its own conclusions. As in the “Design” section above described, there are two different versions of the experiment. The List-Rectangle version counted with 14 participants and the Rectangle-List counted with 13 participants. Even though is almost the same amount, the percentages of correct answers of the participants in each version are calculated to make sure that the conclusions are based in the correct results. In Table 8 below the number of correct answers in general and both versions of the experiment are shown. The first thing noticed is that the program with the best answers is the Rectangle program, which can lead us to think that the List program is more difficult than the Rectangle program, in which the participants haven’t had such difficulties to choose the correct answer like in the other one. It is noticed as well that the worst question answered was the third one in the List program and the best question answered was the second in the Rectangle program. If we compare the correct answers in the List program, we can notice that the participants did it lightly better in the second version, when it was placed second. Comparing the Rectangle program, it is lightly better in the second version as well. In the Rectangle program, it happens the same, in the second version the participants did it better. We can conclude that the participants did it better in the second version, since they reached more correct answers.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 21 Table 8: Correct Answers. Program Q1 Q2 Q3 TOTAL % General List 16 10 7 33 40’74 Rectangle 22 24 13 59 72’83 List- Rectangle List 8 5 2 15 35’71 Rectangle 12 12 6 30 71’43 Rectangle- List List 8 5 5 18 46’15 Rectangle 10 12 7 29 74’36 In Table 9, the mean length is shown. It is noticed that, in general, it took longer to the participants to read the List program, 1’ 32” more than to read the Rectangle program. When we compare both versions, we appreciate that the participants in the first version spent less time reading the program than in the second version. In the List program in the second version, the length is much higher if we compare with the first version, and this could be the reason why these participants reached more correct answers (18 in second version versus 15 in first version). Table 9: Length. Program General List-Rectangle Rectangle-List List 3’ 17” 2’ 22” 4’ 15” Rectangle 1’ 44” 1’ 37” 1’ 52” In Table 10, the number of fixations is shown. The fixation is the settling of the eye gaze on an object of interest for a minimum period of time (Busjahn, et al., ACM, 2014). The number of fixations is directly related to the effort that the participant put. The interpretation of visual effort variable can be simplified as follows: • Low fixation count and low time indicate less effort (Sharafi, Soh, Gueheneuc, & Antoniol, 2012) (Sharafi, Marchetto, Susi, Antoniol, & Gueheneuc, 2013). • High fixation count and more time indicate more effort (Turner, Falcone, Sharif, & Lazar, ACM, 2014) (Sharif & Maletic, 2010). If we compare in general, the List program counts with a higher number of fixations than the Rectangle program, which indicates the participants needed more effort to understand the program. When comparing the first version and the second, we can appreciate that the second version has a higher number of fixations and the List program counts with almost the double comparing to the first version and to the Rectangle program. This indicates that the participants put more effort in this part, in which the correct answers are higher than in List program in the first version.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 22 Table 10: Number of Fixations. Program General List-Rectangle Rectangle-List List 628’19 465’21 803 Rectangle 420 366’36 479’54 The saccades are a quick movement of the eyes from one location to another (Busjahn, et al., ACM, 2014). In Table 11, we appreciate that comparing between both versions, the number of saccades in the second are the around the double than in the first version. I could not find any study explaining what these values mean, but probably has something to do about the comprehension and the number of correct answers as well, since this version has more correct answers. Table 11: Number of Saccades. Program General List-Rectangle Rectangle-List List 526’85 368’71 697’15 Rectangle 362’15 298 431’23 About the programming expertise of the participants, there are four different levels, as seen in Table 12. The most noticeable fact is that the participants with a high level of expertise did not reach the most correct answers, while the participants with a medium level did. Apart from this, the most correct answers in the Rectangle program were acquired by the participants with a low programming expertise level, while in List program were the participants with a medium programming expertise. In the attached “Demographic Questions” excel file, it can be found the respective tables of each version about programming expertise. There are not shown in this document since the information that they give is not differing much from the one presented in the table below. Table 12: Programming Expertise. Expertise Part. List Rectangle Total % Q1 Q2 Q3 Q1 Q2 Q3 List Rect Total None 6 1 1 0 5 4 2 13 11’12 61’12 36’11 Low 2 0 1 1 2 2 1 7 33’3 83’34 58’34 Medium 12 10 6 4 11 11 6 48 55’56 77’78 66’67 High 7 5 2 2 4 7 4 24 42’86 71’43 57’14
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 23 About the level of java expertise, as shown in Table 13, participants with a high java expertise level as well as participants with a medium level, had the most correct answers. In this case, when we investigate each program, in the Rectangle program the most correct answers were reached by the participants with a high level, while in List program the most correct answers were reached by the participants with a low level. It is possible that in List program, the participants with a high java expertise level, got confused by the multiple-choice questions and could not find the correct answers. Table 13: Java Expertise. Expertise Part. List Rectangle Total % Q1 Q2 Q3 Q1 Q2 Q3 List Rect Total None 9 3 3 2 8 7 4 27 29’63 70’37 50 Low 3 2 1 1 3 3 0 10 44’45 66’67 55’56 Medium 9 7 4 3 7 8 4 33 25’93 70’37 61’12 High 6 4 2 1 4 6 5 22 38’89 83’34 61’12 As the experiment counts with a similar number of females and males, I found interesting to know whether one gender did better than the other one. Fortunately, the differences between one gender and another are not significant, reaching most correct answers the male participants than the females, but only 3,4% of correct answers more. Table 14: Gender. Expertise Part. List Rectangle Total % Q1 Q2 Q3 Q1 Q2 Q3 List Rect Total Female 13 9 3 2 10 12 5 41 35’9 69’23 52’56 Male 14 7 3 5 12 12 8 47 35,7 76,19 55,96 In Table 15 and Table 16, the heat maps of both program codes are shown. The first thing that we notice is the red areas, which are bigger in the List program than in the Rectangle program, which means that the List program needed more attention than the Rectangle program. If we observe the Rectangle – List Spanish heat map, we notice that this part counts with the biggest red area, which explains the high values of the number of fixations above mentioned.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 24 Table 15: List Heat Maps. List Heat Maps List – Rectangle English Rectangle – List English List – Rectangle Spanish Rectangle – List Spanish In Table 16, we observe that the less highlighted parts are in the English version. This means that the participants needed less effort to understand the program, which is possible since all participants in the English version were Computer Science students who had completed their bachelor studies. On the other hand, in the Spanish version, the red areas are bigger since the participants of this version were not students in the field of Computer Science. The participants from the Rectangle – List version were Engineering students, but the ones from the List – Rectangle version were Business students, which explains that they put more effort to understand this program. If we observe the Table 15 above, we can notice that these participants, the ones that do not know anything about program code, present the smallest heat
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 31 Jarodzka, H., Van Gog, T., Dorr, M., Scheiter, K., & Gerjets, P. (2013). Learning to see: Guiding students' attention via a Model's eye movements fosters learning. Learning and Instruction, 25, 62-70. Retrieved from http://doi.org/10.1016/j.learninstruc.2012.11.004 Kalyuga, S., Chandler, P., & Sweller, J. (1999). Managing split-attention and redundancy in multimedia instruction. Applied Cognitive Psycholohy, 13, 351-371. Lister, R., Fidge, C., & Teague, D. (2009). Further evidence of a relationship between explaining, tracing and writing skills in introductory programming. SIGCSE, 41(3), 161-165. Pennington, N. (1987). Stimulus structures and mental representations in expert comprehension of computer programs. Cognitive Psychology, 295-341. Schlichtig, M. (2018). Infrastructure Conception for Evaluation of Interactive Tutorials in the Context of a Jupyter Notebook Data Science Course. M.Sc. Thesis, Universität Paderborn, Paderborn, Germany. Schulte, C. (2008). Block Model: An Educational Model of Program Comprehension As a Tool for a Scholary Approach to Teaching. In Proceedings of the Fourth International Workshop on Computing Education Research (ICER '08)., 149-160. Retrieved from https://doi.org/10.1145/1404520.1404535 Sharafi, Z., Marchetto, A., Susi, A., Antoniol, G., & Gueheneuc, Y. (2013, May). An empirical study on the efficiency of graphical vs. textual representations in requirements comprehension. In Proceedings of the 2013 IEEE 21st International Conference on Program Comprehension (ICPC), 33-42. Sharafi, Z., Soh, Z., Gueheneuc, Y., & Antoniol, G. (2012, June). Woman and men- Different but equal: On the impact of identifier style on source code reading. In Proceedings of the 2012 IEEE 20th International Conference on Program Comprehension (ICPC), 27-36. Sharif, B., & Maletic, J. (2010, June). An eye-tracking study on camel-case and under score identifier styles. In Proceedings of the 2010 IEEE 18th International Conference on Program Comprehension (ICPC)., 196-205. Shneiderman, B., & Mayer, R. (1979). Syntactic/semantic interactions in programmer behaviour: A model and experimental results. International Journal of Computer and Information Sciences., 8(3), 219-238. Soloway, E., & Ehrlich, K. (1984, September). Empirical studies of programming knowledge. IEEE Transactions on Software Engineering, 10(5), 595-609. Sweller, J. (2005). The redundancy principle in multimedia learning. In R. E. Mayer (Ed.), The Cambridge handbook of multimedia learning., 159-167.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 32 Tim van Marlen, M. v. (2016, December). Showing a model's eye movements in examples does not improve learning of problem-solving tasks. Computers in Human Behaviour, 448- 459. Turner, R., Falcone, M., Sharif, B., & Lazar, A. (ACM, 2014). An eyetracking study assesing the comprehension of C++ and Python source code. In Proceedings of the Symposium on Eye Tracking Research and Applications (ETRA '14), 231-234.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 33 Appendix I: Free Text Answers English (List-Rectangle) version Name Mystery1 (List) Mystery2 (Rectangle) P01 Main program calls function by sending a list of integers. In the function the variables are initialized to 0 It calculates the 2 variables var1 and count. It sums all the positive integers in the list. Sum is added to var1 and number of integers added are stored in count. Until a number which is greater than 9 is found, loop gets broken and if the count value is more than 0 it prints var1, count and var1/count or it prints -1. The main function initializes Multiplication class with the integers x1, y1, x2, y2. Then it calls the function calculation3 which inturn calls calculation1 and calculation2 such that x2-x1 and y2-y1 is calculated respectively. Finally, calculation3 multiplies the results and print the results as double. P01(1) (excluded) The program code sums the numbers in the list and divides it until a number greater than 9 is obtained. The program calculates the area of the square by multiplying its sides which are obtained by the calculation functions. Once the side is known by the calculation function area is calculated by the other functions there by generating the area at the end. P02 It calculates the sum, counts the elements in the array and also calculates the average. It gets the border points of a rectangle and can calculate the width (calc1), height (calc2) and size (calc3) P03 only reached Q1 Add all numbers greater than zero from an array until a 9 is reached. When a 9 is reached, the while loop breaks. Then the program prints the sum of the numbers greater than zero and then the count of all the numbers greater than zero (until the 9 is reached, of course!) and the result of sum/count. Given 2 points represented in 2D, this program calculates (difference between the x co-ordinates) * (difference between the y coordinates) P01(2) The program reads the numbers entered in an array and keeps incrementing the value of val1 by adding elements in the array list and this will happen until the value of val1 becomes equal to or greater than 9. And in every iteration the count value gets incremented inside the while loop. And once the value of In this program we actually calculate the area of a rectangle where its x1, x2 and y1, y2 coordinates are entered. The difference between x coordinates (x2-x1) will give the length and the difference between the y coordinates (y2-y1) will give us the height of the rectangle. And the product of length
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 34 val1 becomes greater than or equal to 9. The control comes out of the while loop and if the count value is greater than zero, it will print the values of 3 variables they are val1, count and val1/count. The program returns -1 if count value is 0. and height will return the area of the rectangle. P01(3) The main method creates a list and calls the method "calculate" with the list as an argument. The Method calculate sums up all positive integers (>0) and keeps track of how many it has counted. Then it prints out the sum, the amount of positive integers and the average of those. Main Method creates objects that hold 4 integers (x1, x2, y1, y2) Then it prints out the result of the calculation (x2- x1)*(y2-y1). (x2-x1) is the result of calc(1) and (y2-y1) is the result of calc2. Calc3 multiplies these two results. It could happen that you get a negative "surface area". P04 Reached All This program takes a list of integers and find the sum of the natural numbers (numbers greater than 0) until the number 9 is encountered in the list (9 is excluded from the sum). It also finds the count of the natural numbers until the number 9 is encountered. This program takes the positions of two lines (possibly 2 lines that forms the side of a rectangle) and find the area. For the positions x1, x2, y1, y2, it finds (x2-x1)*(y2-y1) P02(1) It takes a list as an input and add the numbers if greater than zero till you find 9 in last you print the count, total, total/count. Takes two coordinates and finds (x2- x1)*(y2-y1) and prints it P02(2) The program prints the variable, count and the sum/count value of the list unless a 9 is found. The program contains a calculation3 method. This method takes the returned value of calculation1 and calculation2 method as the parameters and then computes their product. Calculation1 and calculation2 methods take two variables as parameters and then returns their difference. The points (x1, y1) and (x2, y2) are the coordinates of two points. Calculation1 and calculation2 calculates (x2-x2) and (y2-y1) respectively. Calculation3 computes (x2-x1)*(y2-y1) which is the magnitude of the vector.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 35 Rectangle-List version Name Mystery1 (List) Mystery2 (Rectangle) P01 The program contains a list and variables like var1, count, index initialized. The main logic says that if the element > 0, then var1+element else print -1 (also the element should not be equal to 9 which is also already initialized). The sum of the numbers greater than 0 and less than 9 are taken and divided by the count. There are 4 variables x1, y1, x2, y2, and they are initialized using this variable. The program contains 3 functions calculation1(), calculation2() and calculation3(). Calculation1() returns the difference between x2 and x1. calculation2() returns the difference between y2 and y1. calculation3() is returns the product of calculation1() and calculation2() with respect to the parameters passed in the main function to the newMystery function. P01(1) A list is sent to function calculation. Variables are assigned and while loop with a condition is given. Till the loop satisfy the condition, given operation are performed. And output is printed. Initially all variables are initialized. Three functions named calculation1, calculation2 and calculation3 are defined. In the main function the actual values are passed to the function and answer is calculated and returned. Answer for the 1st is 100 and for 2nd is 25. P02 n/a in Q1 reached the rest This program sums up all nonnegative numbers from a list until reading a specified value. It also counts the number of those values that were added to the sum. Then it gives the sum, the counter and sum divided by counter as an output. The first function calculates the difference of two points in x coordinates, the second one the one in y coordinates. Those two functions are then used in the third one to calculate the area of a square with lengths from both functions. P02(1) In this static program a list with int elements is created in the main method and afterwards a calculation with the elements in this list is done (all static). The calculation sum up all elements in the list, starting at the beginning with index 0, until an element with the value 9 is reached in the list. Then the while loop ends and if the sum is greater than 0, an output via the command line is produced and it shows the results. It is a class with three int variables called x1, x2, y1, y2. They are all set in the constructor when creating an object of this kind. The class also has three methods. The first one calculates and returns the following (x2-x1). The second method calculates (y2-y1). And the third one calculates the result of method 1 * the result of method 2, so (x2-x1)*(y2-y1). There is also the main method to start the program. Here, two objects of the class are created. The values of the first object are set (by the constructor) to x1=0, x2=10, y1=0, y2=10. After that, method 3 is called, so (10-0)*(10-0)=100 is calculated. Afterwards, the second object is created. The values of the second object are set (by the constructor) to x1=5, x2=10, y1=5, y2=10. After that,
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 36 method 3 is called, so (10-5)*(10-5)=25 is calculated. P01(2) We pass a list of integers to the program, it sums up the list elements until encounters a number >9. The total value is divided by the number of elements counted. The result after the division is printed by the main function. In the program, the object mystery takes 4 arguments. It sends 2 x coordinates to one function calculation1(). It sends 2 Y coordinates to calculation2(). The result of the functions calculation1() and calculation2() are then multiplied. The result is then returned to the main function, where it is sent to the output screen to be printed. P01(3) Reached All The program takes a list as input and calculates the sum of all the numbers that are greater that 0 before encountering 9 in the list. It calculates the count of such numbers and the sum of the numbers greater that 0 is divided by the count of such numbers. The program code takes the value of x1, y1, x2 and y2. Calculate1() calculates the value x2-x1. Calculate2() calculates y2-y1. Calculate3 function returns (calculate1()*calculate2()). For example: if x1, x2, y1 and y2 are considered as coordinated of a rectangle, the calculate3() will return the area as calculate1()*calculate(). P02(2) This program contains a list in which the no which is greater than zero is only taken into account and while the counter goes to 9 its checking the list and after that it display the result. The program contains the three methods in which the last methods have input from other two methods. This program deals with two objects of class and implement the result.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 37 Spanish List-Rectangle version Name Mystery1 (List) Mystery2 (Rectangle) P02(2) The operation of the program goes in blocks, which have different lengths depending on the difficulty they have and the need to explain it. In addition these blocks can be divided into subblocks and do not have to be in order. The functioning of the program was divided into several parts. There were four variables (X1; X2, Y1; Y2) and it asked to do the subtraction X2-x1 and the subtraction Y2-Y1; and then multiply the result of both previous operations. P03 I haven't finished understanding how the program works, I imagine it describes the work done by a printer. If you had to answer this question after reading the code (without answering other questions), you probably wouldn't have been able to write anything. However, after the last question, it is true that it could be the calculation of the area of some geometric figure. P04 I'm not quite sure how the program works. The program may add several numbers, use the variance, the total number of numbers, and finally divide the result. This program calculates the difference between X1 and X3, subtracting the first from the second. It then calculates the difference between Y1 and Y2 in the same way. The final step is double calculation, which consists of multiplying both results. If we imagine a square, multiplying the distances of the base and height we obtain the area. P03(1) The program describes a problem and defines the different possibilities of result. In this way, patterns for statistics can be described. The program gives the points where the vertices of the square are located and, following the calculations, you can find the area of the figure.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 38 Rectangle-List version Name Mystery1 (List) Mystery2 (Rectangle) P01 The program sums until it finds a 9. Calculates the difference between the positions of the vertices, obtaining the sides, and then multiplies them, obtaining the area. P01(1) Reach Q1 n/a Q2 not Q3 The program receives a list of numbers and passes them on to a function. This function initializes some parameters, to then go through the list of numbers until it finds a number nine, each number of the list traveled different from nine adds one to the counter variable and another variable increases its value with the sum of the values of the list traveled, at the end the program prints in screen the sum of the numbers, the quantity of numbers of the list traveled and the ratio between the sum of the numbers and the numbers traveled. The program receives data passed by code and makes the calculations specified in the functions, in the example it receives two different values and displays both calculations. The calculations are the multiplication of the subtractions. P02 I didn't understand the program. I think that at the beginning I posed five variables, four equal to a number and the last "element" in function of another "index" and later I established hypotheses between the variables but I did not understand the meaning of what I was doing. As a person who has never used this language, I have understood from the audio that first everything written in a square is focused making a general vision and then it is separated by stripes reading from top to bottom and relating each new strip you read with the ones above. I didn't understand very well the meaning of what was calculated, but in the first stripe it was as a description of the variables. In the following three I did three simple calculations to use them in the fourth strip and thus arrive at the result that we want to obtain.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 39 P03 Reached All The program starts a loop where in each iteration, each element of an entered list of numbers is analysed. When the number is natural other than "9", its value is added to the variable "var1". When the number is less than "0", it does not carry out any operation. When we find a "9", it leaves the loop and the subsequent numbers are no longer analysed. Finally, it will print the value of the sum, the number of elements found until it leaves the loop, and the division between both values. The program makes the difference between x2 and x1 in calculation1. It then calculates the difference between y2 and y1 in calculation2. Finally, it calculates and prints the product of both differences. In the case of the program shown, it first prints 100 and then 25.
Multilingual Investigation of Theory-Based Intervention for Program Comprehension | Celia García Ledesma 40 List-Rectangle version in Spanish Name Mystery1 (List) Mystery2 (Rectangle) P02(2) El funcionamiento del programa va por bloques, los cuales tienen distinta extensión dependiendo de la dificultad que tengan y la necesidad de explicarlo. Además estos bloques pueden estar divididos en subbloques y no tienen por qué estar en orden. El funcionamiento del programa se dividía en varias partes. Había cuatro variables (X1;X2, Y1;Y2) y pedía hacer la resta X2-x1 y la resta Y2-Y1; Y después multiplicar el resultado de ambas operaciones anteriores. P03 No he terminado de entender el funcionamiento del programa, imagino que describe el trabajo realizado por una impresora. Si tuviese que responder a esta pregunta una vez leído el código (sin responder a otras preguntas), probablemente no hubiese sido capaz de escribir nada. Sin embargo, tras la última pregunta, es cierto que se podría tratar del cálculo del área de alguna figura geométrica. P04 No estoy muy segura del funcionamiento del programa. Puede que el programa sume varios números, utilice la varianza, el número total de números y finalmente divida el resultado. Este programa calcula la diferencia entre X1 y X3, restando el primero al segundo. Después calcula la diferencia entre Y1 e Y2, de la misma manera. El paso final es double calculation, el cual consiste en multiplicar ambos resultados. Si nos imaginamos un cuadrado, multiplicando las distancias de la base y altura obtenemos el área. P03(1) El programa describe un problema y define las diferentes posibilidades de resultado. De esta forma, se pueden describir patrones para estadísticas. El programa da los puntos en los que se encuentran los vértices del cuadrado y, siguiendo las calculations, puedes hallar el área de la figura.