SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Downloaden Sie, um offline zu lesen
The I in PRIMM
Code comprehension and questioning
Dr Sue Sentance
29th February 2020
@suesentance
CAS London Conference 2020
Objectives of this session
- To briefly outline the PRIMM methodology and point to
some resources
- To introduce the Block Model as a way of thinking about
programming at different levels
- How we can use questioning and targeted tasks to
support comprehension of program code
- To share some potential tasks around code
comprehension that you could use on Monday!
What can cause learners to struggle with
programming tasks?
Challenges faced Possible reasons …
Perception of
programming as hard –
challenges resilience and
self-efficacy
Programs usually don’t work until many iterations have
passed
There is a “hard” myth (or is it a myth)
Belief in geek gene
Use of “adult” teaching approaches
A working program does
not equate to
understanding of
programming concepts
Too much copying of code without understanding
High cognitive load involved in programming
Focus on product rather than process
Students have
misconceptions &
incorrect mental model
Many misconceptions are known but this has not
transferred into teacher training
Teachers have fragile knowledge & misconceptions too
Programming pedagogy & PRIMM
Some examples:
• Pair programming (Williams & Kessler,
2002)
• Worked examples (Morrison,
Margulieux & Guzdial, 2015)
• Peer instruction (Porter et al, 2011)
• Live coding/ modelling (Rubin, 2013)
• Tracing/ reading code (Lister, many)
• Use-modify-create (Lee et al, 2011)
• Stepwise explanations (Wirth, 2001)
In this context, PRIMM is one approach
to use for programming pedagogy
Specifically it is designed to:
1) Help teachers structure lessons
2) Reflect on the teaching process
3) Cater for varying needs
The PRIMM approach
• Predict – given a working program, talk about it in
pairs or groups. What do you think it will do?
• Run – run it and test your prediction
• Investigate – get into the nitty gritty. What does
each line of code mean? Lots of activities to try
here: trace, annotate, explain, talk about,
identify parts, etc….
• Modify – edit the program to make it do different
things
• Make – design a new program that uses the same
nitty gritty but that solves a new problem
Look at this Python (turtle) code
Discuss with the person next to you
Draw the output
What discussions did you have?
Did you help each other?
What did you learn?
An activity for you – you will need a piece of paper and a companion
Now imagine you could run the program
This is what would actually be output
Did you get it right?
If not, what is different about your answer?
PRIMM Examples
Predict
Run
Investigate
Modify
Make
Lesson 3
PRIMM Examples
Predict
Run
Investigate
Modify
Make
Keep starter programs
on a shared drive
Students should
download, check what
they do and compare
with prediction
PRIMM Examples
Predict
Run
Investigate
Modify
Make
Ask different types of questions
PRIMM Examples
Predict
Run
Investigate
Modify
Make
PRIMM Examples
Predict
Run
Investigate
Modify
Make
PRIMM Examples
Predict
Run
Investigate
Modify
Make
Improve the pizza program so that it doesn’t print out
“and X” at the end. You will have to add an “if”
statement to do this.
Modify the program to have a conversation with
somebody about sport. An example is given below but
you can add your own questions.
Change your triangle function so that it uses a for loop
Write a function pentagon() to create a pentagon (5
sides) with sides length 200
Write a function hexagon() to create a blue hexagon (6
sides) with sides length 50
PRIMM Examples
Predict
Run
Investigate
Modify
Make
Focusing in on Investigate
What are good questions to ask?
Here are two programs (they do the same thing – just choose
the language you prefer!)
What questions might you ask learners to help you gauge their
understanding?
Activity 1: Asking questions
Two versions of the same program
In pairs or threes, think about some good
“Investigate” questions you could ask pupils
to see if they understood the code – and to
prepare them to write something similar
Feedback
Why focus on code comprehension?
• Being able to read and understand code greatly increases
your ability to write code (proven by research)
• Talking about the program means you need the words to
label the various parts – so improves program terminology –
the teacher can help here
• The goal of program comprehension is to allow the
beginner programmer to construct their own mental model.
But how do we know if we are asking the right questions?
And if the pupils can’t answer what does that tell us?
Enter …. The Block Model
What if we could classify tasks and questions?
What is … ?
How would
you …?
Can you spot
the …?
Show me a
… ?
What does …
do?
Granularity of
piece of program
code
Structure ---> Function of program
(M) Macro structure Understanding the
overall structure of the
program text
Understanding the
algorithm underlying a
program
Understanding the
goal/purpose of the
program in the current
context
(R) Relationships Relationships between
blocks
Sequence of function
calls, object sequence
diagrams
Understanding how sub
goals are related to goals
(B) Blocks Regions of interest that
build a unit (syntactically
or semantically)
Operation of a block or
function.
Understanding of the
function of a block of
code.
(A) Atoms Language elements Operation of a
statement.
Function of a statement.
(T) Text Surface (P) Program Execution (F) Function
Architecture/ Structure Relevance /Intention
The Block Model
(M) Macro structure
(R) Relationships
(B) Blocks
(A) Atoms Identify the keywords in
a piece of code
(T) Text Surface (P) Program Execution (F) Function
Architecture/ Structure Relevance /Intention
The Block Model
When a student really understands
the program code they should be
able to answer questions in every
area of the Block Model
(M) Macro structure What does this program
do?
(R) Relationships
(B) Blocks
(A) Atoms Identify the keywords in
a piece of code
(T) Text Surface (P) Program Execution (F) Function
Architecture/ Structure Relevance /Intention
The Block Model
When a student really understands
the program code they should be
able to answer questions in every
area of the Block Model
Activity 2: Types of questions/tasks
In pairs or threes ….
Look at the list of possible tasks/questions around code
comprehension
Where might they fit on the Block Model?
Example
(M) Macro structure Annotate the whole
program showing where
functions are called and
defined.
What set of inputs
could be used to check
all routes/flows through
the program
Summarise what the
program does
(R) Relationships Identify the scope of a
variable
Identify which branch
of an if statement will
never be executed
Identify two blocks of
code which will produce
the same outputs
(B) Blocks Draw a block around an
if statement
Solve a Parson’s
Problem
Give an appropriate
name to a block of code
or function
(A) Atoms List all the integer
variables
Trace a value through
the program code
Identify the purpose of a
single statement
Answer (T) Text Surface (P) Program Execution (F) Function
Architecture/ Structure Relevance /Intention
The Block Model
(M) Macro structure
✓ ✓ ✓
(R) Relationships
✓ ✓ ✓
(B) Blocks
✓ ✓ ✓
(A) Atoms
✓ ✓ ✓
Answer (T) Text Surface (P) Program Execution (F) Function
Architecture/ Structure Relevance /Intention
The Block Model
Carla
Mia
(M) Macro structure
X ✓ ✓
(R) Relationships
✓ ✓ ✓
(B) Blocks
✓ X X
(A) Atoms
✓ X ✓
Answer (T) Text Surface (P) Program Execution (F) Function
Architecture/ Structure Relevance /Intention
The Block Model
Carla
“Novice programmers’ early
comprehension models can be
characterized by a pattern of “holey
knowledge”(i.e. an incomplete
patchwork of fabric, with empty
cells and missing stuffing)” (Schulte
et al, 2010)
Why is it important to ask different types of questions
about the code?
The Holey
Quilt
(gaps in
knowledge)
“Novice programmers’ early
comprehension models can be
characterized by a pattern of “holey
knowledge”(i.e. an incomplete
patchwork of fabric, with empty
cells and missing stuffing)” (Schulte
et al, 2010)
The programming “mental model”
Includes:
- Elements and structure of the program
- Execution behaviour of the program
- Purpose of the whole program
- Purpose of individual blocks
How is the mental model developed? One view ….
Social plane Cognitive plane
(Vygotsky)
Activity 3: Revisiting activity 1
Now look back at the program we looked at earlier
You thought of some questions
Where are these in the Block Model?
Discuss ….
Which tasks and questions are easier to answer than others?
How to progress through different
questions and tasks?
(M) Macro structure Understanding the
overall structure of the
program text
Understanding the
algorithm underlying a
program
Understanding the
goal/purpose of the
program in the current
context
(R) Relationships Relationships between
blocks
Sequence of function
calls, object sequence
diagrams
Understanding how sub
goals are related to goals
(B) Blocks Regions of interest that
build a unit (syntactically
or semantically)
Operation of a block or
function.
Understanding of the
function of a block of
code.
(A) Atoms Language elements Operation of a
statement.
Function of a statement.
(T) Text Surface (P) Program Execution (F) Function
Architecture/ Structure Relevance /Intention
The Block Model
What about progression
through the types of
tasks? ?
What does the program do?
“One interesting observation is that students often have
difficulties explaining the purpose of the whole program (MF),
and if asked to describe the code goal, they explain the
execution of the program (P) and often step-by-step.” (Izu et
al, 2020).
In PRIMM we start with predicting the purpose of a small block
of code. This serves as a reminder that this is not easy for
students, and so simple, short extracts of code should be used.
The goal of predict is to get students used to thinking about
why programs are there and to focus on function first.
Try it out with your classes
Try to ask different questions about programs in your class
Which types of question are most difficult/ easy?
Where is the progression?
Where can we uncover misconceptions?
Try out in your class. Do share any insights with me.
This work is ongoing research. More details will appear at
http://primming.wordpress.com
PRIMM Resources
http://primming.wordpress.com
Materials here that were
used for the two
research studies – and in
time we hope to upload
teachers’ contributions
from their own PRIMM
resources
If you have PRIMM
resources please share
with me!
Summary
- A brief introduction to PRIMM
- The importance of understanding program code
- The Block Model for code comprehension
- Some tasks and questions to use in class
- Remember the holey quilt!
Further reading (if you like depth)
Izu et al (2019). Fostering Program Comprehension in Novice Programmers-Learning Activities and Learning
Trajectories. In Proceedings of the Working Group Reports on Innovation and Technology in Computer Science
Education (pp. 27-52).
Sentance, S., Waite, J., & Kallia, M. (2019). Teaching computer programming with PRIMM: a sociocultural
perspective. Computer Science Education, 29(2-3), 136-176.
Further browsing
http://primming.wordpress.com
Thanks for participating
Contact me at
sue@raspberrypi.org or
sue.sentance@kcl.ac.uk
@suesentance

