0% found this document useful (0 votes)
13 views19 pages

Presentation Program Comprehension Strategies SRE

Uploaded by

Muneeb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views19 pages

Presentation Program Comprehension Strategies SRE

Uploaded by

Muneeb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Presentation

Name: Ali
Hassan(84),Abubaker(98),
Hashir(97),Adeel(100),Rao
Atif(85)
Group: 1
Sec: E2
Semester: 7th
Subject: Re-engineering
Topic: Program Comprehension
History of Program
Comprehension:
• Program comprehension began when developers realized they needed
to understand old software before making any changes or
improvements. In the 1980s, many companies had older software that
needed updates or fixes. To do this, developers had to carefully study
how the software worked.

• They discovered that understanding the software fully was the first step
before making changes. Over time, different strategies and tools were
created to make this process easier, especially for older and more
complicated programs. These methods are still used today to help
developers improve and maintain software systems.
Program Comprehension:
• Program comprehension is the process of understanding how a software
program works. It involves studying the program’s code, design, and
behavior.Developers need to understand the program before making any
changes, fixing issues, or adding new features. Without understanding
how the software works, it’s hard to improve or update it safely.
• When the software is old or its code is complex, program comprehension
becomes even more important. Developers first need to understand the
software’s functionality, then look at its internal structure and design. This
process helps developers modify the software efficiently, such as adding
new features, fixing bugs, or updating old technology.
Example:
Suppose a company has an old billing system that calculates customer bills. The
system has some errors, and the company wants to fix them and add new
features, like online payment.
Before making changes, the developers must understand:
How the system calculates bills.
What parts of the code handle customer details.
Where the errors are happening.
How the system can be updated without breaking anything.
The developers will study the code, read any documentation, and
test the system to understand how it works. Once they fully
understand it, they can safely fix the errors and add the new features.
.
program comprehension
strategies:
1. Top-Down Strategy:
The Top-Down Strategy is a program comprehension method where
developers first try to understand the overall system as a whole. Once
they understand the system’s purpose and how its major components
work together, they move to smaller parts, like individual modules or
functions, to study the details.

This strategy works well when documentation or high-level design


information is available.
Example:
Imagine a developer needs to understand an old online
shopping system.
Step 1 (Big Picture):
The developer starts by understanding the system’s
overall purpose:
Customers browse products.
They add items to the cart.
They make payments and receive order confirmation.
Step 2 (Main Parts):
Next, the developer looks at the system’s main parts:
The product list.
The shopping cart.
The payment system.

Step 3 (Details):
Finally, the developer checks the smaller details, like how the cart
calculates the total cost or how payment is processed.
Example: Website creat...
 You are building a new website with a login system, user
dashboard, and user profile management.

Start: First, you understand the overall design of the system.


You look at how the login page, dashboard, and profile page
will work together.
Next: You study the website’s design to see how the pages
are connected, then focus on the code for the login form and
user authentication.
2. Bottom-Up Strategy:
The Bottom-Up Strategy is a method where developers start
by understanding small parts of the program, like individual
functions or modules. Once they understand these small
parts, they combine them to understand the entire system.
This approach is helpful when there is no documentation or
when the code is very complex.
Example of Bottom-Up
Strategy:
Imagine a developer is trying to understand an online banking system:
Step 1 (Small Parts):
The developer first studies small pieces of the program, like:
A function that calculates how much money is left in an account.
A module that handle users to login.
Step 2 (Combine Knowledge):
After understanding these small parts, the developer learns how they work
together:
How the login module connects to the account details page.
How the balance calculation shows the correct amount to the user.
Step 3 (Big Picture):Finally, the developer uses this knowledge to understand the
entire online banking system and how all the parts work together.
3. Code Reading
 Developers read the code line by line to understand its logic.
Strategies for Code Reading:
Top-Down Approach:

Start by looking at the bigger picture of how the program works.


Focus on understanding the main parts of the program before going
into the details.
Bottom-Up Approach:

Start with small parts of the code, like individual functions.


Slowly put these pieces together to understand the whole program.
Incremental Reading:

Read small sections of the code one by one.


Try to understand each part before moving on to the next.
Recognizing Patterns:
Learn to spot common patterns in the code, like loops or conditions.
These patterns help you understand what the code is doing more
easily.
Using Comments and
Documentation:

Look for comments in the code that explain what’s happening.


Comments make it easier to understand complex code.
Refactoring for Clarity:
Sometimes, code is hard to read, so it might need to be changed to
make it clearer.
Refactoring helps make the code easier to understand.
Why It’s Important:
 Fixing Problems: If developers understand the code, they can find and
fix errors more easily.
 Working Together: When developers work in teams, they need to
read each other’s code to collaborate.
 Improving Quality: Good code reading helps make the software work
better and be easier to maintain.
4. Documentation Review:
 Documentation review means reading the documents about the
software to understand how it works. These documents can be
manuals, user guides, design diagrams, or code comments.
documentation review strategies are methods used to ensure that
the project's documents (like code, specifications, designs, etc.) are
correct, clear, and meet the required standard
Why It’s Important:
Improves Code Quality
Good documentation helps developers write better, cleaner code
because it encourages them to explain their thinking and logic.
Helps New Team Members
When new developers join the project, documentation helps them
quickly get up to speed with how the code is structured and what it
does.
Reduces Errors
Good documentation can help identify mistakes in the code early,
preventing confusion and bugs later on.
Improves Code Maintenance:
Clear documentation makes it easier for developers to maintain,
update, or modify the code, especially if the original developer is
unavailable.
Makes Code Easier to Understand
Reviewing the documentation helps developers quickly know what
the code does without reading everything.
Makes Code Easier to Fix or Change
Clear documentation makes it easier to update or fix the code, even if
the original developer is not around.
The End

You might also like