Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 61

Chapter 7

Software
Engineering

© 2007 Pearson Addison-Wesley.


All rights reserved
Chapter 7: Software Engineering

• 7.1 The Software Engineering Discipline


• 7.2 The Software Life Cycle
• 7.3 Software Engineering Methodologies
• 7.4 Modularity
• 7.5 Tools of the Trade
• 7.6 Testing
• 7.7 Documentation
• 7.8 Software Ownership and Liability

© 2007 Pearson Addison-Wesley. All rights reserved 0-2


The Software Engineering Discipline

• The branch of computer science that seeks principles


to guide the development of large, complex software
systems.
• The problems faced are more than enlarged versions of
those problems
– efforts of more than one person
– over an extended period of time
– during which the requirements of the proposed system may
be altered
– the personnel assigned to the project may change.

© 2007 Pearson Addison-Wesley. All rights reserved 0-3


The Software Engineering Discipline

• Distinct from other engineering fields


– Prefabricated components
– Metrics

• Practitioners versus Theoreticians


• Professional Organizations: ACM, IEEE, etc.
– Codes of professional ethics
– Standards

© 2007 Pearson Addison-Wesley. All rights reserved 0-4


The Software Engineering Discipline

• Distinct from other engineering fields


– Prefabricated components, Automobile Example
• In the past, previously designed software components were domain
specific so, their use as generic components was limited.
• The result is that complex software systems have historically been
built from scratch.
• significant progress is being made in this regard, although more
work remains to be done
– Measuring Quantities / Metrics
• Cost, Complexity
• Quality, Mean time between the failures (Mechanical Devices)

© 2007 Pearson Addison-Wesley. All rights reserved 0-5


The Software Engineering Discipline

• Research in software engineering is currently


progressing on two levels
– Practitioners, work toward developing techniques for
immediate application.
– Theoreticians, search for underlying principles and theories
on which more stable techniques can someday be
constructed.

• The need for progress by both practitioners and


theoreticians is enormous.
© 2007 Pearson Addison-Wesley. All rights reserved 0-6
The Software Engineering Discipline

• Our society has become addicted to computer systems


and their associated software.
• Yet there continue to be major problems with the
reliability of these systems.

• Software errors have caused such disasters and near


disasters as being interpreted as a nuclear attack,
– a one day loss of $5 million by the Bank of New York,
– the loss of space probes,
– radiation overdoses that have killed and paralyzed.
© 2007 Pearson Addison-Wesley. All rights reserved 0-7
Computer Aided Software
Engineering (CASE) tools

• Project planning
• Project management
• Documentation
• Prototyping and simulation
• Interface design
• Programming

© 2007 Pearson Addison-Wesley. All rights reserved 0-8


Integrated Development
Environments (IDEs)

• Indeed systems known as integrated development


environments (IDEs) combine tools for developing
software (editors, compilers, debugging tools, and so on)
into a single, integrated package.
– A prime example of such systems are those for developing
applications for smartphones.
– These not only provide the programming tools necessary to write
and debug the software but
– also provide simulators that, by means of graphical displays, allow
a programmer to see how the software being developed would
actually perform on a phone.

© 2007 Pearson Addison-Wesley. All rights reserved 0-9


Figure 7.1 The software life cycle

The difference is that, in the case of


•other products, the maintenance phase tends to be a repair
process,
•whereas in the case of software, the maintenance phase
tends to consist of correcting or updating.
© 2007 Pearson Addison-Wesley. All rights reserved 0-10
The software life cycle contd…

• Once software is developed, it enters a


cycle of being used and maintained

• Maintenance phase tends to consist of


correcting or updating

• The little effort during the development of


software can make a tremendous
difference when modifications are required
© 2007 Pearson Addison-Wesley. All rights reserved 0-11
Figure 7.2 The development
phase of the software life cycle

© 2007 Pearson Addison-Wesley. All rights reserved 0-12


Requirement Analysis Stage

• Requirement Analysis the goal of which is to


specify what services the proposed system will
provide,

