Visuo-Spatial Programming: Visualising Software Structure to Aid the Integration of Egocentric Software Navigation Into an Al
Total Page:16
File Type:pdf, Size:1020Kb
! Visuo-spatial Programming: Visualising software structure to aid the integration of egocentric software navigation into an allocentric spatial cognitive map that supports software navigation and composition Daniel Robert Bradley BInfTech (Honours), GDipMolBiol, GCResComm A thesis submitted for the degree of Doctor of Philosophy at The University of Queensland in 2016 School of Information Technology and Electrical Engineering Abstract Despite extensive research into the cognitive processes used by programmers to form a functional mental model of software during program comprehension, there has been little research into how the structure of software is represented within long-term spatial memory. It is conjectured that this lack of emphasis on the spatial aspects of code has inadvertently resulted in mainstream software development environments not adequately supporting relative navigation of the software call graph, which results in programmer disorientation. While software understanding tools for visualising object-oriented software have been developed that leverage spatial memory, opening a class to reveal its source code usually obscures the spatial representation and also places the source code in a single common location that has no spatial relationship to the code just navigated from. This is likely to interfere with the integration of spatial information related to individual source code files into a common cognitive map within spatial memory. A key challenge that tool designers face is that, for any non-trivial program, it is impossible to represent all of the source code of a program on the screen at once. Recent prototype environments have used a variety of strategies, including using a semantic zoom that allows classes to be represented with differing amounts of information visible, allowing fragments of classes to be arranged on independent surfaces, and representing individual methods as bubbles that can be grouped within a scrollable workspace. This project has taken a different approach by conferring a spatial structure on source code that is based on its emergent structure, and implementing a visualisation technique that uses this structure to provide a consistent spatial representation of methods. The method-flow visualisation technique has been developed to support short-term spatial memory by placing editor columns within a scrollable flow view that ensures each column maintains a consistent spatial position if scrolled. As the programmer navigates a call graph by following hyperlink-enabled method calls, editor columns are added to the right- hand end of the flow view. At any time, the programmer can scroll the flow view to see previously traversed methods. It is theorised that method-flow allows short-term visuo- spatial memory to be refreshed, and provides more time for methods to be integrated into a cognitive map within spatial memory. Method-flow has been implemented as the Visuocode prototype software development environment and has been both informally and formally evaluated. Formal evaluation consisted of two qualitative think-aloud studies — the first of software navigation, and the second of program composition. Both formal studies asked each participant to perform a number of programming tasks using both Eclipse and Visuocode. During the studies, the screen activity of participants was recorded using screen-capture software, and later analysed to determine the number and type of navigations performed during each session. During both studies, participants performed more relative navigations while using Visuocode than while using Eclipse, and performed more direct and scrolling navigations while using Eclipse than while using Visuocode. While using Eclipse, participants tended to open classes, and then scroll down through them to discover class interrelationships – forming a mental model based on the program’s composition hierarchy. In contrast, while using Visuocode, participants tended to open the outline of a class, and then use method- flow to traverse the call graph to discover how classes interrelated – forming a mental model based on the program’s call graph. Further research is required to determine the advantages and disadvantages of either form of mental model. It is concluded that the method-flow visualisation technique is both intuitive to use, and also useful, as all participants used method-flow extensively during at least one activity. Method-flow was extensively used to navigate code during the software navigation study, and during such navigation no participants were observed to become disoriented while backtracking. During the program composition study, although method-flow was mainly used to refer to Javadoc documentation, Visuocode functioned as an effective environment for composition — two out of the three participants who successfully completed a task did so using Visuocode. One issue with method-flow was identified. While using Visuocode during traversal of the call graph, participants are often not made aware of other methods that are contained within any classes traversed — analogous to a horse that is ‘blinkered’. After their sessions, one participant expressed feeling misled by method-flow, and another mentioned that it took a while for them to get used to not looking at whole source files. In conclusion, while method-flow is considered to be a promising technique for navigating software, the effects caused by being ‘blinkered’ need to better understood. Declaration by author This thesis is composed of my original work, and contains no material previously published or written by another person except where due reference has been made in the text. I have clearly stated the contribution by others to jointly-authored works that I have included in my thesis. I have clearly stated the contribution of others to my thesis as a whole, including statistical assistance, survey design, data analysis, significant technical procedures, professional editorial advice, and any other original research work used or reported in my thesis. The content of my thesis is the result of work I have carried out since the commencement of my research higher degree candidature and does not include a substantial part of work that has been submitted to qualify for the award of any other degree or diploma in any university or other tertiary institution. I have clearly stated which parts of my thesis, if any, have been submitted to qualify for another award. I acknowledge that an electronic copy of my thesis must be lodged with the University Library and, subject to the policy and procedures of The University of Queensland, the thesis be made available for research and study in accordance with the Copyright Act 1968 unless a period of embargo has been approved by the Dean of the Graduate School. I acknowledge that copyright of all material contained in my thesis resides with the copyright holder(s) of that material. Where appropriate I have obtained copyright permission from the copyright holder to reproduce material in this thesis. Publications during candidature Daniel R. Bradley and Ian J. Hayes (2013) Visuocode: a software development environment that supports spatial navigation and composition. In the Proceedings of the 1st IEEE Working Conference on Software Visualization, Eindhoven, 28-29 September, 2013. Publications included in this thesis No publications included Contributions by others to the thesis No contributions by others Statement of parts of the thesis submitted to qualify for the award of another degree None Acknowledgements I would like to thank the University of Queensland for providing me the opportunity and resources to study for a PhD. During my candidature the University allowed me to enrol in and complete a Graduate Certificate in Research Commercialisation, and also provided me with an associated financial grant that I was very grateful for. I would like to thank all the staff and students who provided me with friendship and support during my time at the School of Information Technology and Electrical Engineering. Specifically, I would like to thank the people below, without whom I would not have been able to complete this thesis. I would like to dedicate this thesis to my first primary advisor David Carrington, who originally supported my application as a PhD student, but who sadly passed away during my candidature. I would like to express my thanks to Ralf Muhlberger who took me on as a then part-time research student and gave me valuable guidance that saw me pass my confirmation. I would like to thank Janet Wiles who encouraged and supported me in applying for and receiving a UQ ResTeach scholarship, and Peter Lindsay who provided me with part-time employment at the ARC Centre for Complex Systems — these positions provided me with much needed financial stability during the first several years of the thesis. I would like to gratefully thank Ian Hayes for taking me on and acting as my primary advisor through to submission and conferral — I very much appreciate the patience he has shown, and am thankful for the excellent and thorough feedback he has provided on numerous thesis drafts. I would like to thank Peter Robinson and Ben Matthews for acting as my associate advisors and for providing an extremely useful third perspective when presented with thesis drafts to read. I would also like to thank Stephen Viller for acting as my thesis committee chair, and I would like to thank Michael Bulmer for advice regarding the included statistical results. Finally, I would like