Software Reuse
Software Reuse
Software Reuse
Course Code : CSE531 Text Book: Software Reuse: Architecture, Process and Organization for Business Success By Ivar Jacobson. Martin 1st Griss, Patrik Johansson, 1st edition. Credits: 3.0
Outline
An introduction to software reuse. Definitions. Types. Benefits. Drawbacks.
Reuse concept
Some problems about producing a car:
How to produce a car nowadays? (how to produce the first car?) Will you design and produce an engine from scratch? How to design and produce a new model of a car?
engine
body
wheels
other parts
compose
car
Reuse concept
A new engine model in an existing body model results in a new car model (reuse the design of bodies) A new engine can be designed based on existing engines (reuse the design of engines) As a summary, parts of a car (or the design of the parts) can be reused for new cars (or models). A necessary condition for the reuse: part interface should be compatible.
It is possible that some parts of the intended software cannot be produced though reuse. In this case, the parts should be created from scratch.
intended system
reusable components
A+B =
Opportunistic Reuse
Specify components
Architectural design
Why Reuse?
Because we (the CS people) are inventing the wheel over and over again and wasting enormous resources doing so. We hope that there is a way to make integration and design of the reusable components cheaper than redevelopment.
The goal of software reuse is to reduce the cost of software production by replacing creation with recycling.
Deliberate reuse
Visual Basic Stdio.h
Purpose of Reuse
Cheaper products.
Shorter development time. Increase productivity Decrease testing domain. Easier maintenance.
Drawbacks of Reuse
1. 2. 3. Code designed for reuse is more expensive to create. Integrating reusable code introduces an overhead in the development process. Maintaining the reusable resources requires added mechanisms.
In 1996, the 1st test flight of the Ariane 5 rocket ended in disaster when the launcher went out of control 37 seconds after take off.
Floating point to integer conversion of thrust value caused overflow and triggered an unhandled exception that shut down the Inertial Navigation System.
The value stored in Ariane 4 was never large enough to cause overflow.
The functionality that failed in this component was not required in Ariane 5.
23
24
Ad hoc reuse
No planning, no engineering (for reuse), no tool support, and even no component base Example: copy and paste program code developed before
Generator
Reusable components are parameterized. When reuse a component, parameters should be offered. Then, the generator generates software for the reuser Example: wizards in setting up a driver or application (e.g., MS Word)
Program Generation
Application description Program generator Generated program
Database
Framework
A framework is reused. The detailed contents should be created by the reuser Example: VB components
Systematic reuse
Domain engineering for designing components for reuse Application system engineering for developing software through reuse Reuse starts from the requirement analysis phase down to the implementation (and even testing and maintenance) phase We focus on this reuse
Reuse approaches
Design patterns Generic abstractions that occur across applications are represented as design patterns that show abstract and concrete objects and interactions. Systems are developed by integrating components (collections of objects) that conform to component-model standards. This is covered in Chapter 19. Collections of abstract and concrete classes that can be adapted and extended to create application systems. Legacy systems (see Chapter 2) that can be wrapped by defining a set of interfaces and providing access to these legacy systems through these interfaces. Systems are developed by linking shared services that may be externally provided. Component-based development Application frameworks Legacy system wrapping Service-oriented systems
Reuse approaches
Application product lines COTS integration Configurable vertical applications Program libraries Program generators An application type is generalised around a common architecture so that it can be adapted in different ways for different customers. Systems are developed by integrating existing application systems. A generic system is designed so that it can be configured to the needs of specific system customers. Class and function libraries implementing commonly-used abstractions are available for reuse. A generator system embeds knowledge of a particular types of application and can generate systems or system fragments in that domain. Shared components are woven into an application at different places when the program is compiled.
Topics Covered
Software reuse Types What can be reused? Why reused? Purpose of reuse Benefits Drawbacks