Lec 7-8
Lec 7-8
Software
Dr. Lamia Abo Zaid
Evolution ﻟﻣﯾﺎء أﺑوزﯾد. د
[email protected]
Identifying the goal can help in defining the scope of program comprehension.
Program Comprehension - Knowledge
Two kinds of knowledge: General knowledge and Software-specific knowledge
General knowledge covers a broad range of topics in computer systems and
software, such as :
Algorithms and data structures
Programming principles and Programming languages
Software architecture and design
Testing and debugging techniques
Program Comprehension - Knowledge
Software-specific knowledge represents a detailed understanding of the software
to be modified.
Some examples of software-specific knowledge are
The software system has implemented public-key cryptography for data encryption.
A certain for loop in method y may execute for a random number of times.
Text-structures Chunking
Chunks Cross-referencing
Schemas Strategies
Plans
Hypotheses
Mental Model – Text Structures
Text-structures denote code and its structure, It is useful in gaining control flow
knowledge in program understanding.
The following text-structures can be identified :
Loop constructs: for, while, and until
Sequences
Programming plans differ in their granularities to support low level or high level tasks.
Mental Model - Hypotheses
Programmers can test the results of their understanding as hypotheses or conjectures
Why: Why conjectures hypothesize the purpose of a program element.
□ Verification of a why conjecture enables a programmer to have a good understanding of the
program element.
How: How conjectures hypothesize the method for realizing a program goal.
□ Given a program goal, the programmer needs to know how that goal has been implemented.
Understanding If
statement then the
while loop enables to
create an abstraction
Approaches to Code Comprehension -
Opportunistic Approach
Opportunistic Approach is a hybrid of the two
1. Begin with top-down, gain an overview of the functions of the program
2. Then selectively apply bottom-up strategies when nearing “code level”
to verify hypotheses resulting from top-down reading
?
Readings
Chapter 8: 8.1, 8.2 , 8.3
Assignment 2
Why do we study maintenance models in your opnion
What is the quick fix model? What advice would you give when using it?