• To identify any conditions (time constraints,


security…) on those services, and to define
how the outside world will interact with the
system

© 2007 Pearson Addison-Wesley. All rights reserved 0-13


Requirement Analysis Stage

• Requirement analysis involves significant input


from the stakeholders of the proposed system.

• As needs of the potential user are identified,


they are complied to form a set of requirements
that the new system must satisfy.

© 2007 Pearson Addison-Wesley. All rights reserved 0-14


Requirement Analysis Stage
contd…

• After the system requirements are identified,


they are converted into more technical
specifications.

• For example, the requirement that data be


restricted to authorized personnel might
become the specification that the system will
not respond until an approved eight-digit
password has been typed
© 2007 Pearson Addison-Wesley. All rights reserved 0-15
Requirement Analysis Stage
contd…

• Ideally, the analysis stage of software


development concludes with a document, often
called a software requirements document, that
identifies the requirements and specifications of
the proposed system

© 2007 Pearson Addison-Wesley. All rights reserved 0-16


Design Stage

• Whereas analysis concentrates on what the


proposed system should do, design concentrates
on how the system will accomplish those goals.

• If the project were to construct a shopping


center rather than a software system, this would
be the stage at which an architect, having
established the project's requirements, would
develop detailed plans for the site.
© 2007 Pearson Addison-Wesley. All rights reserved 0-17
Design Stage

• Methodologies and tools (discussed later)


• Human interface

© 2007 Pearson Addison-Wesley. All rights reserved 0-18


Implementation Stage

• Implementation involves the actual writing of


programs, creation of data files, and
development of databases

• From a traditional point of view,


implementation is seen as a bottom-up process
in which individual modules are programmed
and then combined to form larger components
of the system
© 2007 Pearson Addison-Wesley. All rights reserved 0-19
Implementation Stage

• Create system from design


– Write programs
– Create data files
– Develop databases
• Role of “software analyst” versus
“programmer”

© 2007 Pearson Addison-Wesley. All rights reserved 0-20


Implementation Stage contd…

• It is at the implementation stage that we see the


distinction between the tasks of a software
analyst and programmer.

• The former is a person involved with the entire


development process, perhaps with an emphasis
on the analysis and design steps.
• The latter is a person involved primarily with
the implementation step.
© 2007 Pearson Addison-Wesley. All rights reserved 0-21
Testing Stage contd…

• Two types of Testing


- Validation testing involves confirming that the
software system as implemented conforms to the
requirements and specifications identified during
the original analysis.
- Defect testing, involves identifying and correcting
errors.

© 2007 Pearson Addison-Wesley. All rights reserved 0-22


Testing Stage contd…

• Validation testing might confirm that the


system does, in fact, produce a properly
formatted summary of a bank customer's
account,
• Whereas defect testing might reveal that the
account balance appearing in the report is
incorrect

© 2007 Pearson Addison-Wesley. All rights reserved 0-23


Testing Stage (summary)

• Validation testing
– Confirm that system meets specifications
• Defect testing
– Find bugs

© 2007 Pearson Addison-Wesley. All rights reserved 0-24


Software Engineering Methodologies

• Waterfall Model
• Incremental Model
– Prototyping (Evolutionary vs. Throwaway)
• Open-source Development
• Extreme Programming

© 2007 Pearson Addison-Wesley. All rights reserved 0-25


Water Fall Model

• The waterfall model is a sequential design


process, often used in software development
processes
• The progress is steadily downwards (like a
waterfall) through the phases of Conception,
Initiation, Analysis, Design, Construction,
Testing, Production/Implementation, and
Maintenance
© 2007 Pearson Addison-Wesley. All rights reserved 0-26
Water Fall Model contd…

© 2007 Pearson Addison-Wesley. All rights reserved 0-27


Incremental Model

• Incremental model in software engineering is a


one which combines the elements of waterfall
model which are then applied in an iterative
manner.

• It basically delivers a series of releases called


increments which provide progressively more
functionality for the client as each increment is
delivered.
© 2007 Pearson Addison-Wesley. All rights reserved 0-28
Incremental Model contd…

