Spatial skills and programming education

(Coursenotes for CSC 313 Teaching Computing)

đź“– Readings

[1] Investigating the Relationship Between Spatial Skills and Computer Science by Jack Parkinson and Quintin Cutts (2018)

[2] Spatial Encoding Strategy Theory: The Relationship Between Spatial Skill and STEM Achievement by Lauren Margulieux (2019)

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. However, while correlations have been uncovered, there’s little in the way of explanations for these correlations.

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.

In this lecture we’ll discuss:

  • Spatial skills and spatial skills training
  • A proposed explanation for the relationship between spatial skills and STEM achievement
  • Implications for computing education

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
  • Spatial relations
  • Closure speed
  • Closure flexibility
  • Perceptual speed

Spatial visualisation

McGee defined this as the proficiency in being able “to mentally rotate, twist, or invert pictorially presented visual stimuli”.

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?

🤔 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.

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

The argument here is not that one is engaging in spatial reasoning while programming (or while performing physics or chemistry tasks, etc.). Rather, the argument is twofold:

  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

In The Programmer’s Brain, Felienne Hermans cites research that suggests that chunking plays a large role in the process of program comprehension. That is, our working memory is severely limited in the number of Things it can process at once. To help it along, we are constantly retrieving atomic tokens or “chunks” of knowledge from our long-term memory into our working memory—the more information we have chunked, the more Things we can “load” into working memory to process at a given time.

While trying to understand a program, those knowledge chunks can be syntax forms that are familiar to you (e.g., public static void main) or templates, variable roles, or design patterns that, through repeated exposure, you have internalised into atomic chunks (e.g., patterns for filter or map operations; accumulator variables, etc.).

The task of recognising these 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.

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])

  • 1st year, honours 1st year, MS, PhD, and Staff
  • Systems, HCI, Data, and Theory/algorithms
  • More or less, spatial skill increased as academic attainment increased
    • With the exception of PhD students, for whom the spread was large, attributed to the wide range of backgrounds of these students
  • The Theory/algorithms area had the highest spatial skill, and the HCI area had the lowest

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

  • Some students in CS 0 and CS 1 received online spatial skills training
  • Findings:
    • Online training improved spatial skills, wiping out any initial difference between men and women
    • In the CS 0 course, the students who received spatial skills training outperformed those who did not
    • In the CS 1 course, there was no difference

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. Learning transfer is notoriously difficult. It 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 attempts to explain the transferability of spatial skill to STEM achievement.

Human cognition and spatial skills

To understand the theory, let’s remind ourselves of some basic ideas of how human cognition works.

Our working memory is responsible for temporary storage and processing of information. It is where most of our “thinking” takes place, e.g., language comprehension, learning, and of course spatial reasoning. Working memory has a limited capacity—it can process only 4–6 units of information at one time.

Our long-term memory is like our hard drive—it’s practically limitless and stores information organised as a network of nodes. Previously stored information is usually retrieved from long-term memory into working memory to help process new information.

The connections between these nodes are critical for our ability to recall particular pieces of information. When these connections are particularly strong, we are able to “chunk” multiple pieces of related information together. Crucially, 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.

So how does this relate to spatial skills?

Spatial encoding strategy theory proposes that spatial reasoning requires the following two generalisable skills:

  • Being able to encode mental representations of non-verbal information (e.g., constructing a mental model of abstract systems and how they work). Non-verbal information, even if not related to spatial skills, tend to be stored using the same cognitive mechanisms as spatial information.
  • This includes the identification of useful landmarks to orient the mental representation

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.

  • Learners rely on general problem-solving skills before learning domain-specific ones. Learners with higher spatial skills have better general strategies for representing problems and for identifying landmarks (“beacons”) in problems, both of which make problem-solving less taxing.
  • Spatial skill predicts initial STEM achievement more accurately than later STEM achievement. As learners gain more domain-specific skills, their reliance on general problem-solving strategies (like those gained from spatial skills training) are less relevant. This is in keeping with 2020 findings from Jack Parkinson and Quintin Cutts, which found that explicit spatial skills training was associated with improved performance in a CS 0 course, but not a CS 1 course. What’s pretty cool is that Spatial encoding strategy theory was published the year before this finding, and could essentially predict it.
  • There are gender differences in initial spatial skills—at the college level, men seem to have higher initial spatial skills than women. This can be linked to influences growing up (toys, encouragement for different disciplines, etc.). Importantly, even a little spatial skills training pretty much eliminates these differences, and spatial skills training reliably increases STEM performance.
  • The “transfer curiosity” is explained because spatial training directly addresses general skills, rather than domain-specific skills. It is easier to transfer skills from general contexts to domain-specific contexts than vice versa.


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