Today’s Agenda HW #6 Software Maintenance Software Testing and Maintenance 1.

50
Today’s Agenda HW #6 Software Maintenance Software Testing and Maintenance 1

Transcript of Today’s Agenda HW #6 Software Maintenance Software Testing and Maintenance 1.

Page 1: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Today’s Agenda

HW #6

Software Maintenance

Software Testing and Maintenance 1

Page 2: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Quick Review

What is the fundamental difference between software development and maintenance?

Software Testing and Maintenance 2

Page 3: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Advanced Testing Techniques

Automatic test data generation Symbolic/concolic execution, constraint solving

Testing of interactive systems, e.g. GUI, web applications How to generate test sequences?

Object-oriented testing How to take into account OO features like

inheritance and polymorphism?

Concurrency/real-time testing How to control non-deterministic behavior? How to

verify synchronization/timing requirements?

Software Testing and Maintenance 3

Page 4: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 4

Software Maintenance

Introduction

Process Models

Program Understanding

Configuration Management

Management Issues

Conclusion

Page 5: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 5

Software Maintenance

Management and control of changes to a software product after delivery

Bug fix, new features, environment adaptation, performance improvement

Often accounts for 40-70% of the cost of the entire life-cycle of a software product

The more successful a software product is, the more time it spends on maintenance

Page 6: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 6

Software vs Programs

Software Components Examples

Program 1. Source code 2. Object code

1. Analysis/Specification (a) Formal specification (b) Data flow diagrams

2. Design (a) High-level design (b) Low-level design (b) Data model

Documentation 3. Implementation (a) Source code (b) Comments

4. Testing (a) Test design (b) Test results

Operating Procedures 1. Installation manual 2. User manual

Page 7: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 7

Maintenance vs Development

Maintenance must work within the parameters and constraints of an existing system

The addition of a new room to an existing building can be more costly than adding the room in the first place

An existing system must be understood prior to a change to the system

How to accommodate the change? What is the potential ripple effect? What skills and knowledge are required?

Page 8: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 8

Why Maintenance?

To provide continuity of service Bug fixing, recover from failure, accommodating

changes in the environment

To support mandatory upgrades Government regulations, maintaining competitive

edges

To support user requests for improvements New features, performance improvements,

customization for new users

To facilitate future maintenance work Re-factoring, document updating

Page 9: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 9

A Maintenance Framework

User Requirements Error correction, new features

Environment Operational: Innovations in hardware and software Organizational: Policy changes, competition

Maintenance Process Different maintenance process models

Software Maintainability, complexity, quality of documentation

Maintenance Personnel Staff turnover, domain expertise

Page 10: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 10

Lehman’s Laws

Law of continuing change: systems must be continually adapted

Law of increasing complexity: as a system evolves, its complexity increases unless work is done to maintain or reduce it

Law of continuing growth: functionality must be increased continually to maintain user satisfaction

Law of declining quality: system quality will appear to decline unless rigorously adapted

Page 11: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 11

Software Change

Corrective change: triggered by defects in the software Residual errors in design and/or coding

Adaptive change: driven by the need to accommodate modifications in the environment

Innovations in hardware/software, changes in business rules

Perfective change: undertaken to expand the existing requirements

Enhancement of functionality, improvement in computational efficiency

Preventive change: undertaken to prevent malfunctions or to improve maintainability

Code restructuring, optimization and documentation updating

Page 12: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 12

Interplay of changes

Adaptive change Perfective change

Corrective change

Preventive change

Leads to

Page 13: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 13

Expenditure on Different Changes

Corrective Adaptive Perfective Others

10

20

30

40

50

60

Percentageof Maintenance

effort

Change

30 : 70Devel : maintenance

Page 14: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 14

Major Activities

Change identification What to change, why to change

Program understanding How to make the change, what is the ripple effect

Carrying out the change and testing How to actually implement the change and ensure its

correctness

Configuration management How to manage and control the changes

Management issues How to build a team

