SlideShare a Scribd company logo
1 of 19
Program Comprehension:
Past, Present, and Future
Janet Siegmund
Program Comprehension in the Past
Programming in the past?
2Janet Siegmund Program Comprehension
Higher-Level Programming Languages
Soloway & Ehrlich, 1984: Empirical Studies of Programming Knowledge
3Janet Siegmund Program Comprehension
Measuring Program Comprehension
For… that‘s a
loop… i = 1..2…3
?
Fill in the blank
Memorization
4Janet Siegmund Program Comprehension
Return Value of b
5
It should compute the
median
Case for the odd array
That‘s the list of numbers…
b should be 4.5
Case for the even array
public static void main(String [] args) {
int [] data = {1, 2, 4, 5, 6, 10};
computeMedian(data);
}
public int computeMedian(int[] data) {
int[] data = data;
sort(data);
float b;
if (data.length % 2 == 1)
b = data[data.length / 2];
else
b = ((float) data[data.length / 2 - 1] +
(float) data[data.length / 2]) / 2;
return (b);
}
Janet Siegmund Program Comprehension
Bottom-up comprehension
6
public static void main(String [] args) {
int [] data = {1, 2, 4, 5, 6, 10};
(data);
}
public int (int[] data) {
int[] data = data;
sort(data);
float b;
if (data.length % 2 == 1)
b = data[data.length / 2];
else
b = ((float) data[data.length / 2 - 1] +
(float) data[data.length / 2]) / 2;
return (b);
}
Weird variable naming
Check for odd array length…
does not apply here
Even array… get entries at
half the length… 4 and 5…
sum and divde by 2… 4.5
it‘s the median
elephant
elephant
Janet Siegmund Program Comprehension
• How does this help us to
understand the
programmer of today?
• A little:
– Useful variable names
– Code layout
– Tool support
public int enterprise (int[] kirk) {
int[] data = kirk;
sort(data);
float picard;
if (data.length % 2 == 1)
picard = data[data.length / 2];
else
picard = ((float) data[data.length / 2 - 1] +
(float) data[data.length / 2]) / 2;
return (picard);
}
Present
7Janet Siegmund Program Comprehension
Why Did Research on
Program Comprehension Stop?
What is more productive to use, a statically or
dynamically typed language?
8Janet Siegmund Program Comprehension
In the wild (realistic) In the lab (controlled)
Maximize
internal validity
Reliably explains
the causes of effects
Hard to generalize
Maximize
external validity
Reveals generally
occurring effects
Causes of effects unclear
A fundamental
tradeoff!
9Janet Siegmund Program Comprehension
Neuro-Imaging Methods
Electroencephalography (EEG)
Higher cognitive load during programming
task is reflected in the EEG signal
10Janet Siegmund Program Comprehension
Functional Magnetic Resonance
Imaging
Mirror
Screen
Head coil
MRI scanner
11Janet Siegmund Program Comprehension
public static void main(String[] args) {
int[] array = {1, 2, 4, 5, 6, 10};
sort(array);
float b;
if (array.length % 2 == 1)
b = array[array.length / 2];
else
b = ((float)array[array.length / 2 - 1] +
(float)array[array.length / 2]) /
2;
System.out.println(b);
}
public static void main(String[] args) {
int[] array = {1, 6, 4};
for (int i = 0; i <= array.length / 2 - 1; i++){
int tmp = array[array.length - i - 1];
array[array.length - i - 1] = array[i];
array[i] = tmp;
}
for (int i = 0; i <= array.length - 1; i++) {
System.out.println(array[i]);
}
}
public static void main(String[] args) {
String word = "Hello";
String result = new String();
for (int j = word.length() - 1; j >= 0; j--)
result = result + word.charAt(j);
System.out.println(result);
}
Source-Code Snippets
12Janet Siegmund Program Comprehension
13
BA21BA47Language processing:
• Natural and artifical
• Semantic processing at word level
• Combinatorial aspects
VXVS
VXXXS
Adhering to grammar?
TPTXVS
TPTPS
Results
Janet Siegmund Program Comprehension
14
BA21
Raven‘s Progressive Matrices
Problem solving
Divided attention
Silent word reading
Working memory
Results
Janet Siegmund Program Comprehension
Concentration
15
: The Default Network
Janet Siegmund Program Comprehension
Result
16
Posterior cingulate
cortex (BA31post)
Posterior cingulate
cortex (BA31ant)
Prefrontal midline
area (BA32)
Neuro-imaging
methods provide
interesting new
insights into
developer‘s heads
Janet Siegmund Program Comprehension
Perspective: Teaching
17
Object-oriented
programming?
Functional
programming?
How should we teach
beginning programmers?
Janet Siegmund The Human Factor in Computer Science
Language Skills?
Future
18Janet Siegmund Program Comprehension
19Janet Siegmund Program Comprehension

