1 2 Fundamentals - Construction
1 2 Fundamentals - Construction
SOFTWARE CONSTRUCTION
FUNDAMENTALS
Originally prepared by Dr. Ftoon Kedwan, and Adapted by Dr. Khaled Khankan
1
Objectives
2
Software Processes
A Software Process is:
A set of activities (e.g., requirements, analysis, design, coding, testing)
combined & sequenced in a particular fashion to produce software.
3
Software Construction - Overview
Design
Construction
Testing
4
Overview, Cont.
During construction:
• Detailed design might occur.
• Low-level (e.g., unit & module integration)
• Unit testing occurs
5
Software Construction Fundamentals
6
1- Minimizing Complexity
• As functionality increases, so does complexity.
8
3- Constructing for Verification
9
4- Standards in Construction
10
Construction Planning
11
Construction Planning
12
Construction Planning, Cont.
Improving Software Economics:
1. Size/Complexity
o Use an object-oriented approach.
o Focus on reuse.
o Look for opportunities to use commercial off-the-shelf (COTS) components.
2. Development Process
o Use an iterative approach.
o Improve the process maturity.
o Focus on architecture early in the life cycle.
3. People/Teams
o Provide appropriate training for development teams.
o Encourage teamwork.
o Create a win-win culture.
13
Construction Planning, Cont.
14
Construction Planning, Cont.
Choose Construction Practices
• Part of preparing for construction is deciding which of the available
practices will be emphasized.
More Questions:
o Have you defined how much design will be done up front & how much will
be done at the keyboard while code is being written?
o Have you defined specific coding practices that are implied by the
architecture, such as:
▪ How error conditions will be handled?
▪ How security will be addressed?
▪ What conventions will be used for class interfaces?
▪ What standards will apply to reused code?
▪ How much to consider performance while coding?
Choosing Tools
• Modern programming tools:
o Are essential to maintain programmer productivity.
o Reduce tedious & redundant tasks.
o Must be appropriate for the task at hand.
o Decrease the amount of time required for construction.
• Use of appropriate toolset (with the appropriate training) can increase productivity by
17
50% or more.
Code Design
18
Desirable Code Design Characteristics
• The following are desirable code design characteristics:
o Minimal complexity
o Ease of maintenance
o Loose coupling
o Extensibility
o Portability
o Standard techniques
• The more characteristics the detailed design team can employ, the better
the design will be.
19
Desirable Code Design Characteristics, Cont.
How to Overcome Complexity:
• “Separation of concerns” allows developers to focus on 1 bit of
complexity at a time.
20
Desirable Code Design Characteristics, Cont.
• Minimal Complexity:
o The primary goal of design should be to minimize complexity for all the reasons
provided earlier.
o Avoid making "clever" designs because they are usually hard to understand.
o Instead make "simple" & "easy-to-understand" designs.
o If your design doesn't let you safely ignore most other parts of the program
when you're immersed in 1 specific part, the design isn't doing its job.
• Ease of Maintenance:
o This means designing for the maintenance programmer.
o Use common programming constructs & consistent naming conventions.
o Continually imagine the questions a maintenance programmer would ask about
the code you're writing.
o Think of the maintenance programmer as your audience, & then design the
system to be self-explanatory.
21
Desirable Code Design Characteristics, Cont.
• Loose Coupling:
o Reduce interdependencies within the code.
o This means designing so that you hold connections among different parts of a
program to a minimum.
o Use the principles of good abstractions in class interfaces, encapsulation, &
information hiding to design classes with as few interconnections as possible.
o Minimal connectedness minimizes work during integration, testing, &
maintenance.
• Extensibility:
o Minimal ripple effect when changes are made.
o Extensibility means that you can enhance a system without causing violence to
the underlying structure.
o You can change a piece of a system without affecting other pieces.
o The most likely changes cause the system the least trauma.
o Ideally, changes will have minimal ripple effect & certainly won’t have tidal
wave effect.
22
Desirable Code Design Characteristics, Cont.
• Standard Techniques
o Stay with the “tried & true”.
o The more a system relies on exotic pieces, the more intimidating it is for
someone trying to understand it the first time.
o Try to give the whole system a familiar feeling by using standardized, common
approaches.
23
Levels of Code Design
As you know from SE 323, there are five levels of abstraction in software
design:
1. Level 1 – Software System*
2. Level 2 – Subsystems*
3. Level 3 – Classes**
4. Level 4 – Routines
5. Level 5 – Internal Routine Design
24
Code Design Techniques
25
SOFTWARE CONSTRUCTION
FUNDAMENTALS
Part II
Outline
28
Data Design and Management, Cont.
1. Conceptual
2. Logical
3. Physical
29
Debugging
Debugging:
The process of identifying the root cause of an error & correcting it.
How to debug?
o Learn in-depth how the program you are working on operates.
o Learn the kinds of mistakes you typically make.
o Learn how to solve software problems.
o Steps of code debugging are:
1. Gather data through repeatable experiments.
2. Form a hypothesis that accounts for as much of the relevant data as possible.
3. Design an experiment to prove or disprove the hypothesis.
4. Prove or disprove the hypothesis.
5. Repeat as needed.
30
Construction Quality Assurance (QA)
• Quality Attributes:
A requirement that specifies the degree of an attribute affecting qualities that the
software must possess. e.g., correctness, reliability, maintainability, portability.
31
Techniques for Improving Code Quality
• To improve the quality of the product you must improve the quality of the
process. Although it might seem that the best way to develop a high-quality
product would be to focus on the product itself, in software quality assurance the
best place to focus is on the process.
32
Construction Techniques
• The specific techniques selected depend on the nature of the software being
constructed, as well as on the skills set of the software engineers performing the
construction.
System Integration:
• The act of merging a software element or elements with another element.
• The act of merging a hardware component or components with another
hardware component.
• The act of merging software configuration items with hardware configuration
items in order to produce a total system which satisfies customer
requirements.
34
1. Big Bang Integration
35
2. Incremental Integration
3. Design, code, test, & debug another part (module, routine, etc.)
36
Software Deployment
• Deployment may be on a “try it & see basis” (called a beta test) or for
permanent installation.
37
Code Tuning
38
Code Tuning, Cont.
• Small parts of the program can take a disproportionate share of the run
time (80-20 rule).
39
Code Tuning, Cont.
In Summary:
1. Develop the software using a good design with highly modular code
that is easy to understand & modify.
Types of Documentation:
• Good documentation is a sign of professional pride put into a program by
the programmer (coder).
41
Approaches to Software
Development
Methodologies, Models, Tools, & Techniques
Methodologies
⚫ Provide guidelines for every facet of system development.
• What to do, when, why & how.
⚫ Specify a Software Development Life Cycle (SDLC) with activities & tasks.
• Specify project planning & project management models & reporting.
• Specify analysis & design models to create.
• Specify implementation & testing techniques.
• Specify deployment & support techniques.
A framework for the tasks that are required to build high-quality software:
Tools
Methods
Process Model
43
“Quality” Focus
Methodologies, Models, Tools, and Techniques
Model
⚫ An abstraction of an important aspect of the real world.
⚫ Makes it possible to understand a complex concept by focusing only
on a relevant part.
⚫ Each model shows a different aspect of the concept.
⚫ Crucial for communicating project information.
44
Methodologies, Models, Tools, &
Techniques
Tools
⚫ Software applications that assist developers in creating models or other
components required for a project.
45
Methodologies, Models, Tools, &
Techniques
Technique
⚫ A collection of guidelines that help an analyst complete an activity or task.
⚫ Learning techniques is the key to having expertise in a field.
Techniques Examples:
46
2 Approaches to Software Construction & Modeling
47
The Structured Approach
Structured Programming
➢ A program is called structured when it uses only the following types
of constructs:
⚫ Sequence: instructions are executed one after another.
⚫ Selection/decision: if-then-else
⚫ Iteration/repetition: do-while
49
Support Activities
50