• In incremental model of software engineering


waterfall model is repeatedly applied in each
increment.

• The incremental model applies linear sequences


in a required pattern as calendar time passes.
Each linear sequence produces an increment in
the work.

© 2007 Pearson Addison-Wesley. All rights reserved 0-29


Incremental Model contd…

© 2007 Pearson Addison-Wesley. All rights reserved 0-30


Incremental Model Advantages

• Initial product delivery is faster


• Lower initial delivery cost
• core product is developed first i.e. main
functionality is added in the first increment
• With each release a new feature is added to the
product
• Customer can respond feature and review the
product
© 2007 Pearson Addison-Wesley. All rights reserved 0-31
Incremental Model Disadvantages

• Requires good analysis


• resulting cost may exceed the cost of the
organization
• Each phase of an iteration is rigid and do not
overlap each other
• As additional functionally is added to the
product, problems may arise related to system
architecture which were not evident is earlier
prototypes
© 2007 Pearson Addison-Wesley. All rights reserved 0-32
Open Source Stage

• This is the means by which much of today's


free software is produced
• The most prominent example is the Linux
operating system

© 2007 Pearson Addison-Wesley. All rights reserved 0-33


Open Source Stage contd…

• The open-source development of a software


package proceeds as follows:
– A single author writes an initial version of software
and posts the source code and it documentation on
the internet
– It can be downloaded and used by others without
charge, they are able to modify or enhance the
software to fit their own needs or correct errors that
they find
© 2007 Pearson Addison-Wesley. All rights reserved 0-34
Open Source Stage contd…

– They report these changes to the original author,


who incorporates them into the posted version of
the software, making this extended version
available for further modification

© 2007 Pearson Addison-Wesley. All rights reserved 0-35


Extreme Programming

• The extreme programming(XP) model,


software is developed by a team of less than a
dozen individuals working in a communal work
space where they freely share ideas and assist
each other in the development project

© 2007 Pearson Addison-Wesley. All rights reserved 0-36


Extreme Programming

• The software is developed incrementally by


means of repeated daily cycles of analyzing,
designing implementing and testing

• New expanded versions of the software


package appear on a regular basis, each of
which can be evaluated by clients and used to
point toward further increments

© 2007 Pearson Addison-Wesley. All rights reserved 0-37


Coupling versus Cohesion

• Coupling
– Control coupling
– Data coupling
• Cohesion
– Logical cohesion
– Functional cohesion

© 2007 Pearson Addison-Wesley. All rights reserved 0-38


Coupling versus Cohesion

• Coupling- Coupling is the measure of the degree of


interdependence between the modules. A good software will
have low coupling.
• Control coupling -which occurs when a module passes control
of execution to another.
• Data coupling- which refers to the sharing of data between
modules. If two modules interact with the same item of data,
then modifications made to one module may affect the other.

© 2007 Pearson Addison-Wesley. All rights reserved 0-39


Cont…

• Cohesion
• Cohesion is a measure of the degree to which the
elements of the module are functionally related. It is
the degree to which all elements directed towards
performing a single task are contained in the
component. Basically, cohesion is the internal glue
that keeps the module together. A good software
design will have high cohesion.

© 2007 Pearson Addison-Wesley. All rights reserved 0-40


Cont…

• Logical cohesion- A weak form of cohesion is known as


logical cohesion. This is the cohesion within a module induced
by the fact that its internal elements perform activities logically
similar in nature.
• Functional cohesion- A stronger form of cohesion is
known as functional cohesion, which means that all the parts
of the module are focused on the performance of a single
activity.

© 2007 Pearson Addison-Wesley. All rights reserved 0-41


Figure 7.7 Logical and functional cohesion
within an object

© 2007 Pearson Addison-Wesley. All rights reserved 0-42


Tools of the Trade

• Entity-Relationship Diagram
– One-to-one relation
– One-to-many relation
– Many-to-many relation

© 2007 Pearson Addison-Wesley. All rights reserved 0-43


Entity Relation Diagram

