Programming with Concurrency
Total Page:16
File Type:pdf, Size:1020Kb
PROGRAMMING WITH CONCURRENCY: BARRIERS TO LEARNING AND EXPLORATIONS IN TEACHING by ZHEN LI (Under the Direction of Eileen Kraemer) ABSTRACT Programming activities are not trivial tasks. Rather, to carry out such complex problem solving tasks, programming expertise developed through long-term experience is required. In contrast, the current landscape of computing demands more reliable and efficient implementations of concurrent software programs. In this thesis work, we research topics in psychology of programming and computer science education with an emphasis on programming with concurrency to inform the fields of psychology of programming, computer science education, empirical software engineering and a broader scope of human factors related fields. We identify the barriers to learning programming with concurrency through review and empirical work. We synthesize the previous research findings with regard to programming expertise, generalize a conceptual framework of the development and application of programming expertise and indicate the importance of the knowledge repository component. We reveal the structure of concurrency-related concepts, and provide insight into the acquisition procedures for such knowledge with our description of a “misconception hierarchy” grounded from qualitative analysis of empirical data. Comprehensive arguments generated through a case study are further provided to describe non-concurrency-related barriers that are critical for students to learn and appreciate programming with concurrency. We conduct explorations on the impact of existing and innovative techniques and course designs used in teaching programming with concurrency topics. We review the pedagogical impact of pair programming and indicate its protective effect on retaining female and less-experienced students through our quasi-experiments. We also reveal the engineering and cognitive effect of pair programming in that pair programming helps students to write code using better style and promotes more comprehensive and critical thinking in earlier phases of software development. We survey curriculum guides on topics regarding programming with concurrency and identify two concurrency models (shared memory versus message passing), three implementation approaches (Threads, Actors, and Coroutines), and several classic scenarios (Bounded Buffer, Dining Philosopher, Sleeping Barber, etc.) to teach in an upper-level undergraduate computer science course. We provide feedback on benefits and drawbacks of this series of pedagogical innovations including flipped classroom design, using a language-independent pseudocode system, and introducing repeated practice with different implementation approaches on a single problem. INDEX WORDS: Psychology of Programming, Computer Science Education, Cognition, Expertise, Concurrent System, Empirical Software Engineering PROGRAMMING WITH CONCURRENCY: BARRIERS TO LEARNING AND EXPLORATIONS IN TEACHING by ZHEN LI B.E. Fudan University, Shanghai, China, 2008 B.S. University College Dublin, Dublin, Ireland, 2008 A Dissertation Submitted to the Graduate Faculty of The University of Georgia in Partial Fulfillment of the Requirements for the Degree DOCTOR OF PHILOSOPHY ATHENS, GEORGIA 2013 © 2013 Zhen Li All Rights Reserved PROGRAMMING WITH CONCURRENCY: BARRIERS TO LEARNING AND EXPLORATIONS IN TEACHING by ZHEN LI Major Professor: Eileen Kraemer Committee: John Miller Tianming Liu Electronic Version Approaved: Maureen Grasso Dean of the Graduate School The University of Georgia August 2013 iv DEDICATION This work is dedicated to all programmers for their creativity in problem solving, all students for their hard work in learning programming and all teachers for their patient guidance along the demanding journey of developing expertise. TABLE OF CONTENTS LIST OF TABLES ............................................................................................................................... VII LIST OF FIGURES ................................................................................................................................ X ACKNOWLEDGEMENT .................................................................................................................... XIII CHAPTER 1. INTRODUCTION ...............................................................................................................1 1.1 THESIS STATEMENTS .......................................................................................................................... 2 1.2 RESEARCH CONTRIBUTIONS ................................................................................................................. 3 1.3 OUTLINE OF THESIS ............................................................................................................................ 5 CHAPTER 2. OVERVIEW OF EMPIRICAL WORK .....................................................................................7 2.1 EMPIRICAL WORK 1: SPRING 2010 ...................................................................................................... 7 2.2 EMPIRICAL WORK 2: SPRING 2012 .................................................................................................... 10 2.3 EMPIRICAL WORK 3: SPRING 2013 .................................................................................................... 13 CHAPTER 3. BARRIERS TO LEARNING ................................................................................................ 20 3.1 PROGRAMMING EXPERTISE ............................................................................................................... 20 3.2 CONCURRENCY-RELATED BARRIERS .................................................................................................... 48 3.3 OTHER BARRIERS ............................................................................................................................. 77 3.4 SUMMARY AND FUTURE WORK ......................................................................................................... 85 CHAPTER 4. EXPLORATIONS IN TEACHING ......................................................................................... 89 4.1 PAIR PROGRAMMING AS A PEDAGOGICAL TECHNIQUE ........................................................................... 90 4.2 IMPACTS OF PAIR PROGRAMMING ...................................................................................................... 93 4.3 CURRICULUM GUIDES AND ELEMENTS OF TEACHING CONCURRENCY ...................................................... 113 4.4 TEACHING PROGRAMMING WITH CONCURRENCY ................................................................................ 128 4.5 SUMMARY AND FUTURE WORKS ...................................................................................................... 140 CHAPTER 5. CONCLUSIONS AND CONTRIBUTIONS ........................................................................... 142 REFERENCES .................................................................................................................................. 147 CHAPTER 6. APPENDIX ................................................................................................................... 157 6.1 DATA AND ANALYSIS PROCESSES ...................................................................................................... 157 6.2 PROGRAMS USED IN THESIS WORK .................................................................................................. 166 6.3 MATERIALS FROM SPRING 2010 WORK ............................................................................................ 170 6.4 MATERIALS FROM SPRING 2012 WORK ............................................................................................ 184 6.5 MATERIALS FROM SPRING 2013 WORK ............................................................................................ 250 vii LIST OF TABLES TABLE 1 OVERVIEW OF WORK CONTRIBUTING TO IDENTIFY BARRIERS TO LEARNING ..................................................... 20 TABLE 2 REINTERPRETATIONS OF STUDY RESULTS ABOUT STRUCTURED VERSUS OPPORTUNISTIC DESIGN BEHAVIORS ......... 25 TABLE 3 REINTERPRETATIONS OF STUDY RESULTS ABOUT PROGRAM PLAN THEORY ...................................................... 28 TABLE 4 REINTERPRETATIONS OF EMPIRICAL STUDY RESULTS ABOUT MEMORY AND RECALL .......................................... 32 TABLE 5 REINTERPRETATIONS OF EMPIRICAL RESULTS ABOUT OTHER MENTAL MODEL THEORY ...................................... 35 TABLE 6 REINTERPRETATIONS OF EMPIRICAL STUDY RESULTS ABOUT PRODUCTION VERSUS COMPREHENSION .................. 38 TABLE 7 REINTERPRETATIONS OF EMPIRICAL STUDY RESULTS ABOUT BUG GENERATION ................................................ 39 TABLE 8 REINTERPRETATIONS OF EMPIRICAL RESULTS ABOUT HYPOTHESIS-DRIVEN DEBUGGING BEHAVIORS .................... 41 TABLE 9 REINTERPRETATIONS OF EMPIRICAL STUDY RESULTS ABOUT CHARACTERS OF DEBUGGING BEHAVIORS ................. 41 TABLE 10 REINTERPRETATIONS OF EMPIRICAL RESULTS ABOUT DATA-DRIVEN DEBUGGING BEHAVIORS............................ 43 TABLE 11 QUESTIONS WITH SIMILAR METRIC AND DIFFERENT PERFORMANCE ............................................................. 56 TABLE 12 INITIAL MISCONCEPTION PYRAMID TABLE ............................................................................................... 59 TABLE 13 SAMPLE PSEUDOCODE ELEMENTS NOT RELATED TO CONCURRENCY ............................................................. 62 TABLE 14 PSEUDOCODE EXTENSIONS ON CONCURRENCY .......................................................................................