25
SOFTWARE RELIABILITY CS 360 Lecture 17

CS 360 Lecture 17. Software reliability: The probability that a given system will operate without failure under given environmental conditions for

Embed Size (px)

Citation preview

Page 1: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

SOFTWARE RELIABILITY

CS 360

Lecture 17

Page 2: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

DEFINITION OF SOFTWARE RELIABILITYSoftware reliability:

The probability that a given system will operate without failure under given environmental conditions for a specified period of time.

We express reliability on a scale from 0 to 1: Highly reliable system will have a reliability measure close to 1

Unreliable system will have a measure close to 0. Reliability is measured over execution time so that it more accurately reflects system usage.

GOAL: reliability must be quantified so that we can compare software systems

2

Page 3: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

FAILURES AND FAULTSFault (bug):

Programming or design error where the delivered system does not conform to specificationcoding error, protocol error

Failure: Software does not deliver the service expected by the usermistake in requirements, confusing user interface

3

Page 4: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

TERMINOLOGY Error:

human action that results in software containing a fault Fault avoidance:

Build systems with the objective of creating fault-free (bug-free) software. Fault detection (testing and verification):

Detect faults (bugs) before the system is put into operation or when discovered after release.

Fault tolerance: Build systems that continue to operate when problems (bugs, overloads, bad data, etc.) occur.

Failure: any observable divergence of software behavior from user needs/requirements

Failure intensity: the number of failures per time unit This is a way of expressing reliability

4

Page 5: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

ERRORS, FAULTS, AND FAILURES

5

Page 6: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

SOFTWARE VS. HARDWARE RELIABILITYSoftware reliability Hardware reliability

Failures are primarily due to design faults. Repairs are made by modifying the design.

Failures are caused by deficiencies in design, production, and maintenance.

No “wear-out” phenomena. Errors can occur without warning.

Failures are caused by wear or other energy-related phenomena. Sometimes a warning is available before a failure occurs.

No equivalent preventive maintenance for software

Repairs can be made that makes hardware more reliable through maintenance.

Reliability is not time dependent. Failures occur when the logic path the program takes contains an error.

Reliability is time related. Failure rates can be decreasing, constant, or increasing with respect to operating time.

6

Page 7: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

SOFTWARE VS. HARDWARE RELIABILITYSoftware reliability Hardware reliability

External environment conditions do not affect software reliability. Internal conditions, such as insufficient memory or inappropriate clock speeds do affect software reliability.

Reliability is related to environmental conditions.

Reliability can’t be predicated from knowledge of design, usage, or stress factors.

Reliability can, theoretically, be predicted from design factors and physical attributes.

Reliability can’t be improved through redundancy of software. Redundancy will simply replicate the same error.

Reliability can usually be improved through redundant hardware.

Failure rates of software components are not predictable.

Failure rates of hardware components are somewhat predictable according to known usage patterns.

7

Page 8: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

SOFTWARE RELIABILITY MODELING A software reliability model

specifies the general failure

rate and the principle factors

that affect it: Time Fault introduction Fault removal Operational environment

8

Page 9: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

SOFTWARE RELIABILITY MODELINGSoftware systems are changed

(updated) many times during

their lifecycle. The software reliability

models are best used for one

milestone rather than over

the entire product lifecycle.

9

Page 10: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

BUILDING RELIABLE SOFTWARE: ORGANIZATIONAL CULTUREGood organizations create good systems:

Managers and senior technical staff must lead by example.

Acceptance of the group's workmeetings, preparation, support for juniors

Completion of a task before moving to the nextdocumentation, comments in code

10

Page 11: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

BUILDING RELIABLE SOFTWARE: QUALITY MANAGEMENT PROCESS

Assumption: Good software is impossible without good processes

The importance of routine: Standard terminology

requirements, design, acceptance, etc.Software standards

coding standards, naming conventions, etc.Regular builds of complete system

often daily

11

Page 12: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

BUILDING RELIABLE SOFTWARE: QUALITY MANAGEMENT PROCESSWhen time is short...

Pay extra attention to the early stages of the process:Feasibility, requirements, design.

If mistakes are made in the requirements process, there will be little time to fix them later.

Experience shows that taking extra time on the early stages will usually reduce the total time to release.

12

Page 13: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