Weitere ähnliche Inhalte

Was ist angesagt?

Pertemuan 5 list view
Pertemuan 5 list viewPertemuan 5 list view
Pertemuan 5 list viewheriakj
 
Intellij idea tutorial
Intellij idea tutorialIntellij idea tutorial
Intellij idea tutorialHarikaReddy115
 
Урок 50. Абсолютні, відносні та мішані посилання на комірки та діапазони комірок
Урок 50. Абсолютні, відносні та мішані посилання на комірки та діапазони комірокУрок 50. Абсолютні, відносні та мішані посилання на комірки та діапазони комірок
Урок 50. Абсолютні, відносні та мішані посилання на комірки та діапазони комірокВасиль Тереховський
 
Rpp kelas 7 tahun 2013 chapter 2 semester 1
Rpp kelas 7 tahun 2013 chapter 2 semester 1Rpp kelas 7 tahun 2013 chapter 2 semester 1
Rpp kelas 7 tahun 2013 chapter 2 semester 1aausi sanusi
 
Про програму Scratch
Про програму ScratchПро програму Scratch
Про програму Scratchtawa12345
 
Формати аудіо- та відеофайлів. Програмне забезпечення для опрацювання об’єкт...
Формати аудіо- та відеофайлів. Програмне забезпечення для  опрацювання об’єкт...Формати аудіо- та відеофайлів. Програмне забезпечення для  опрацювання об’єкт...
Формати аудіо- та відеофайлів. Програмне забезпечення для опрацювання об’єкт...Юлія Артюх
 