Page 15: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 15

Software Maintenance

Introduction

Process Models

Program Understanding

Configuration Management

Management Issues

Conclusion

Page 16: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 16

Development Models

Code-and-Fix Ad-hoc, not well-defined

Waterfall Sequential, does not capture the evolutionary nature

of software

Spiral Heavily relies on risk assessment

Iterative Incremental, but constant changes may erode

system architecture

Page 17: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 17

Quick-Fix Model

Problem Found

Fix it

Page 18: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 18

Boehm’s Model

Management decision

Software in use

ChangeImplemented

Evaluation

Approved changes

New versionResults

Proposed changes

Page 19: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 19

Osborne’s ModelIdentification of need for change

Change request submitted

Requirements analysis

Change request

rejected approved

Task scheduled

Design analysis

Design review

Code modification

Review of proposed change

Testing

Documentation update

Standards audit

User acceptance

Post-installation review of changes

Task completed

cancellation

Page 20: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 20

Iterative Enhancement Model

Analyze existing system

CharacteriseProposed

modifications

RedesignCurrent

Version andimplement

Page 21: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 21

Maintenance Effort (1)

45.3%

54.7%

Non discretionaryMaintenance• emergency fixes• debugging• changes to input data• changes to hardware

Discretionary maintenance• enhancements for users• documentation improvement• improving efficiency

softwaremaintenace

effort

Leintz and Swanson’s Survey

Page 22: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 22

Maintenance Effort (2)

Maintenance

Development

effort

analysis specification design implementation testing operation

Page 23: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 23

Software Maintenance

Introduction

Process Models

Program Understanding

Configuration Management

Management Issues

Conclusion

Page 24: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 24

What to understand

Problem Domain Capture necessary domain knowledge from

documentation, end-users, or the program source

Execution Effect Input-output relation, knowledge of data flow, control

flow, and core algorithms

Cause-Effect Relation How different parts affect and depend on each other

Product-Environment Relation How the product interacts with the environment

Page 25: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 25

Comprehension Process (1)

Read documentation

Read the source code

Run the program

Dynamic analysis

Static analysis

Page 26: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 26

Comprehension Process (2)

Knowledge base: expertise and background knowledge

Mental model: encodes the current understanding

Assimilation: obtain information from various sources

Page 27: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 27

Comprehension Strategies

Top-down: start with the big picture, and then gradually work towards understanding the low-level details

Bottom-up: start with low-level semantic structures, and then group them into high-level, more meaningful structures

Opportunistic: A combination of top-down and bottom-up

Page 28: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 28

Factors affecting understanding

Expertise: Domain knowledge, programming skills

Program structure: modularity, level of nesting

Documentation: readability, accuracy, up-to-date

Coding conventions: naming style, design patterns

Comments: quality, shall convey additional information

Program presentation: good use of indentation and spacing

Page 29: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 29

Reverse Engineering

The process of analyzing the source code to create system representations at higher levels of abstraction

Three types of abstraction Function abstraction: what it does, instead of how Data abstraction: abstract data type Process abstraction: communication and

synchronization between different processes

Page 30: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 30

Why RE?

Allow a software system to be understood in terms of what it does, how it works and its architectural representation

Recover lost information Facilitate migration between platforms Improve or provide documentation Provide alternative views Extract reusable components Cope with complexity

Page 31: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 31

Levels of RE

Specification

Design

Implementation Re-documentation

Re-documentation

Re-documentation

Reverse

en

gin

eerin

g

Design recovery

Spec recovery

Page 32: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 32

Software Maintenance

Introduction

Process Models

Program Understanding

Configuration Management

Management Issues

Conclusion

Page 33: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 33

Why CM?

Critical to the management and maintenance of any large system

Suppose that a customer reports a bug. Without proper control, it may be impossible to address this problem. (Why?)

CM allows different releases to be made from the same code base

CM also allows effective team work, auditing, and accounting

Page 34: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 34

Major activities

Identification of components and changes