More Related Content

Similar to Program Comprehension: Past, Present, Future

First Experiences with Parallel Application Development in Fortran 2018
First Experiences with Parallel Application Development in Fortran 2018First Experiences with Parallel Application Development in Fortran 2018
First Experiences with Parallel Application Development in Fortran 2018inside-BigData.com
 
The Erlang Programming Language
The Erlang Programming LanguageThe Erlang Programming Language
The Erlang Programming LanguageDennis Byrne
 
[計一] Basic r programming final0918
[計一] Basic r programming   final0918[計一] Basic r programming   final0918
[計一] Basic r programming final0918Yen_CY
 
[計一] Basic r programming final0918
[計一] Basic r programming   final0918[計一] Basic r programming   final0918
[計一] Basic r programming final0918Chia-Yi Yen
 
ma project
ma projectma project
ma projectAisu
 
Towards Exascale Computing with Fortran 2015
Towards Exascale Computing with Fortran 2015Towards Exascale Computing with Fortran 2015
Towards Exascale Computing with Fortran 2015inside-BigData.com
 
Unit1 jwfiles
Unit1 jwfilesUnit1 jwfiles
Unit1 jwfilesmrecedu
 
IRJET- Emotion Recognition using Facial Expression
IRJET-  	  Emotion Recognition using Facial ExpressionIRJET-  	  Emotion Recognition using Facial Expression
IRJET- Emotion Recognition using Facial ExpressionIRJET Journal
 
E2 – Fundamentals, Functions & ArraysPlease refer to announcements.docx
E2 – Fundamentals, Functions & ArraysPlease refer to announcements.docxE2 – Fundamentals, Functions & ArraysPlease refer to announcements.docx
E2 – Fundamentals, Functions & ArraysPlease refer to announcements.docxshandicollingwood
 
E2 – Fundamentals, Functions & ArraysPlease refer to announcemen.docx
E2 – Fundamentals, Functions & ArraysPlease refer to announcemen.docxE2 – Fundamentals, Functions & ArraysPlease refer to announcemen.docx
E2 – Fundamentals, Functions & ArraysPlease refer to announcemen.docxjacksnathalie
 
OWF12/PAUG Conf Days Pro guard optimizer and obfuscator for android, eric l...
OWF12/PAUG Conf Days Pro guard   optimizer and obfuscator for android, eric l...OWF12/PAUG Conf Days Pro guard   optimizer and obfuscator for android, eric l...
OWF12/PAUG Conf Days Pro guard optimizer and obfuscator for android, eric l...Paris Open Source Summit
 
12.節能人因管理:人員數量估計管理系統 鄧有光
12.節能人因管理:人員數量估計管理系統 鄧有光12.節能人因管理:人員數量估計管理系統 鄧有光
12.節能人因管理:人員數量估計管理系統 鄧有光Zih-Ming Yang
 
From programming to software engineering: ICSE keynote slides available
From programming to software engineering: ICSE keynote slides availableFrom programming to software engineering: ICSE keynote slides available
From programming to software engineering: ICSE keynote slides availableCelso Martins
 