Hibernate
HibernateHibernate
HibernateAjay K
 
урок 30 розробка плану створення презентації визначення мети, сценарію та стр...
урок 30 розробка плану створення презентації визначення мети, сценарію та стр...урок 30 розробка плану створення презентації визначення мети, сценарію та стр...
урок 30 розробка плану створення презентації визначення мети, сценарію та стр...Сокальська ЗШ І-ІІІ ступенів №2
 
Kd15 menganalisis struktur penyimpanan pada rdbms
Kd15 menganalisis struktur penyimpanan pada rdbmsKd15 menganalisis struktur penyimpanan pada rdbms
Kd15 menganalisis struktur penyimpanan pada rdbmsrohmat arief
 
RPP Rencana Aksi 1.pdf
RPP Rencana Aksi 1.pdfRPP Rencana Aksi 1.pdf
RPP Rencana Aksi 1.pdfAbuUbaidillah7
 
Streams In C# Tutorial
Streams In C# TutorialStreams In C# Tutorial
Streams In C# TutorialSimplilearn
 

Was ist angesagt? (18)

Pertemuan 5 list view
Pertemuan 5 list viewPertemuan 5 list view
Pertemuan 5 list view
 
Лекція №3
Лекція №3Лекція №3
Лекція №3
 
Intellij idea tutorial
Intellij idea tutorialIntellij idea tutorial
Intellij idea tutorial
 
