Source Code Interaction on Touchscreens
Total Page:16
File Type:pdf, Size:1020Kb
Source Code Interaction on Touchscreens Inaugural-Dissertation zur Erlangung der Doktorwürde der Fakultät für Sprach-, Literatur- und Kulturwissenschaften der Universität Regensburg vorgelegt von Felix Raab München 2014 Regensburg 2014 Erstgutachter Prof. Dr. phil. Christian Wolff Universität Regensburg Zweitgutachter Prof. Dr. rer. nat. Florian Echtler Bauhaus-Universität Weimar Dedicated to my family. Dedicated to Doris, who has joined me on this journey. Don’t generalize; generalizations are generally wrong. (Butler W. Lampson) Abstract Direct interaction with touchscreens has become a primary way of using a device. This work seeks to devise interaction methods for editing textual source code on touch-enabled devices. With the advent of the “Post-PC Era”, touch-centric interaction has received considerable attention in both research and development. However, various limitations have impeded widespread adoption of programming environments on modern platforms. Previous attempts have mainly been successful by simplifying or constraining conventional programming but have only insufficiently supported source code written in mainstream programming languages. This work includes the design, development, and evaluation of techniques for editing, selecting, and creating source code on touchscreens. The results contribute to text editing and entry methods by taking the syntax and structure of programming languages into account while exploiting the advantages of gesture-driven control. Furthermore, this work presents the design and software architecture of a mobile development environment incorporating touch-enabled modules for typical software development tasks. vii Zusammenfassung Die direkte Interaktion auf Touchscreens hat sich zu einer wesentlichen Form der Be- dienung von Geräten entwickelt. Die vorliegende Dissertation beschäftigt sich mit der Entwicklung von Interaktionsmethoden zur Bearbeitung von textbasiertem Quellcode auf Geräten mit Touchscreen. Seit der “Post-PC-Ära” spielt Touchscreenbedienung eine wachsende Rolle in Forschung und Entwicklung. Diverse Limitierungen erschweren jedoch die Ausführung und Bedienung von Programmierumgebungen auf modernen Plattformen. Bisherige Arbeiten erzielen vor allem durch die Vereinfachung oder Ein- schränkung konventioneller Programmierung Erfolge, unterstützen Quellcode von Mainstream-Programmiersprachen allerdings nur unzureichend. Diese Arbeit umfasst die Konzeption, Entwicklung und Auswertung von Methoden zur Bearbeitung, Auswahl und Erzeugung von Quellcode auf Touchscreens. Die Ergebnisse ergänzen Texteingabe- und Bearbeitungsmethoden dahingehend, dass die Syntax und Struktur von Quellcode berücksichtigt wird und gleichzeitig die Vorteile gesten-gesteuerter Bedienung ausge- nutzt werden. Darüber hinaus stellt die Arbeit die Konzeption und Software-Architektur einer mobilen Entwicklungsumgebung mit Touch-Bedienung vor. ix Acknowledgements First, I would like to thank Prof. Dr. Christian Wolff for his supervision of my work and for his professional advice. I am particularly thankful that he approved my topic since I could not imagine having completed the present work without an intrinsic interest in this research area. Also, I am thankful that he allowed me to teach University courses covering the areas of programming and user interaction. Second, I would like to thank Prof. Dr. Florian Echtler for his supervision. I am pleased about having met him during his time as Visiting Professor at the University. Thanks for your comments and support with publications. Third, I would like to thank Dr. Markus Heckner for having enabled me to conduct research in his Android programming courses. Thanks to Markus Fuchs for his help in carrying out these studies and for various discussions during the many long train journeys to Regensburg. Also, thanks to all former University colleagues for having contributed to a pleasant work environment. Finally, I would like to thank all participants that took part in my user studies. Your feedback has been valuable, and the results generated by you interacting with my prototypes are a central part of this work. xi Contents Abstract vii Zusammenfassung ix Acknowledgements xi List of Figures xxii List of Tables xxiii Note on Writing Style xxv 1 Introduction 1 1.1 Problem Statement . .1 1.1.1 Challenges . .2 1.1.2 Prior Approaches . .2 1.1.3 Research Objectives . .4 1.2 Research Approach . .5 1.3 Publications . .6 1.4 Structure . .7 1.5 HCI Terms . .9 I Background and Prior Work 11 2 Background 13 2.1 Source Code, Programming, and Usability . 13 2.1.1 Programming Paradigms and Languages . 14 2.1.2 Cognitive Aspects of Programming . 16 xiii Contents 2.1.3 Forms of Representation . 17 2.2 Integrated Development Environments . 21 2.2.1 IDE Components . 21 2.2.2 Usability and Usefulness of IDEs . 23 2.2.3 Text Editors and IDEs . 23 2.3 Types of IDEs . 24 2.3.1 The first IDE . 25 2.3.2 Textual Environments . 25 2.3.3 Modern Desktop Environments . 26 2.3.4 Visual Programming Environments . 28 2.3.5 Hybrid Environments . 29 2.3.6 Recent Developments . 31 2.4 Programming on Touchscreens . 32 3 Related Work 35 3.1 Touch and Pen Development Environments . 36 3.2 Text Editing . 40 3.2.1 Text Editing in Desktop Environments . 41 3.2.2 Text Entry on Touchscreens . 42 3.2.3 Text Editing Gestures . 43 3.3 Editor User Interfaces and Interaction . 45 3.3.1 Novel Editor Interfaces . 45 3.3.2 Intelligent Code Editing . 46 3.3.3 Code Navigation and Search . 49 3.4 Commands, Menus, and Gestures . 51 3.5 Multi-modal Development Tools . 55 II Source Code Interaction 59 4 Editing Source Code 61 4.1 Introduction . 61 4.1.1 Code Editing Operations . 62 4.1.2 Code Editing Triggers . 64 4.2 Refactoring . 66 4.2.1 Refactoring Tools . 69 4.2.2 Gesture-driven Tools . 72 xiv Contents 4.3 User Study . 73 4.3.1 Editor Operations . 74 4.3.2 Participants . 76 4.3.3 Test Setup . 76 4.3.4 Procedure . 79 4.3.5 Results . 80 4.3.6 Observations . 86 4.3.7 Discussion . 87 4.3.8 Design Recommendations . 89 4.3.9 Conclusion . 91 5 Selecting Source Code 93 5.1 Introduction . 93 5.1.1 Terminology and Selection Mechanics . 94 5.1.2 Modeless vs. Modal Selection . 95 5.1.3 Selection in Desktop IDEs . 95 5.1.4 Selection on Mobile Platforms . 97 5.2 User Study . 100 5.2.1 Participants . 100 5.2.2 Test Setup . 100 5.2.3 Procedure . 101 5.2.4 Analysis . 103 5.2.5 Results . 106 5.2.6 Discussion . 111 5.3 Interaction Methods . 112 5.3.1 Syntax-aware Selection . 112 5.3.2 Selection Gestures and Widgets . 117 5.4 Conclusion . 120 6 Creating Source Code 123 6.1 Challenges . 123 6.1.1 Fat Fingers . 124 6.1.2 Touch Model . 124 6.1.3 Language Model . 125 6.1.4 Text vs. Source Code . 125 6.2 Code Creation in Desktop IDEs . 126 xv Contents 6.2.1 Smart Typing . 127 6.2.2 Code Completion . 127 6.2.3 Code Hints . 128 6.2.4 Code Templates . 129 6.2.5 Code Generation . 130 6.3 Towards a Code Entry Keyboard . 130 6.3.1 General Design Approach . 130 6.3.2 Keyboard Layout and Size . 132 6.3.3 Gestures and Marking Buttons . 136 6.3.4 Code Templates . 137 6.3.5 Code Completion . 139 6.3.6 Underlying Models . 140 6.4 User Study . 141 6.4.1 Participants . 141 6.4.2 Test Setup . 142 6.4.3 Tasks and Procedure . ..