Java Question-Bank-Class-8.pdf
Java Question-Bank-Class-8.pdfJava Question-Bank-Class-8.pdf
Java Question-Bank-Class-8.pdfAditya Kumar
 
Computer graphics
Computer graphicsComputer graphics
Computer graphicsamitsarda3
 
Python week 2 2019 2020 for g10 by eng.osama ghandour
Python week 2 2019 2020 for g10 by eng.osama ghandourPython week 2 2019 2020 for g10 by eng.osama ghandour
Python week 2 2019 2020 for g10 by eng.osama ghandourOsama Ghandour Geris
 
Pig: Data Analysis Tool in Cloud
Pig: Data Analysis Tool in Cloud Pig: Data Analysis Tool in Cloud
Pig: Data Analysis Tool in Cloud Jianfeng Zhang
 

Similar to Program Comprehension: Past, Present, Future (20)

First Experiences with Parallel Application Development in Fortran 2018
First Experiences with Parallel Application Development in Fortran 2018First Experiences with Parallel Application Development in Fortran 2018
First Experiences with Parallel Application Development in Fortran 2018
 
The Erlang Programming Language
The Erlang Programming LanguageThe Erlang Programming Language
The Erlang Programming Language
 
[計一] Basic r programming final0918
[計一] Basic r programming   final0918[計一] Basic r programming   final0918
[計一] Basic r programming final0918
 
[計一] Basic r programming final0918
[計一] Basic r programming   final0918[計一] Basic r programming   final0918
[計一] Basic r programming final0918
 
ma project
ma projectma project
ma project
 
Towards Exascale Computing with Fortran 2015
Towards Exascale Computing with Fortran 2015Towards Exascale Computing with Fortran 2015
Towards Exascale Computing with Fortran 2015
 
C Language Unit-1
C Language Unit-1C Language Unit-1
C Language Unit-1
 
Unit1 jwfiles
Unit1 jwfilesUnit1 jwfiles
Unit1 jwfiles
 
IRJET- Emotion Recognition using Facial Expression
IRJET-  	  Emotion Recognition using Facial ExpressionIRJET-  	  Emotion Recognition using Facial Expression
IRJET- Emotion Recognition using Facial Expression
 
E2 – Fundamentals, Functions & ArraysPlease refer to announcements.docx
E2 – Fundamentals, Functions & ArraysPlease refer to announcements.docxE2 – Fundamentals, Functions & ArraysPlease refer to announcements.docx
E2 – Fundamentals, Functions & ArraysPlease refer to announcements.docx
 
E2 – Fundamentals, Functions & ArraysPlease refer to announcemen.docx
E2 – Fundamentals, Functions & ArraysPlease refer to announcemen.docxE2 – Fundamentals, Functions & ArraysPlease refer to announcemen.docx
E2 – Fundamentals, Functions & ArraysPlease refer to announcemen.docx
 
OWF12/PAUG Conf Days Pro guard optimizer and obfuscator for android, eric l...
OWF12/PAUG Conf Days Pro guard   optimizer and obfuscator for android, eric l...OWF12/PAUG Conf Days Pro guard   optimizer and obfuscator for android, eric l...
OWF12/PAUG Conf Days Pro guard optimizer and obfuscator for android, eric l...
 
12.節能人因管理:人員數量估計管理系統 鄧有光
12.節能人因管理:人員數量估計管理系統 鄧有光12.節能人因管理:人員數量估計管理系統 鄧有光
12.節能人因管理:人員數量估計管理系統 鄧有光
 
From programming to software engineering: ICSE keynote slides available
From programming to software engineering: ICSE keynote slides availableFrom programming to software engineering: ICSE keynote slides available
From programming to software engineering: ICSE keynote slides available
 
Java Question-Bank-Class-8.pdf
Java Question-Bank-Class-8.pdfJava Question-Bank-Class-8.pdf
Java Question-Bank-Class-8.pdf
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Ex1
Ex1Ex1
Ex1
 
