SlideShare a Scribd company logo
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

PPTX
Defuzzification
PPTX
Dynamic Programming
DOC
352735340 rsh-qam11-tif-12-doc
PPTX
Algorithm1
PDF
2012 icse program comprehension
PDF
Martin Chapman: Research Overview, 2017
PPS
Learn C
Defuzzification
Dynamic Programming
352735340 rsh-qam11-tif-12-doc
Algorithm1
2012 icse program comprehension
Martin Chapman: Research Overview, 2017
Learn C

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

PDF
First Experiences with Parallel Application Development in Fortran 2018
PPT
The Erlang Programming Language
PDF
[計一] Basic r programming final0918
PDF
[計一] Basic r programming final0918
PPT
ma project
PDF
Towards Exascale Computing with Fortran 2015
PPT
C Language Unit-1
PPT
Software Engineering Systems Designing end to end
PPT
Unit1 jwfiles
PDF
IRJET- Emotion Recognition using Facial Expression
DOCX
E2 – Fundamentals, Functions & ArraysPlease refer to announcements.docx
DOCX
E2 – Fundamentals, Functions & ArraysPlease refer to announcemen.docx
PDF
OWF12/PAUG Conf Days Pro guard optimizer and obfuscator for android, eric l...
PPT
12.節能人因管理:人員數量估計管理系統 鄧有光
PDF
From programming to software engineering: ICSE keynote slides available
PDF
Deep Learning and details about how to pass that class.pdf -2.pdf
PDF
Java Question-Bank-Class-8.pdf
PPTX
arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
DOCX
Computer graphics
PPT
Ex1
First Experiences with Parallel Application Development in Fortran 2018
The Erlang Programming Language
[計一] Basic r programming final0918
[計一] Basic r programming final0918
ma project
Towards Exascale Computing with Fortran 2015
C Language Unit-1
Software Engineering Systems Designing end to end
Unit1 jwfiles
IRJET- Emotion Recognition using Facial Expression
E2 – Fundamentals, Functions & ArraysPlease refer to announcements.docx
E2 – Fundamentals, Functions & ArraysPlease refer to announcemen.docx
OWF12/PAUG Conf Days Pro guard optimizer and obfuscator for android, eric l...
12.節能人因管理:人員數量估計管理系統 鄧有光
From programming to software engineering: ICSE keynote slides available
Deep Learning and details about how to pass that class.pdf -2.pdf
Java Question-Bank-Class-8.pdf
arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Computer graphics
Ex1
Ad

Recently uploaded (20)

PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
PPTX
assetexplorer- product-overview - presentation
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
Download FL Studio Crack Latest version 2025 ?
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PPTX
history of c programming in notes for students .pptx
PDF
Design an Analysis of Algorithms II-SECS-1021-03
Weekly report ppt - harsh dattuprasad patel.pptx
assetexplorer- product-overview - presentation
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Designing Intelligence for the Shop Floor.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Advanced SystemCare Ultimate Crack + Portable (2025)
Odoo Companies in India – Driving Business Transformation.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Download FL Studio Crack Latest version 2025 ?
Salesforce Agentforce AI Implementation.pdf
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
Computer Software and OS of computer science of grade 11.pptx
Reimagine Home Health with the Power of Agentic AI​
17 Powerful Integrations Your Next-Gen MLM Software Needs
history of c programming in notes for students .pptx
Design an Analysis of Algorithms II-SECS-1021-03
Ad

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

  • #2: 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 
  • #3: 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
  • #4: 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
  • #5: 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
  • #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: 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?
  • #8: 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)
  • #9: 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.
  • #10: 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?
  • #11: 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… 
  • #13: However, from one source-code snippets, we cannot learn much -> so we need different, but similar source-code snippets
  • #15: Man könnte jetzt fragen: Haben die Probanden sich überhaupt auf die Aufgabe konzentriert?
  • #16: 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.
  • #17: 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.
  • #18: 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.
  • #19: 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.