Control of the way changes are made

Auditing changes – making the current state visible

Status accounting – recording and documenting all activities that have taken place

Page 35: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 35

The Big Picture

Tracking defects

Quality assurance

Configuration Mgmt

Version controlBuilding

Environment mgmtProcess control

Process Mgmt

Project Mgmt Policy Enforcement

Page 36: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 36

Version Control (1)

Object 1Ver 1

Object 2Ver 1

Object 3Ver 1

Object 4Ver 1

Object 1Ver 2

Object 2Ver 2

Object 3Ver 2

Object 4Ver 2

Object 2Ver 3

Object 3Ver 3

Object 3Ver 4

Release 1.0

Release 2.0

Release 3.0

Page 37: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 37

Version Control (2)

Object 1

Ver 1.0

Ver 2.0

Ver 3.0

Ver 1.1 Ver 1.2

Ver 2.1

Page 38: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 38

Building

One of the most frequently performed operations

Incremental building: only rebuild objects that have been changed or have had a dependency change

Consistency: must use appropriate versions of the source files

Makefiles are often used to declare dependencies between different modules

Page 39: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 39

Change Control

Decide if a requested change should be made Is it valid? Does the cost of the change outweigh its

benefit? Are there any potential risks?

Mange the actual implementation of the change

Allocate resources, record the change, monitor the progress

Verify that the change is done correctly Ensure that adequate testing be performed

Page 40: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 40

Change Request Form

Name of system:Version:Revision:Date:Requested by:Summary of change:Reasons of change:Software components requiring change:Documents requiring change:Estimated cost:

Page 41: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 41

Documentation

User Doc: Describe system functions without reference their implementation

Installation manual, user manual, reference manual, admin manual, etc.

System Doc: System description from the developer’s perspective

Requirements, specification, high-level/low-level design, test plans

Page 42: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 42

Producing Quality Documentation

Writing style: adhere to guidelines, be clear

Adhering to document standards

Standards and quality assessment For example, documents need to be reviewed and

signed off

Maintaining consistency Design documents should be consistent with actual

implementation code Documents that reference each other should be

consistent

Page 43: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 43

Software Maintenance

Introduction

Process Models

Program Understanding

Configuration Management

Management Issues

Conclusion

Page 44: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 44

Responsibilities

Maximize productivity Personnel management

• Choose the right people, motivate the team, keep the team informed, allocate adequate resources

Organizational mode• Combined or separate maintenance teams, module

ownership, change ownership, work-type or application-type

Page 45: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 45

Motivating the Team

Rewards: financial rewards, promotion

Supervision: technical supervision and support for inexperienced staff

Assignment patterns: rotate between maintenance and development

Recognition: properly acknowledge one’s achievements

Career structure: provide room for career growth

Page 46: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 46

Education and Training

Objective: To raise the level of awareness Not a peripheral activity, but at the heart of an

organization

Strategies University education Conferences and workshops Hands-on experience

Page 47: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 47

Module Ownership

Pros The module owner develops a high level of expertise

in the model

Cons No one is responsible for the entire system Workload may not be evenly distributed Difficult to implement enhancements due to

unknown dependencies

Page 48: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 48

Change Ownership

Pros: Tends to adhere to standards set for the entire

software system Integrity of the change is ensured Changes can be code and tested independently Changes inspection tends to be taken seriously

Cons: Training of new personnel can be difficult Individuals do not have long-lasting responsibilities

Page 49: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 49

Software Maintenance

Introduction

Process Models

Program Understanding

Configuration Management

Management Issues

Conclusion

Page 50: Today’s Agenda  HW #6  Software Maintenance Software Testing and Maintenance 1.

Software Testing and Maintenance 50

Conclusion

Maintenance a critical stage in the software lifecycle, and must be managed carefully

Unlike new development, maintenance must work within the constraints of the existing system

Central to maintenance is the notion of change. Changes must be managed and controlled properly.

Not only the code needs to be maintained, but also the documentation.