• An ER model is an abstract way of describing


a database
• stores data in tables, some of the data in these
tables point to data in other tables

• entry in the database could point to several


entries

© 2007 Pearson Addison-Wesley. All rights reserved 0-44


Entity Relation Diagram contd…

• Diagrams created to design these entities and


relationships are called entity–relationship
diagrams or ER diagrams.

© 2007 Pearson Addison-Wesley. All rights reserved 0-45


Figure 7.9 A simple entity-
relationship diagram

© 2007 Pearson Addison-Wesley. All rights reserved 0-46


Entity–relationship Modeling
contd…

• An entity may be defined as a thing which is


recognized as being capable of an independent
existence and which can be uniquely identified

• An entity may be a physical object such as a


house or a car, an event such as a house sale or
a car service, or a concept such as a customer
transaction or order

© 2007 Pearson Addison-Wesley. All rights reserved 0-47


Entity–relationship Modeling
contd…

• Entity diagram

© 2007 Pearson Addison-Wesley. All rights reserved 0-48


Entity–relationship Modeling
contd…

• A relationship captures how entities are related


to one another
• Relationships can be thought of as verbs,
linking two or more nouns

© 2007 Pearson Addison-Wesley. All rights reserved 0-49


Entity–relationship Modeling
contd…

• Examples: an owns relationship between a


company and a computer,
a supervises relationship between an employee
and a department, a performs relationship
between an artist and a song,
a proved relationship between a mathematician
and a theorem.

© 2007 Pearson Addison-Wesley. All rights reserved 0-50


Entity–relationship Modeling
contd…

• Entities and relationships can both have


attributes.
• Examples: an employee entity might have
a Social Security Number (SSN) attribute;
the proved relationship may have
a date attribute.

© 2007 Pearson Addison-Wesley. All rights reserved 0-51


Entity–relationship Modeling
contd…

• Attributes

© 2007 Pearson Addison-Wesley. All rights reserved 0-52


Entity–relationship Modeling
contd…

• Cardinality specifies how many instances of


an entity relate to one instance of another
entity.

© 2007 Pearson Addison-Wesley. All rights reserved 0-53


Figure 7.10 One-to-one, one-to-many,
and many-to-many relationships between
entities of types X and Y

© 2007 Pearson Addison-Wesley. All rights reserved 0-54


Documentation

A software system is of little use unless people can


learn to use and maintain it.
Hence, documentation is an important part of a final
software package, and its development is, therefore, an
important topic in software engineering.

Software documentation serves three purposes, leading


to three categories of documentation: user
documentation, system documentation, and technical
documentation.

© 2007 Pearson Addison-Wesley. All rights reserved 0-55


User documentation

The purpose of user documentation is to explain the


features of the software and describe how to use
them. It is intended to be read by the user of the
software and is therefore expressed in the terminology
of the application.

© 2007 Pearson Addison-Wesley. All rights reserved 0-56


System documentation

The purpose of system documentation is to describe the


software’s internal composition so that the software can
be maintained later in its life cycle.
A major component of system documentation is the
source version of all the programs in the system.

© 2007 Pearson Addison-Wesley. All rights reserved 0-57


Cont…

It is important that these programs be presented in a


readable format, which is why software engineers
support the use of well designed, high-level
programming languages.

© 2007 Pearson Addison-Wesley. All rights reserved 0-58


Technical documentation

The purpose of technical documentation is to


describe how a software system should be installed and
serviced (such as adjusting operating parameters,
installing updates, and reporting problems back to the
software’s developer).

© 2007 Pearson Addison-Wesley. All rights reserved 0-59


Software Ownership

• Copyright
• A copyright notice clearly identifies ownership,
the personnel authorized to use the work, and
other restrictions.

© 2007 Pearson Addison-Wesley. All rights reserved 0-60


Cont…

• A software license is a legal agreement


between the owner and user of a software
product that grants the user certain permissions
to use the product without transferring
ownership rights to the intellectual property.

© 2007 Pearson Addison-Wesley. All rights reserved 0-61

You might also like