Client Side Scripting
Client Side ScriptingClient Side Scripting
Client Side Scripting
 
Урок 50. Абсолютні, відносні та мішані посилання на комірки та діапазони комірок
Урок 50. Абсолютні, відносні та мішані посилання на комірки та діапазони комірокУрок 50. Абсолютні, відносні та мішані посилання на комірки та діапазони комірок
Урок 50. Абсолютні, відносні та мішані посилання на комірки та діапазони комірок
 
Rpp kelas 7 tahun 2013 chapter 2 semester 1
Rpp kelas 7 tahun 2013 chapter 2 semester 1Rpp kelas 7 tahun 2013 chapter 2 semester 1
Rpp kelas 7 tahun 2013 chapter 2 semester 1
 
Про програму Scratch
Про програму ScratchПро програму Scratch
Про програму Scratch
 
Формати аудіо- та відеофайлів. Програмне забезпечення для опрацювання об’єкт...
Формати аудіо- та відеофайлів. Програмне забезпечення для  опрацювання об’єкт...Формати аудіо- та відеофайлів. Програмне забезпечення для  опрацювання об’єкт...
Формати аудіо- та відеофайлів. Програмне забезпечення для опрацювання об’єкт...
 
8 клас урок 3
8 клас урок 38 клас урок 3
8 клас урок 3
 
Hibernate
HibernateHibernate
Hibernate
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
урок 30 розробка плану створення презентації визначення мети, сценарію та стр...
урок 30 розробка плану створення презентації визначення мети, сценарію та стр...урок 30 розробка плану створення презентації визначення мети, сценарію та стр...
урок 30 розробка плану створення презентації визначення мети, сценарію та стр...
 
Kd15 menganalisis struktur penyimpanan pada rdbms
Kd15 menganalisis struktur penyimpanan pada rdbmsKd15 menganalisis struktur penyimpanan pada rdbms
Kd15 menganalisis struktur penyimpanan pada rdbms
 
RPP Rencana Aksi 1.pdf
RPP Rencana Aksi 1.pdfRPP Rencana Aksi 1.pdf
RPP Rencana Aksi 1.pdf
 
середовище Lazarus
середовище Lazarusсередовище Lazarus
середовище Lazarus
 
Streams In C# Tutorial
Streams In C# TutorialStreams In C# Tutorial
Streams In C# Tutorial
 
RPP SMP Notice
RPP SMP NoticeRPP SMP Notice
RPP SMP Notice
 
7_1212.pptx
7_1212.pptx7_1212.pptx
7_1212.pptx
 

Ähnlich wie The I in PRIMM - Code Comprehension and Questioning

Teaching of computer programming
Teaching of  computer programmingTeaching of  computer programming
Teaching of computer programmingmarpasha
 
12266422.ppt
12266422.ppt12266422.ppt
12266422.pptCSEC5
 
Unit No 6 Design Patterns.pptx
Unit No 6 Design Patterns.pptxUnit No 6 Design Patterns.pptx
Unit No 6 Design Patterns.pptxDrYogeshDeshmukh1
 
Mit109 – software engineering
Mit109 – software engineeringMit109 – software engineering
Mit109 – software engineeringsmumbahelp
 
Mit109 – software engineering
Mit109 – software engineeringMit109 – software engineering
Mit109 – software engineeringsmumbahelp
 
PATTERNS01 - An Introduction to Design Patterns
PATTERNS01 - An Introduction to Design PatternsPATTERNS01 - An Introduction to Design Patterns
PATTERNS01 - An Introduction to Design PatternsMichael Heron
 
software engineering
software engineeringsoftware engineering
software engineeringTayfun Çelik
 
Mit3033 software architecture
Mit3033  software architectureMit3033  software architecture
Mit3033 software architecturesmumbahelp
 