Python week 2 2019 2020 for g10 by eng.osama ghandour
Python week 2 2019 2020 for g10 by eng.osama ghandourPython week 2 2019 2020 for g10 by eng.osama ghandour
Python week 2 2019 2020 for g10 by eng.osama ghandour
 
Pig: Data Analysis Tool in Cloud
Pig: Data Analysis Tool in Cloud Pig: Data Analysis Tool in Cloud
Pig: Data Analysis Tool in Cloud
 
lecture 5
 lecture 5 lecture 5
lecture 5
 

Recently uploaded

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 

Recently uploaded (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 

Program Comprehension: Past, Present, Future

  • 1. Program Comprehension: Past, Present, and Future Janet Siegmund
  • 2. Program Comprehension in the Past Programming in the past? 2Janet Siegmund Program Comprehension
  • 3. Higher-Level Programming Languages Soloway & Ehrlich, 1984: Empirical Studies of Programming Knowledge 3Janet Siegmund Program Comprehension
  • 4. Measuring Program Comprehension For… that‘s a loop… i = 1..2…3 ? Fill in the blank Memorization 4Janet Siegmund Program Comprehension
  • 5. Return Value of b 5 It should compute the median Case for the odd array That‘s the list of numbers… b should be 4.5 Case for the even array public static void main(String [] args) { int [] data = {1, 2, 4, 5, 6, 10}; computeMedian(data); } public int computeMedian(int[] data) { int[] data = data; sort(data); float b; if (data.length % 2 == 1) b = data[data.length / 2]; else b = ((float) data[data.length / 2 - 1] + (float) data[data.length / 2]) / 2; return (b); } Janet Siegmund Program Comprehension
  • 6. Bottom-up comprehension 6 public static void main(String [] args) { int [] data = {1, 2, 4, 5, 6, 10}; (data); } public int (int[] data) { int[] data = data; sort(data); float b; if (data.length % 2 == 1) b = data[data.length / 2]; else b = ((float) data[data.length / 2 - 1] + (float) data[data.length / 2]) / 2; return (b); } Weird variable naming Check for odd array length… does not apply here Even array… get entries at half the length… 4 and 5… sum and divde by 2… 4.5 it‘s the median elephant elephant Janet Siegmund Program Comprehension
  • 7. • How does this help us to understand the programmer of today? • A little: – Useful variable names – Code layout – Tool support public int enterprise (int[] kirk) { int[] data = kirk; sort(data); float picard; if (data.length % 2 == 1) picard = data[data.length / 2]; else picard = ((float) data[data.length / 2 - 1] + (float) data[data.length / 2]) / 2; return (picard); } Present 7Janet Siegmund Program Comprehension
  • 8. Why Did Research on Program Comprehension Stop? What is more productive to use, a statically or dynamically typed language? 8Janet Siegmund Program Comprehension
  • 9. In the wild (realistic) In the lab (controlled) Maximize internal validity Reliably explains the causes of effects Hard to generalize Maximize external validity Reveals generally occurring effects Causes of effects unclear A fundamental tradeoff! 9Janet Siegmund Program Comprehension
  • 10. Neuro-Imaging Methods Electroencephalography (EEG) Higher cognitive load during programming task is reflected in the EEG signal 10Janet Siegmund Program Comprehension
  • 11. Functional Magnetic Resonance Imaging Mirror Screen Head coil MRI scanner 11Janet Siegmund Program Comprehension
  • 12. public static void main(String[] args) { int[] array = {1, 2, 4, 5, 6, 10}; sort(array); float b; if (array.length % 2 == 1) b = array[array.length / 2]; else b = ((float)array[array.length / 2 - 1] + (float)array[array.length / 2]) / 2; System.out.println(b); } public static void main(String[] args) { int[] array = {1, 6, 4}; for (int i = 0; i <= array.length / 2 - 1; i++){ int tmp = array[array.length - i - 1]; array[array.length - i - 1] = array[i]; array[i] = tmp; } for (int i = 0; i <= array.length - 1; i++) { System.out.println(array[i]); } } public static void main(String[] args) { String word = "Hello"; String result = new String(); for (int j = word.length() - 1; j >= 0; j--) result = result + word.charAt(j); System.out.println(result); } Source-Code Snippets 12Janet Siegmund Program Comprehension
  • 13. 13 BA21BA47Language processing: • Natural and artifical • Semantic processing at word level • Combinatorial aspects VXVS VXXXS Adhering to grammar? TPTXVS TPTPS Results Janet Siegmund Program Comprehension
  • 14. 14 BA21 Raven‘s Progressive Matrices Problem solving Divided attention Silent word reading Working memory Results Janet Siegmund Program Comprehension
  • 15. Concentration 15 : The Default Network Janet Siegmund Program Comprehension
  • 16. Result 16 Posterior cingulate cortex (BA31post) Posterior cingulate cortex (BA31ant) Prefrontal midline area (BA32) Neuro-imaging methods provide interesting new insights into developer‘s heads Janet Siegmund Program Comprehension
  • 17. Perspective: Teaching 17 Object-oriented programming? Functional programming? How should we teach beginning programmers? Janet Siegmund The Human Factor in Computer Science Language Skills?
  • 19. 19Janet Siegmund Program Comprehension

Editor's Notes

  1. Never found it so hard to perpare a presentation. The paper is intended more as an overview to get a first impression on program comprehension, something to look up. So I hope I won‘t be too boring now 
  2. So, what was programming in the past like? A few of you may have learned programming with these punched cards, or a few years later, with 0‘s and 1‘s I can hardly imagine how program-comprehension research took place, e.g., with think-aloud protocols: „I hope I don‘t drop this stack…“ „1000 1111“…. could not have been very informative to a researcher…  But it got better
  3. Higher-level programming languages were developed, and which such languages, research on program comprehension started. Here is source code from an experiment. What is it doing? Here is another piece. What is it doing? Who says it does the same? Who says it computes the minimum? Expert programmers are as slow and as incorrect as novice programmers, if conventions are violated, For example, that variables should be named according to their purpose
  4. Several ways to measure program comprehension: I can let people think aloud, so they say what they are thinking. Gives a good impression of the thought processes, but may be biased. Also a lot of effort, because data has to be recorded, transcribed, and analyzed. Give programmers a task (e.g., what is this source code doing) and record time and correctness: Correctness: Programmers must understand it to determine what source code is doing. No data on how they reached an understanding Time: the faster programmers understood it, the easier it was to comprehend, or the better they are at comprehension, or they have seen this source code before? or they just wanted to finish the experiment and did not try to understand it -> Most of the times in conjunction with correctness Often, correctness and time in conjunction, also as efficiency measures, but it is unclear what they mean. Fill-in-the-blank: Omit parts of the program and ask to complete missing information Recall: Ask participants to recall the program. Who wants to try?  Made more sense back then, because programs were not that prone to change. Shneiderman, musician and programmer
  5. I like you to take a few moments to determine what the return value of this method is Those of you who know what the median is used top-down comprehension: You stated the hypothesis that the method computeMedian returns the median, and then went through the source code to find proof for that hypothesis In this case, computeMedian was a beacon; it gave you a hint about the source code. However, when you are not familiar with the media, computeMedian is not helpful; you have to go through source code statement by statement. So, program comprehension is a complex process, and it depends on many factors, such as knowledge, programming experience, programming language To completely understand program comprehension, we need to measure it somehow;How can we measure program comprehension?
  6. I like you to take a few moments to determine what the return value of this method is Those of you who know what the median is used top-down comprehension: You stated the hypothesis that the method computeMedian returns the median, and then went through the source code to find proof for that hypothesis In this case, computeMedian was a beacon; it gave you a hint about the source code. However, when you are not familiar with the media, computeMedian is not helpful; you have to go through source code statement by statement. So, program comprehension is a complex process, and it depends on many factors, such as knowledge, programming experience, programming language To completely understand program comprehension, we need to measure it somehow;How can we measure program comprehension?
  7. We know that we need to have useful variable names. We can name variables like we please, but that‘s slows us down. And first-year programming students like to argue about that… Between 1995 and 2005, there was almost no research on program comprehension (and more general, the human factor in software engineering)
  8. To answer this question, I have a question for you. You want to evaluate whether … How would you proceed? There already are such experiments, maybe some of you know these. Many factors were controlled, e.g., own programming language and IDE, clearly defined task… Everything was exactly controlled for, only the type system was changed. I guess this part of the room would like the study. The remaining part would ask what we could do with these results.
  9. What you could imagine rather is a study in the wild, in the real world, companies, existing programming languages and projct sizes -> generalizability of results. However, the cause of an observed effect is unclear. You can also control everything (as best as you can) and exclude all confounding factors. Like the experiment that I described earlier. The pure effect of type systems, but in artificial conditions -> practical value?
  10. EEG: Measures activity of your neurons Typical responses, e.g., P300 -> positive peak after 300ms linked to attention, N100, negative peak after 100ms, indicating surprise different frequency ranges, e.g., alpha range 7.5–12.5 Hz; wakeful relaxation with closed eyes. Like some of you when I’m boring you… 
  11. However, from one source-code snippets, we cannot learn much -> so we need different, but similar source-code snippets
  12. Man könnte jetzt fragen: Haben die Probanden sich überhaupt auf die Aufgabe konzentriert?
  13. Wie kann man Konzentration an dem Aktivierungsmuster sehen? Vielleicht ist Ihnen schon mal aufgefallen, dass sie regelmäßig Tagträume haben, in denen sie sich vorstellen, wie sie gemütlich am Strand liegen und ein gutes Buch lesen oder mit ihren Kindern spielen. Solche Tagträume wurden auch mittels fMRT untersucht. Da hat sich eher zufällig gezeigt, dass wenn Probanden nichts zu tun hatten, dieses Netzwerk von Gebieten eine hohe Aktivierung zeigt. Als man die Probanden hinterher befragt hat, woran sie denn gedacht hätten, hatten sie gesagt, dass sie über sich selbst nachgedacht haben oder Tagträume hatten. Sobald eine konkrete Aufgabe ist, wird das Default Network deaktiviert, damit die Tagträumerei nicht mit der Aufgabe interagiert. Je komplexer die Aufgabe ist, desto stärker ist die Deaktivierung. D.h., man kann an der Deaktivierung des Default networks erkennen, wie sehr sich die Probanden konzentriert haben.
  14. Hier das Ergebnis: Blau bedeutet eine Deaktivierung. Und diese Gebiete zeigen signifikant geringere Aktivität, und die sind zentrale Bestandteile des Default Netzwerks; Probanden haben sich also wirklich konzentriert Bezug zu Softwaremaße: Stärke der Deaktivierung korreliert mit Werten für Softwaremaße pro Quelltext, aber nur für DepDegree. Deutet darauf hin, dass Datenfluss, wie es bei DepDegree operationalisiert ist, ein Maß für die notwendige Konzentration zum Verstehen von Quelltext darstellt.
  15. Arguments that people think in terms of objects Others say that functional programming is way better for programming Man kann nicht nur den Prozess des Verstehens genauer untersuchen, man kann sich auch andere Zusammenhänge anschauen.
  16. I give you some time to read So, this guy does not want to be disturbed. Not only because disturbance causes time, but also returning to the task takes time. -> You would want such a sign also when you are in the zone, but you do not know before whether you might get into the zone, but if you‘re in the zone and stop hanging up that sign, you are not in the zone anymore… Such a dilemma  This might change in the future.