BUILDING RELIABLE SOFTWARE: COMPLEXITYThe human mind can encompass only limited complexity: Comprehensibility Simplicity Partitioning of complexity

A simple component is easier to get right than a complex one.

13

Page 14: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

BUILDING RELIABLE SOFTWARE: CHANGES

14

Page 15: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

BUILDING RELIABLE SOFTWARE: CHANGE Changes can easily introduce problems Change management

Source code management and version control Tracking of change requests and bug reports Procedures for changing requirements specifications, designs and other documentation

Regression testing Release control

When adding new functions or fixing bugs it is easy to write patches that violate the systems architecture or overall program design. This should be avoided as much as possible. Be prepared to modify the architecture to keep a high quality system.

15

Page 16: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

BUILDING RELIABLE SOFTWARE: FAULT TOLERANCE

Aim: A system that continues to operate when problems occur.

Examples: Invalid input data (data processing application) Overload (networked system) Hardware failure (control system)

General Approach: Failure detection Damage assessment Fault recovery Fault repair

16

Page 17: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

FAULT TOLERANCE: RECOVERYBackward recovery

Record system state at specific events (checkpoints). After failure, recreate state at last checkpoint.

Combine checkpoints with system log that allows transactions from last checkpoint to be repeated automatically.

Recovery software is difficult to test

Example After an entire network is hit by lightning, the restart crashes because of overload.

17

Page 18: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

BUILDING RELIABLE SOFTWARE: ADAPTING SMALL TEAMS TO LARGE PROJECTS

Small teams and small projects have advantages for reliability: Small group communication reduces misunderstanding. Small projects are easier to test and make reliable. Small projects have shorter development cycles.

Mistakes in requirements are less likely and less expensive to fix.

When one project is completed it is easier to plan for the next.

Improved reliability is one of the reasons that incremental development has become popular over the past few years.

18

Page 19: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

RELIABILITY METRICSReliability

Probability of a failure occurring in operational use.

Traditional measures for online systems Mean time between failures Availability (up time) Mean time to repair

Market measures Complaints Customer retention 19

Page 20: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

RELIABILITY METRICS FOR DISTRIBUTED SYSTEMSTraditional metrics are hard to apply in multi-component systems: A system that has excellent average reliability might give terrible service to certain users.

In a big network, at any given moment something will be giving trouble, but very few users will see it.

When there are many components, system administrators rely on automatic reporting systems to identify problem areas.

20

Page 21: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

METRICS: USER PERCEPTION OF RELIABILITY

Perceived reliability depends upon: user behavior set of inputs pain of failure

User perception is influenced by the distribution of failures A personal computer that crashes frequently, or a machine that is out of service for two days every few years

A database system that crashes frequently but comes back quickly with no loss of data.

A system that does not fail but has unpredictable periods when it runs very slowly.

21

Page 22: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

SOFTWARE RELIABILITY EXAMPLE:CENTRAL COMPUTING SYSTEM

A central computing system (Ex: a server farm) is vital to an entire organization. Any failure is serious.

Step 1: Gather data on every failure Create a database that records every failureAnalyze every failure:

hardware software (default) environment (e.g., power, air conditioning) human (e.g., operator error)

22

Page 23: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

SOFTWARE RELIABILITY EXAMPLE:CENTRAL COMPUTING SYSTEMStep 2: Analyze the data

Weekly, monthly, and annual statistics Number of failures and interruptions Mean time to repair

Graphs of trends by componentFailure rates of disk drives Hardware failures after power failures Crashes caused by software bugs in each component

Categories of human error 23

Page 24: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

SOFTWARE RELIABILITY EXAMPLE:CENTRAL COMPUTING SYSTEMStep 3: Invest resources where benefit will be maximum Priority order for software improvements Change procedures for operators/usersReplacement hardware Orderly shut down after power failure

24

Page 25: CS 360 Lecture 17.  Software reliability:  The probability that a given system will operate without failure under given environmental conditions for

KEY FACTORS FOR RELIABLE SOFTWAREOrganization culture that expects quality.

This comes from the management and the senior technical staff

Precise agreement on requirementsDesign and implementation that hides complexity

structured design, object-oriented programming

Programming style that emphasizes simplicity and readability

Software tools that restrict or detect errorsstrongly typed languages, source control systems, debuggers

Systematic verification at all stages of development requirements, system architecture, program design, implementation, and user testing 25