Module 2 design patterns-2
Module 2   design patterns-2Module 2   design patterns-2
Module 2 design patterns-2Ankit Dubey
 
M256 Unit 1 - Software Development with Java
M256 Unit 1 - Software Development with JavaM256 Unit 1 - Software Development with Java
M256 Unit 1 - Software Development with JavaYaseen
 
Google Interview Prep Guide Software Engineer
Google Interview Prep Guide Software EngineerGoogle Interview Prep Guide Software Engineer
Google Interview Prep Guide Software EngineerLewis Lin 🦊
 
CS251 Intro. to SE [Lec. 0 - Course Introduction & Plan] Spring 2022.pdf
CS251 Intro. to SE [Lec. 0 - Course Introduction & Plan] Spring 2022.pdfCS251 Intro. to SE [Lec. 0 - Course Introduction & Plan] Spring 2022.pdf
CS251 Intro. to SE [Lec. 0 - Course Introduction & Plan] Spring 2022.pdfTitoMido1
 
Introduction to design patterns
Introduction to design patternsIntroduction to design patterns
Introduction to design patternsAmit Kabra
 
2015_CTI_IS-Internet-Development_Module-Description_Final
2015_CTI_IS-Internet-Development_Module-Description_Final2015_CTI_IS-Internet-Development_Module-Description_Final
2015_CTI_IS-Internet-Development_Module-Description_FinalMoses75
 

Ähnlich wie The I in PRIMM - Code Comprehension and Questioning (20)

Teaching of computer programming
Teaching of  computer programmingTeaching of  computer programming
Teaching of computer programming
 
12266422.ppt
12266422.ppt12266422.ppt
12266422.ppt
 
Unit No 6 Design Patterns.pptx
Unit No 6 Design Patterns.pptxUnit No 6 Design Patterns.pptx
Unit No 6 Design Patterns.pptx
 
Mit109 – software engineering
Mit109 – software engineeringMit109 – software engineering
Mit109 – software engineering
 
Mit109 – software engineering
Mit109 – software engineeringMit109 – software engineering
Mit109 – software engineering
 
PATTERNS01 - An Introduction to Design Patterns
PATTERNS01 - An Introduction to Design PatternsPATTERNS01 - An Introduction to Design Patterns
PATTERNS01 - An Introduction to Design Patterns
 
software engineering
software engineeringsoftware engineering
software engineering
 
Brochure curriculum (1)
Brochure curriculum (1)Brochure curriculum (1)
Brochure curriculum (1)
 
Mit3033 software architecture
Mit3033  software architectureMit3033  software architecture
Mit3033 software architecture
 
Patterns Overview
Patterns OverviewPatterns Overview
Patterns Overview
 
Module 2 design patterns-2
Module 2   design patterns-2Module 2   design patterns-2
Module 2 design patterns-2
 
M256 Unit 1 - Software Development with Java
M256 Unit 1 - Software Development with JavaM256 Unit 1 - Software Development with Java
M256 Unit 1 - Software Development with Java
 
Google Interview Prep Guide Software Engineer
Google Interview Prep Guide Software EngineerGoogle Interview Prep Guide Software Engineer
Google Interview Prep Guide Software Engineer
 
CS251 Intro. to SE [Lec. 0 - Course Introduction & Plan] Spring 2022.pdf
CS251 Intro. to SE [Lec. 0 - Course Introduction & Plan] Spring 2022.pdfCS251 Intro. to SE [Lec. 0 - Course Introduction & Plan] Spring 2022.pdf
CS251 Intro. to SE [Lec. 0 - Course Introduction & Plan] Spring 2022.pdf
 
Introduction to design patterns
Introduction to design patternsIntroduction to design patterns
Introduction to design patterns
 
OOP Java
OOP JavaOOP Java
OOP Java
 
2015_CTI_IS-Internet-Development_Module-Description_Final
2015_CTI_IS-Internet-Development_Module-Description_Final2015_CTI_IS-Internet-Development_Module-Description_Final
2015_CTI_IS-Internet-Development_Module-Description_Final
 
DP PPTS by BK.pptx
DP PPTS by BK.pptxDP PPTS by BK.pptx
DP PPTS by BK.pptx
 
010821+presentation+oti.ppt
010821+presentation+oti.ppt010821+presentation+oti.ppt
010821+presentation+oti.ppt
 
