Professional Documents
Culture Documents
CS 501: Software Engineering: Reliability 2
CS 501: Software Engineering: Reliability 2
Lecture 20
Reliability 2
Projects
Four weeks to the end of the semester.
Leave time for system testing and to make small changes
discovered when the complete system is assembled.
Better to deliver a limited first phase done well than a fuller
system that is incomplete, untested, or without
documentation.
Customer
DB
Product
(a) For the system architecture of
DB
Phase 1:
i Draw a UML interface diagram.
WebBrowser Ordering
system
Customer
DB
5 CS 501 Spring 2008
Quiz 3 Q1
Customer DB
optional
Data Store
7 CS 501 Spring 2008
Quiz 3 Q2
8
[See next two slides] CS 501 Spring 2008
Quiz 3 Q2
Abstract class
Abstract classes are superclasses which contain abstract methods
and are defined such that concrete subclasses extend them by
implementing the methods. Before a class derived from an abstract
class can become concrete, i.e. a class that can be instantiated, it
must implement particular methods for all the abstract methods of
its parent classes.
The incomplete features of an abstract class are shared by a group
of subclasses which add different variations of the missing pieces.
Wikipedia 4/2/08
Ordering Client
System
OrderingAbstraction DBImplementor
RefinedOrderingAbstraction
ConcreteDBImplementorA
ConcreteDBImplementorB
Validation &
verification
Requirements
specification Design Program
REVIEWS
Concept
Colleagues review each other's work:
can be applied to any stage of software development
can be formal or informal
Design and code reviews are a fundamental part of good
software development
Moderator
Scribe
Developer -- the design team
Interested parties -- people who created the system design and/or
requirements specification, and the programmers who will
implement the system
Outside experts -- knowledgeable people who are not working on
this project
Client -- only if the client has a strong technical representative
In a small team, an individual may have several roles
15 CS 501 Spring 2008
Static and Dynamic Verification
User
Roles
Actions
Digital material
Access
Attributes Operations
Policies
X Y
Decryption
Y X
• Private key and public key
• Digital signatures
Actual examples
(a) A program dies because the programmer typed: x = 1 instead
of x == 1.
(b) A mathematical function loops for ever from rounding error.
(c) A distributed system hangs because of a concurrency problem.
(d) After a network is hit by lightning, it crashes on restart.
(e) The head of an organization is paid $5 a month instead of
$10,005 because the maximum salary allowed by the program
is $10,000.
(f) An operating system fails because of a page-boundary error in
the firmware.
31 CS 501 Spring 2008
Terminology
Fault avoidance
Build systems with the objective of creating fault-
free (bug-free) software
Fault tolerance
Build systems that continue to operate when faults
(bugs) occur
Fault detection (testing and validation)
Detect faults (bugs) before the system is put into
operation.
Murphy's Law:
If anything can go wrong, it will.
Defensive Programming:
• Redundant code is incorporated to check system state after
modifications.
• Implicit assumptions are tested explicitly.
• Risky programming constructs are avoided.
General Approach:
• Failure detection
• Damage assessment
• Fault recovery
• Fault repair
N-version programming -- Execute independent
implementation in parallel, compare results, accept the
most probable.
Basic Techniques:
• Timers and timeout in networked systems
• After error continue with next transaction (e.g.,
drop packet)
• User break options (e.g., force quit, cancel)
• Error correcting codes in data
• Bad block tables on disk drives
• Forward and backward pointers in databases
Report all errors for quality control
39 CS 501 Spring 2008
Fault Tolerance
Backward Recovery:
• Record system state at specific events (checkpoints). After
failure, recreate state at last checkpoint.
• Backup of files
• Combine checkpoints with system log (audit trail of
transactions) that allows transactions from last checkpoint to
be repeated automatically.
• Test the restore software!