C Programming Language CS11K - The University of the West Indies

advertisement
COMP6015
An
Introduction
to
Computer Programming
Lecture 08
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Customer sees an
Opportunity!!!
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
How the customer
explained it!
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
How the project leader
understood it!!!
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
How the analyst
designed it!!!
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
How the programmer
coded it!!!
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
How Marketing
described it!!!
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
How the project was
documented!!!
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
What operations
installed!!!
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
What the customer was
billed!!!
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
How it was supported!!!
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
What the customer
actually wanted!!!
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
A structured set of activities required to develop a
software system.
Activities include:
● Software
specification
● Software design and implementation
● Software integration and validation
● Software maintenance and evolution
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software specification:
The process of establishing what services are
required and the constraints on the system’s
operation and development.
Requirements engineering process
 Feasibility study;
 Requirements elicitation and analysis;
 Requirements specification;
 Requirements validation.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software specification: Specification documents
Must be:
 Clear
 Complete
 Correct
 Understood
by both the client as well as the
future design teams.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software specification: Specification documents
Must also clearly outline the constraints of the
proposed system including:
 Restrictions on hardware
 Portability
 Reliability
 Timing
 other resource usage issues.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software specification: Specification documents
Can be expressed:
● Informally
● Semi-formally
● Formally
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software specification: Specification documents
Informal Specification
Takes the form of natural language to express the specifications
in statements such as:
"If the total revenue generated from sales for the previous
quarter are higher then the total sales from the current
quarter then raise prices by 0.5%"
Despite best attempts at grammatical and linguistic exactitude,
informal specifications tend to be ambiguous, incomplete
and imprecise. Nevertheless this method is still very
popular and potential misunderstandings may be caught by
working closely with the client.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software specification: Specification documents
Semi-formal Specification
A variety of semi-formal techniques exist for writing
specifications, including : Data Flow Diagrams (DFDs)
 Entity-Relationship Modeling
A Data Flow Diagram is a pictorial representation of all aspects
of the logical data flows.
DFDs are developed using stepwise refinement techniques and
will go through a set of revisions/clarifications while they
are being developed.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software specification: Specification documents
Semi-formal Specification
Entity-Relationship Modeling
 Technique used to specify databases, relations and
processes.
 ERMs allow a range from very simple to very
complex relationships to be expressed.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software specification: Specification documents
Formal Specification

This includes the use of finite state machines, Petri
nets, formal specifications language languages.

Formal techniques require a higher level of
mathematical rigor than semi-formal techniques.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software specification: Pros & Cons of Techniques


Informal techniques are relatively easy to learn but
does not have the power, expressiveness and clarity
of semi-formal or formal techniques.
Formal techniques are powerful but are hard to
learn and use. The client may have difficulty in
understanding formal specifications.
Many times circumstances will dictate the technique that is
used. If no one is familiar with formal techniques then an
informal or semi-formal approach will have to be taken.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software design and implementation

Software design is a meaningful engineering
representation of some software product that is to be
built.

Design should be traced to the customer's
requirements and could be assessed for quality
against predefined criteria.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software design and implementation
In the software engineering context, design focuses
on four major areas of concern:
● Data
● Architecture
● Interfaces
● Components.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software design and implementation
Data

Created by transforming the analysis information
model (data dictionary and ERD) into data
structures required to implement the software.

Part of the data design may occur in conjunction
with the design of software architecture.

More detailed data design occurs as each software
component is designed.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software design and implementation
Architecture
Defines the relationships among the major structural
elements of the software, the “design patterns” and
can be used to achieve the requirements that have
been defined for the system, and the constraints that
affect the way in which the architectural patterns
can be applied.
It is derived from the system specification, the analysis
model, and the subsystem interactions defined in the
analysis model (DFD).
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software design and implementation
Interfaces
Describes how the software elements communicate
with each other, with other systems, and with
human users.
The data flow and control flow diagrams provide
much of the necessary information required.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software design and implementation
Components
Created by transforming the structural elements
defined by the software architecture into procedural
descriptions of software components using
information obtained from the process specification
(PSPEC), control specification (CSPEC), and state
transition diagram (STD).
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software design and implementation
The fundamental design concepts are:
 Abstraction - focus on solving a problem without being
concerned with lower level details.
 Refinement - provides successively more detail for each
design component.
 Modularity – understanding components independently of
one another.
 Software architecture - structure and conceptual integrity of
the software components.
 Control hierarchy or program structure - module
organization (control hierarchy; not concerned with
procedural aspects of software).
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software design and implementation
The fundamental design concepts are:




Structural partitioning – (Horizontal) define input, data
transformations, and output); (vertical) top-down
refinement
Data structure - logical relationship among individual data
elements
Software procedure - precise specification of processing
(event sequences, decision points, repetitive operations,
data organization/structure)
Information hiding – Modules’ need-to-know basis
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software design and implementation
Implementation
The process of translating the detailed design into code.


Generally done by teams all working at the same time on
different components of the product.
Major documentation provided in this stage is the source
code; however, the programmer should provide additional
documentation to assist in maintenance. This additional
documentation includes all test cases against which the code
should be tested, the expected results, and the actual output.
These documents will be used in regression testing.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software design and implementation: Implementation
Issues involved:
Choice of programming language



In many cases, there is no opportunity for choice because
either only one choice is available or management
stipulates that the product should be implemented in a
given language.
A cost-benefit analysis may be employed to decide on the
language. The language with the largest expected gain
would be the one selected.
A risk analysis may also be used to aid in the selection of
the language. The language with the smallest overall risk
is selected.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software design and implementation: Implementation
Issues involved:
The use of 4th generation languages (4GLs)




The ease of programming
The program is shorter, quicker to develop and easier to
maintain
There is a potential productivity gain
4GLs such as FoxPro and PowerHouse have case tool
features (e.g. automatic documentation) which aid in the
implementation process.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software design and implementation: Implementation
Issues involved:
Use of good programming practices
●
●
●
●
●
use of consistent and meaningful variable names
provision of proper documentation; both prologue and inline
comments
use of parameters (as opposed to constants)
well formatted source code to increase readability; good use of
blanks and indentation to highlight control structures.
Structured programming (i.e. modular programming) is also
advised to improve code quality, maintainability and decrease
the effort required for testing.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software
Development
Waterfall
Model
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Waterfall Model
Advantages
 Testing is inherent to every phase of the waterfall model
 It is an enforced disciplined approach
 It is documentation driven, that is, documentation is
produced at every stage
Disadvantages



Changes may cause considerable confusion as the project progresses.
As The client usually only has a vague idea of exactly what is required
from the software product, this WM has difficulty accommodating the
natural uncertainty that exists at the beginning of the project.
The customer only sees a working version of the product after it has been
coded. This may result in disaster if any undetected problems are
precipitated to this stage.
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Software Development
Incremental
Model
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Software Engineering
Incremental Model
Model combines the elements of the waterfall model with the
iterative philosophy of prototyping. However, unlike
prototyping the IM focuses on the delivery of an operational
product at the end of each increment.
Example of incremental approach:
Develop a Word Processor
1. Basic file management, editing and document production
functions.
2. Advanced editing and document production functions
3. Spell and grammar checking
4. Advance page layout
COMP6015 - An Introduction to Computer Programming : University of the West Indies
Download