Modest Formalization of Software Design Patterns
Modest Formalization of Software Design PatternsModest Formalization of Software Design Patterns
Modest Formalization of Software Design Patterns
 

Mehr von Sue Sentance

Primm and Classroom Talk Sue Sentance Nov 2020 pdf
Primm and Classroom Talk  Sue Sentance Nov 2020 pdfPrimm and Classroom Talk  Sue Sentance Nov 2020 pdf
Primm and Classroom Talk Sue Sentance Nov 2020 pdfSue Sentance
 
Westiminster EForum 15 December 2020 Sentance
Westiminster EForum 15 December 2020 SentanceWestiminster EForum 15 December 2020 Sentance
Westiminster EForum 15 December 2020 SentanceSue Sentance
 
WiPSCE Keynote 2019 Sue Sentance
WiPSCE Keynote 2019 Sue SentanceWiPSCE Keynote 2019 Sue Sentance
WiPSCE Keynote 2019 Sue SentanceSue Sentance
 
Teacher toolkit Pycon UK Sept 2018
Teacher toolkit Pycon UK Sept 2018Teacher toolkit Pycon UK Sept 2018
Teacher toolkit Pycon UK Sept 2018Sue Sentance
 
Recent developments in CS education research Jul 18
Recent developments in CS education research Jul 18Recent developments in CS education research Jul 18
Recent developments in CS education research Jul 18Sue Sentance
 
SS CAS London Royal Society Report Summary
SS CAS London Royal Society Report SummarySS CAS London Royal Society Report Summary
SS CAS London Royal Society Report SummarySue Sentance
 
The computing revolution in England November 2015
The computing revolution in England November 2015The computing revolution in England November 2015
The computing revolution in England November 2015Sue Sentance
 

Mehr von Sue Sentance (7)

Primm and Classroom Talk Sue Sentance Nov 2020 pdf
Primm and Classroom Talk  Sue Sentance Nov 2020 pdfPrimm and Classroom Talk  Sue Sentance Nov 2020 pdf
Primm and Classroom Talk Sue Sentance Nov 2020 pdf
 
Westiminster EForum 15 December 2020 Sentance
Westiminster EForum 15 December 2020 SentanceWestiminster EForum 15 December 2020 Sentance
Westiminster EForum 15 December 2020 Sentance
 
WiPSCE Keynote 2019 Sue Sentance
WiPSCE Keynote 2019 Sue SentanceWiPSCE Keynote 2019 Sue Sentance
WiPSCE Keynote 2019 Sue Sentance
 
Teacher toolkit Pycon UK Sept 2018
Teacher toolkit Pycon UK Sept 2018Teacher toolkit Pycon UK Sept 2018
Teacher toolkit Pycon UK Sept 2018
 
Recent developments in CS education research Jul 18
Recent developments in CS education research Jul 18Recent developments in CS education research Jul 18
Recent developments in CS education research Jul 18
 
SS CAS London Royal Society Report Summary
SS CAS London Royal Society Report SummarySS CAS London Royal Society Report Summary
SS CAS London Royal Society Report Summary
 
The computing revolution in England November 2015
The computing revolution in England November 2015The computing revolution in England November 2015
The computing revolution in England November 2015
 

Kürzlich hochgeladen

4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 

Kürzlich hochgeladen (20)

YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 

