Published As
Mills, N., Wang, Y., and Giacaman, N. (2021). Visual Analogy for Understanding Polymorphism Types. In Proceedings of the 23rd Australasian Computing Education Conference 2021 (ACE 2021).
Using analogies and visualisation to understand key polymorphism concepts
Winner of 2020 Part IV Web Tools project!
Mills, N., Wang, Y., and Giacaman, N. (2021). Visual Analogy for Understanding Polymorphism Types. In Proceedings of the 23rd Australasian Computing Education Conference 2021 (ACE 2021).
The analogy is at the heart of the Polymorphism Visualiser application. The context of the analogy revolves around a mechanical machine that needs to read information off sheets of paper. To accomplish this, the machine needs to be guided by a screen to determine where to find the information it expects. The screen represents a variable, which allows access to certain sections through it. Instances themselves are represented as the sheets of paper that contain the necessary information on them.
The screens and sheets have been designed in such a way that they visually match up in terms of shape: a variable and an instance of the same class type visually appear correct identical to show they are "the same type". To allow for inheritance, the shapes are such that the extensions are again visually evident (each "extended section" of a screen or sheet is immediately linked to the class type inherited from).
Polymorphism Visualiser uses analogies and visualisation techniques to present polymorphism to students. The application is split into modules, with each subsequent one introducing new polymorphism concepts. The targeted concepts were derived from the common misconceptions students have with polymorphism found during research phase. Within each module, students are presented with a tutorial session which teaches the concepts as well as how the analogy applies. Students are then required to answer several quiz questions about the topics covered in that module. The analogy and visual components are integrated in the questions which students are encouraged to interact with to aid their understanding and performance.
The user interface is kept as simple as possible. The components representing the variables and instances are placed on opposite sides, with the interactive area in the middle where components are dragged onto it. Questions appear at the top, with their respective code snippets appearing at the bottom. There is also an option to view the inheritance tree for the classes should it be needed.
There are currently three modules available in Polymorphism Visualiser. The notable difference between these modules is the level of inheritance involved. The first module contains no inheritance, while the latter modules introduce a single level inheritance at a time. While these modules are similar, each new level of inheritance introduces new concepts. As a result, each module contains new questions to be solved. Even for questions present in a previous module, they will inherently become more complex as inheritance is introduced.
Questions are presented in two parts: the actual question and the corresponding code snippet. There are several types of questions such as asking you to replicate a code snippet using the visual components, or asking whether a snippet is valid. Questions cannot be answered straight away without replicating the scenario first, and applying the analogy to solve it. The questions are designed this way to provide a way to apply the analogy. The emphasis on code snippets hopes to help a smooth transition from learning the concepts to actually programming it.
The Polymorphism Visualiser was created for as a software engineering Final Year Project at the University of Auckland.
Nathan Mills
Allen Wang