(Coursenotes for CSC 313 Teaching Computing)

Spatial skills and programming education

There is some evidence of a relationship between spatial skills and achievement/ability in STEM fields. Recently, this has come to include a relationship between spatial skills and programming ability.

This is a significant finding if we can build on it, because it’s a lot easier and cheaper to give someone spatial skills training than to teach them programming. So this may have impacts on performance and retention in early programming courses.

However, while correlations have been uncovered, we don’t yet have great explanations for why they exist.

In this lecture we’ll discuss:


What are spatial skills?

Attempting to understand and discuss something like spatial orientation skill, which is by definition intuitive and nonverbal, is like trying to grab smoke: The very act of reaching out to take hold of it disperses it. — Lindsay Anne Tartre

Spatial skills are hard to define, but they’ve been broken down into a few categories:

Spatial visualisation

This is the proficiency in being able “to mentally rotate, twist, or invert pictorially presented visual stimuli”.1

Can be further broken down into mental rotation and mental transformation.

Mental transformation

The manipulation and modification of objects. For example, see the question below.

Identify the cross-section after the following transformation has occurred. (Reproduced from [1])

Identify the cross-section after the following transformation has occurred. (Reproduced from [1])

Mental rotation

The ability to perform rotations on mental constructs; ability to see a physical representation of a structure and mentally imagine what the object would look like rotated in a different orientation.

Consider the following tests for 2D and 3D rotations.

Which of the following corresponds to the original shape?(Reproduced from [1])
Test of 3D rotation. Reproduced from [1])

Spatial relations

The ability to understand the arrangement and orientation of objects or patterns within their environment.

Identify which of the following options corresponds to the following cube. (Reproduced from [1])

Other factors

Closure speed

Speed in identifying an unknown pattern in an obscured environment.

Closure speed (Gestalt Completion Test). What do the two figures above depict? (Reproduced from [1])

Closure flexibility

Speed in identifying a known pattern in an obscured environment.

Closure flexibility (Hidden Figures Test). Which of the shapes in the top row appear in figures I and II in the bottom row? (Reproduced from [1])

Perceptual speed

Speed in identifying a known pattern from an unobscured environment.

Perceptual speed (Identical Pictures Test). Which of the figures is most similar to the first figure? (Reproduced from [1])

Do the “Spatial skills activity” in Canvas. As you work through the questions, think about the strategies you’re employing to solve those problems. Try to articulate what it is you’re doing as you try to solve those problems.

Spatial skills and STEM/CS

The relationship between spatial skills and STEM is nearly 70 years old. It’s a bi-directional relationship.

STEM practitioners (for example, chemistry, engineering, and, more recently, programming) have been shown to perform better than non-STEM practitioners on tests of spatial skills. And people who receive spatial skills training have been shown to perform better in STEM fields like computing than those who do not receive the spatial skills training.

We can reliably train spatial skills to see an improvement in engineering courses.

There are two arguments here:

  1. It seems likely that the same underlying cognitive functions are being exercised while performing spatial reasoning tasks and, say, programming.
  2. More importantly, exercising those cognitive processes in one context (spatial reasoning) seems to also hone those skills for the other context (programming). That is, the knowledge transfers from one context to the next.

Today we’ll try to understand the models that underly this relationship [1] and talk about a proposed theory for why this transfer takes place [2].

Spatial skills, program comprehension, and problem solving

Parkinson & Cutts put forth two guesses as to what’s going on.

Program comprehension

In The Programmer’s Brain, Felienne Hermans tell us that chunking plays a large role in the process of program comprehension.

Our working memory is responsible for temporary storage and processing of information. It’s where most of our “thinking” takes place, e.g., language comprehension, learning, and of course spatial reasoning. It is severely limited in the number of Things it can process at once, so to help it along, we are constantly retrieving related information from our long-term memory into our working memory.

Our long-term memory is like our hard drive—it’s practically limitless and stores information organised as a network of nodes.2

The connections between these nodes are critical for our ability to recall particular pieces of information. When connections between nodes are particularly strong, we are able to “chunk” multiple pieces of related information together. This lets us process all of that information as a single unit in working memory, greatly expanding the amount of information that can be processed in working memory.

This effectively expands our ability to “think”! This expansion is usually domain-specific and does not automatically transfer from one domain to another. Being able to memorise a hundred numbers does not mean one can also memorise a hundred names or faces.

While trying to understand a program, those “chunks” can be familiar syntax forms (e.g., public static void main in a Java program, the variable i being the counter in a for loop) or templates, variable roles, or design patterns that, through repeated exposure, you have internalised into atomic chunks. For example, to a software engineer who has learned about the Visitor Design Pattern, a codebase using that pattern will be like a map clearly laid out in front of them, easy to navigate to perform some programming task. To a developer unfamiliar with the pattern, the codebase is just a large amount of source code that needs to be understood through programming expertise alone (which, to be clear, can get you quite far; but wouldn’t it nice if it were easier?).

The task of recognising these “anchors” or “beacons” in a codebase and retrieving the relevant knowledge is a lot like the task of identifying known patterns in an obscured environment, i.e., the closure flexibility task.

Problem-solving

Recall the idea of a mental model—an abstract belief about a system or problem at hand. In order to correctly understand or write a program, a person must have an accurate mental model of the machine that will be “executing” the program. For learning programming, the “machine” or runtime environment can also be reasoned about at a more simplified, abstract level (i.e, a notional machine).

We know that experts develop robust mental models that are adaptable, in contrast to novices, whose mental models tend to be fragile, internally inconsistent, and liable to unpredictable change.

Constructing a mental model of a system (or a notional machine) requires understanding how various components are linked together; it must be subject to development and restructuring as and when required.

This manipulation of abstract structures is closely related to the cognitive processes at play in the mental transformation spatial reasoning task above.

Considering concepts in new orientations or contexts is akin to the tasks of spatial relations (or mental rotation for more complex tasks). For example, consider the multiple ways in which some compound data may be represented. Depending on the task, the programmer may be expected to fluidly transition from one representation to the next to aid in the problem solving process.

Some experimental results from Parkinson and Cutts

Experiment 1. (2019, in [1])

Experiment 2. (2020, in The Effect of a Spatial Skills Training Course in Introductory Computing)

Spatial encoding strategy theory

We now have a general idea that the same cognitive functions are being exercised when one performs spatial reasoning tasks as well as when one engages in programming and problem solving (argument #1 above). We now turn to argument #2, which tells us that these cognitive skills seem to transfer from the context of spatial skills training to the context of programming (or other STEM fields).

That second point is something of a curiosity. Recall our discussions in week 1 about the idea that Computational Thinking would enable people to apply computational ideas to their everyday life. Those arguments have largely not been backed up by evidence. Computational thinking skills do not automatically transfer to other contexts. Transfer of learning doesn’t happen automatically; we have to explicitly teach for transfer, and even then it is difficult.

So why do skills gained from spatial skills training apparently transfer to STEM contexts, and vice versa, without explicitly teaching for this transfer?

Spatial encoding strategy theory, proposed by Lauren Margulieux [2], posits that spatial reasoning requires the following two generalisable skills:

These are important problem-solving skills in virtually all STEM disciplines. Margulieux suggests that this theory would explain a number of findings in prior work.

Discussion

Should we include spatial skills training in our introductory programming curriculum?


  1. Mark McGee — Human spatial abilities: Psychometric studies and environmental, genetic, hormonal, and neurological influences. 

  2. This is a greatly simplified view of the world, but one I can work with.