The I in PRIMM - Code Comprehension and Questioning

  • 1. The I in PRIMM Code comprehension and questioning Dr Sue Sentance 29th February 2020 @suesentance CAS London Conference 2020
  • 2. Objectives of this session - To briefly outline the PRIMM methodology and point to some resources - To introduce the Block Model as a way of thinking about programming at different levels - How we can use questioning and targeted tasks to support comprehension of program code - To share some potential tasks around code comprehension that you could use on Monday!
  • 3. What can cause learners to struggle with programming tasks? Challenges faced Possible reasons … Perception of programming as hard – challenges resilience and self-efficacy Programs usually don’t work until many iterations have passed There is a “hard” myth (or is it a myth) Belief in geek gene Use of “adult” teaching approaches A working program does not equate to understanding of programming concepts Too much copying of code without understanding High cognitive load involved in programming Focus on product rather than process Students have misconceptions & incorrect mental model Many misconceptions are known but this has not transferred into teacher training Teachers have fragile knowledge & misconceptions too
  • 4. Programming pedagogy & PRIMM Some examples: • Pair programming (Williams & Kessler, 2002) • Worked examples (Morrison, Margulieux & Guzdial, 2015) • Peer instruction (Porter et al, 2011) • Live coding/ modelling (Rubin, 2013) • Tracing/ reading code (Lister, many) • Use-modify-create (Lee et al, 2011) • Stepwise explanations (Wirth, 2001) In this context, PRIMM is one approach to use for programming pedagogy Specifically it is designed to: 1) Help teachers structure lessons 2) Reflect on the teaching process 3) Cater for varying needs
  • 5. The PRIMM approach • Predict – given a working program, talk about it in pairs or groups. What do you think it will do? • Run – run it and test your prediction • Investigate – get into the nitty gritty. What does each line of code mean? Lots of activities to try here: trace, annotate, explain, talk about, identify parts, etc…. • Modify – edit the program to make it do different things • Make – design a new program that uses the same nitty gritty but that solves a new problem
  • 6. Look at this Python (turtle) code Discuss with the person next to you Draw the output What discussions did you have? Did you help each other? What did you learn? An activity for you – you will need a piece of paper and a companion
  • 7. Now imagine you could run the program This is what would actually be output Did you get it right? If not, what is different about your answer?
  • 9. PRIMM Examples Predict Run Investigate Modify Make Keep starter programs on a shared drive Students should download, check what they do and compare with prediction
  • 13. PRIMM Examples Predict Run Investigate Modify Make Improve the pizza program so that it doesn’t print out “and X” at the end. You will have to add an “if” statement to do this. Modify the program to have a conversation with somebody about sport. An example is given below but you can add your own questions. Change your triangle function so that it uses a for loop Write a function pentagon() to create a pentagon (5 sides) with sides length 200 Write a function hexagon() to create a blue hexagon (6 sides) with sides length 50
  • 15. Focusing in on Investigate What are good questions to ask? Here are two programs (they do the same thing – just choose the language you prefer!) What questions might you ask learners to help you gauge their understanding?
  • 16. Activity 1: Asking questions Two versions of the same program In pairs or threes, think about some good “Investigate” questions you could ask pupils to see if they understood the code – and to prepare them to write something similar
  • 18. Why focus on code comprehension? • Being able to read and understand code greatly increases your ability to write code (proven by research) • Talking about the program means you need the words to label the various parts – so improves program terminology – the teacher can help here • The goal of program comprehension is to allow the beginner programmer to construct their own mental model. But how do we know if we are asking the right questions? And if the pupils can’t answer what does that tell us?
  • 19. Enter …. The Block Model
  • 20. What if we could classify tasks and questions? What is … ? How would you …? Can you spot the …? Show me a … ? What does … do? Granularity of piece of program code Structure ---> Function of program
  • 21. (M) Macro structure Understanding the overall structure of the program text Understanding the algorithm underlying a program Understanding the goal/purpose of the program in the current context (R) Relationships Relationships between blocks Sequence of function calls, object sequence diagrams Understanding how sub goals are related to goals (B) Blocks Regions of interest that build a unit (syntactically or semantically) Operation of a block or function. Understanding of the function of a block of code. (A) Atoms Language elements Operation of a statement. Function of a statement. (T) Text Surface (P) Program Execution (F) Function Architecture/ Structure Relevance /Intention The Block Model
  • 22. (M) Macro structure (R) Relationships (B) Blocks (A) Atoms Identify the keywords in a piece of code (T) Text Surface (P) Program Execution (F) Function Architecture/ Structure Relevance /Intention The Block Model When a student really understands the program code they should be able to answer questions in every area of the Block Model
  • 23. (M) Macro structure What does this program do? (R) Relationships (B) Blocks (A) Atoms Identify the keywords in a piece of code (T) Text Surface (P) Program Execution (F) Function Architecture/ Structure Relevance /Intention The Block Model When a student really understands the program code they should be able to answer questions in every area of the Block Model
  • 24. Activity 2: Types of questions/tasks In pairs or threes …. Look at the list of possible tasks/questions around code comprehension Where might they fit on the Block Model? Example
  • 25. (M) Macro structure Annotate the whole program showing where functions are called and defined. What set of inputs could be used to check all routes/flows through the program Summarise what the program does (R) Relationships Identify the scope of a variable Identify which branch of an if statement will never be executed Identify two blocks of code which will produce the same outputs (B) Blocks Draw a block around an if statement Solve a Parson’s Problem Give an appropriate name to a block of code or function (A) Atoms List all the integer variables Trace a value through the program code Identify the purpose of a single statement Answer (T) Text Surface (P) Program Execution (F) Function Architecture/ Structure Relevance /Intention The Block Model
  • 26. (M) Macro structure ✓ ✓ ✓ (R) Relationships ✓ ✓ ✓ (B) Blocks ✓ ✓ ✓ (A) Atoms ✓ ✓ ✓ Answer (T) Text Surface (P) Program Execution (F) Function Architecture/ Structure Relevance /Intention The Block Model Carla Mia
  • 27. (M) Macro structure X ✓ ✓ (R) Relationships ✓ ✓ ✓ (B) Blocks ✓ X X (A) Atoms ✓ X ✓ Answer (T) Text Surface (P) Program Execution (F) Function Architecture/ Structure Relevance /Intention The Block Model Carla “Novice programmers’ early comprehension models can be characterized by a pattern of “holey knowledge”(i.e. an incomplete patchwork of fabric, with empty cells and missing stuffing)” (Schulte et al, 2010)
  • 28. Why is it important to ask different types of questions about the code? The Holey Quilt (gaps in knowledge) “Novice programmers’ early comprehension models can be characterized by a pattern of “holey knowledge”(i.e. an incomplete patchwork of fabric, with empty cells and missing stuffing)” (Schulte et al, 2010)
  • 29. The programming “mental model” Includes: - Elements and structure of the program - Execution behaviour of the program - Purpose of the whole program - Purpose of individual blocks How is the mental model developed? One view …. Social plane Cognitive plane (Vygotsky)
  • 30. Activity 3: Revisiting activity 1 Now look back at the program we looked at earlier You thought of some questions Where are these in the Block Model? Discuss …. Which tasks and questions are easier to answer than others?
  • 31. How to progress through different questions and tasks?
  • 32. (M) Macro structure Understanding the overall structure of the program text Understanding the algorithm underlying a program Understanding the goal/purpose of the program in the current context (R) Relationships Relationships between blocks Sequence of function calls, object sequence diagrams Understanding how sub goals are related to goals (B) Blocks Regions of interest that build a unit (syntactically or semantically) Operation of a block or function. Understanding of the function of a block of code. (A) Atoms Language elements Operation of a statement. Function of a statement. (T) Text Surface (P) Program Execution (F) Function Architecture/ Structure Relevance /Intention The Block Model What about progression through the types of tasks? ?
  • 33. What does the program do? “One interesting observation is that students often have difficulties explaining the purpose of the whole program (MF), and if asked to describe the code goal, they explain the execution of the program (P) and often step-by-step.” (Izu et al, 2020). In PRIMM we start with predicting the purpose of a small block of code. This serves as a reminder that this is not easy for students, and so simple, short extracts of code should be used. The goal of predict is to get students used to thinking about why programs are there and to focus on function first.
  • 34. Try it out with your classes Try to ask different questions about programs in your class Which types of question are most difficult/ easy? Where is the progression? Where can we uncover misconceptions? Try out in your class. Do share any insights with me. This work is ongoing research. More details will appear at http://primming.wordpress.com
  • 35. PRIMM Resources http://primming.wordpress.com Materials here that were used for the two research studies – and in time we hope to upload teachers’ contributions from their own PRIMM resources If you have PRIMM resources please share with me!
  • 36. Summary - A brief introduction to PRIMM - The importance of understanding program code - The Block Model for code comprehension - Some tasks and questions to use in class - Remember the holey quilt! Further reading (if you like depth) Izu et al (2019). Fostering Program Comprehension in Novice Programmers-Learning Activities and Learning Trajectories. In Proceedings of the Working Group Reports on Innovation and Technology in Computer Science Education (pp. 27-52). Sentance, S., Waite, J., & Kallia, M. (2019). Teaching computer programming with PRIMM: a sociocultural perspective. Computer Science Education, 29(2-3), 136-176. Further browsing http://primming.wordpress.com Thanks for participating Contact me at sue@raspberrypi.org or sue.sentance@kcl.ac.uk @suesentance