Software Reuse
Software Reuse
Targeted audience
Project leaders Systems analysts Software engineers Technical managers
activities.
Prerequisites:
knowledge and experience in software
engineering.
10/13/2012
Course contents
Module 1: Identification of reuse opportunities. Module 2: Domains and system families. Module 3: Component based engineering. Module 4: Reuse in an organizational context. Module 5: Evaluation of reuse costs, benefits and risks. Module 6: Development of a reuse strategic plan. Module 7: State of Practice in implementing reuse. Module 8: Conclusion.
Module1
10/13/2012
Why reuse?
Reuse is not an end in itself. Reuse motivation is ultimately economic (it is an investment). Reuse increases predictability in the software process, opening of new business opportunities and reduces costs and time-tomarket. Reuse is part of the natural industrialization process of software development. Reuse exploits the similarities in a domain.
10/13/2012
Systematic Reuse
Definition: The disciplined use of existing reusable assets in the development of new systems in a given business area or domain to achieve substantial benefits in business capability and performance.
Systematic reuse
Understanding contribution to achievement of business goals. Having a defined technical and management strategy to achieve those goals. Integration into the software process and part of process improvement initiative. Availability of resources (skilled staff, tools, etc.). Using adequate measurements to control reuse performance.
10/13/2012
Software factories are about reusing patterns, frameworks, tools, templates, requirements, tests, instrumentation, process guidance, and many other assets used throughout the software life cycle, in a systematic, rather than ad hoc fashion, not about stamping out endless copies of the same thing
Jack Greenfield, Microsoft
Systematic reuse is part of a natural and irreversible industrialization process in the software-intensive industry
What is an asset?
Oxford Dictionary definition: Assets are possessions having a value. In the context of a software organization:
A work product with a potential value for the
organization that can be used (and re-used) in its operations (software development). A software artifact explicitly intended to provide a return on investment through re-use*
Assets are products and must be managed as such. Can be re-engineered from legacy. Assets include all kind of work-products.
10/13/2012
Kinds of assets
Product assets: related with (partial) results of the software life-cycle. E.g., test cases, etc. Process assets: related with the software life-cycle itself.
Asset base
An asset base is a structured collection of related assets. Assets are more effective when structured as an asset base. Examples:
A library of functions to read input data from different
sources, together with adaptation instructions for different platforms and a tutorial on how to use them.
A collection of guidelines, templates, photographs, icons, sounds and animated pictures to create slide-based presentations.
10/13/2012
Reuse benefits
Should be measured with respect to the established business goals. Benefits in performance (results):
Cost reduction. Quality improvement. Time-to-market reduction.
Increased process maturity. Increased production capacity. Better awareness of existing capability. More accurate estimations.
Domains
A conceptual area or field defined by a set of features that are shared between its members.
Problem domain: common requirements. Solution domain: common design/code.
From a reuse viewpoint a domain is of interest if it is more convenient to consider the solutions of the problems as a whole rather than individually. Establishes the scope of reuse.
10/13/2012
Driven by business
10/13/2012
Treated as an investment
Reuse initiatives require a cost-benefit analysis. The analysis is similar to any other capital investment (e.g., RoI, NPV, etc.). It is necessary to take into account factors difficult to quantify, such as:
New business opportunities. Timing to be on the market. Competitive prices. etc.
Domain-focused
10/13/2012
Reuse processes
Two life-cycles with different but complementary objectives. Domain Engineering
within a given domain in the organization. It develops and maintains the needed infrastructure for developing applications in the domain.
Application Engineering
It mechanically derives applications and
10
10/13/2012
Reuse supports organizational process improvement but it also requires some level of process maturity in the organization
process Reuse adoption and process improvement are complementary to each other Reuse requires some level of process maturity in the organization
11
10/13/2012
Module 2
customers with similar needs A set of systems based on the similar architecture/technology
Most units developing software intensive systems may look at their products as a product family
12
10/13/2012
Families - Parnas
Practical and economical definition: We consider a set of programs to constitute a family whenever it is worthwhile to study programs from the set by first studying common properties of the set and then determining the special properties of the individual family members.
David L. Parnas.
13
10/13/2012
Domains
A domain is of interest if it is more convenient to consider the solutions of the problems as a whole rather than individually. Problem domain/Business domain/Vertical domain:
common requirements.
Product-family
A group of systems built from a common set of
Product-line
A collection of products sharing a common set of
features that address the specific needs of a given business area. Business perspective: generally associated with a business domain
14
10/13/2012
software products or systems (multi-system perspective) the collection constitutes a family, e.g. it is built from a common set of assets in a given domain (domain scope) you identify the commonality and variability across the family of systems to structure the reusable asset base (domain analysis) you establish how new members of the family are built from the common asset base (domain process)
members of the domain Provides examples and exceptions Defines a way to determine whether a new application belongs to the domain.
used technology.
15
10/13/2012
Domain Analysis
Defines the way in which domain members are similar to each other.
Understand what domain members have in
common. Identify the variabilities that distinguish the essential ways in which one member is different from the others
Domain process
Describes how to engineer the applications using the common asset base. Establishes the requirements of an application for a given customer by setting the values of open decisions The development process includes binding the variabilities at different stages:
16
10/13/2012
17
10/13/2012
Domain definition
Name, to be able to make reference to the domain Synopsis, a brief informal statement of the scope of the domain Products, a representative list of existing products (legacy products) as well as potential future products. Glossary, definitions for relevant terminology used by experts in the domain Customers, identification of the internal and/or external clients of the domain (i.e., those that will use the domain assets). Organizations involved, the internal departments or groups that have some interaction with the domain. Technology, on which the domain is based.
18
10/13/2012
Domain name:
Metal Processing Lines
Domain synopsis:
SW applications for the supervision and control of metal
processing lines. The Metal Processing Lines includes the Programming Logic Control (PLC), the SCADA program (supervision), electric diagrams
Glossary example
system for metal transforming: the input to the line is a steel coil, whereas the output may be a set of sub-coils in the case of a slitting line, or a set of steel sheets in the case of a cut-to-length line.
Processing Line.
SCADA:
Supervisory Control and Data Acquisition. SW for graphical applications for
19
10/13/2012
Customers:
Gonvarri (Spain-Barcelona) , Siderar (Argentina), Gonvauto (Spain-Navarra), Gonvarri (Brasil), Paper production companies, Iron Industries
Organizations involved:
Production department, Investigation and Development department
Technology:
Siemens PLC, Rockwell PLC, SCADA supervision, XML
departments within the project The company had already product orientation policy (generic program with manual derivation) The definition may include criteria to determine if a product belongs to a domain
20
10/13/2012
Reasoning on legacy products can help in determining the domain characteristics. However, they are not the only source of information: it is necessary to look at the future and make forecasts
A generic product has been defined from the legacy
Variability was not managed to every level Domain definition is an iterative process. It will not come out perfect the first time!
Domain definition required three iterations before it
was established
21
10/13/2012
Commonality examples
Variability examples
22
10/13/2012
For commonalities
Compare existing legacy systems and look for
essential features, develop a list of features for each system, determine what is common
The commonality has been largely extracted from the generic program (legacy systems)
Do not go into much detail, ask yourself if the
For variabilities
Derive variabilities from commonalities.
The decisions concerning each machine has been standardized even if some decisions are not applicable on every machines. In this way, combinatorial explosion can be avoided.
23
10/13/2012
24
10/13/2012
Decision types
Simple decisions:
Decisions which are only restricted by the type of data that their
Restrictions on decisions:
There are two types of restriction that can constrain
the value of a simple decision: min-max, which establishes the
minimum and maximum values that determine the range of the decision; and list of values, which establishes the specific set of values that the decision may adopt. A list of values can be single choice or multiple choice.
Collection of decisions:
Set of decisions that can be made by the customer several
times.
Group of decisions:
Organizational element that allows to structure the decisions in
meaningful sets
Decision characteristics
A name identifying uniquely the decision A description describing the way to make the decision A range constraining the value of the open decision may or may not include the null value, meaning that the value of the decision is irrelevant or not applicable. Other elements are:
default value binding role that should assign a value, binding time, representing the latest time at which it must
be bound and
binding order, establishing in what order the decisions with
25
10/13/2012
Dependency
Decision dependencies:
One decision D depends on a set of decisions SD if
the set of valid values of D is restricted in some way by the values that the decisions in SD may assume.
Cyclic decision dependencies are not allowed. A decision is fully dependent if its value is determined by some of the values of other decisions. Fully dependent decisions for all of the values of other decisions are actually derived decisions and should not be main part of the decision model
Dependency example
The value of some decisions depend on the value of other decisions: if Speed Line = 2 then
else
Uncoil Machine Reductor = no
26
10/13/2012
Domain definition
Problems:
Domain too large
Domain very difficulty to analyze Analysis over-sized
Solution
Partition the domain into smaller sub-domains
Problems:
Difficulty to identify what is common and what is
variable Difficulty to stop the analysis to the appropriate level (most of the time people go so deeper) Difficulty to structure the identified variability Strong work to write the documentation dealing with the C&V
Solution
Standardization of the products help considerably to
identify the commonality Provide small examples of C&V identification for a sub-domain well know by the involved people in this activity
27
10/13/2012
DM definition
Problems:
Big number of decisions become unmanageable
Too many dependencies among decisions
Solution
Classify and group decisions Concentrate on user-relevant decisions Iterate the process: not everything will be right the
28
10/13/2012
Tree Structure
Variability 1 Domain Compone nt 1 Subsystem Domain Compone nt 2
Commonaliti es Commonaliti es
Client Type 1 Client Type 2 Client Type 1 Client Type 2 Variability 1.1 Variability 1.2 Client Type 1 Client Type 2
Table Structure
Subsystem 001
Domain Comp. Dec. ID Name Descriptio n Type Depende ncy Client Type/ Cat/Nam e Role Time Range Default Order
29
10/13/2012
Offers, proposals Project plans Requirements Architectures Design Source code etc
30
10/13/2012
Variation point
Variation point:
Identifies a point in a domain asset in which there is a difference
an expression involving the actual value of the associated set of variation parameters.
Condition:
the variation depends on a Boolean value calculated as the result
of an expression involving the actual values of the associated set of variation parameters.
Repetition:
the variation consists in repeating a section a number of times
calculated as the result of an expression involving the actual values of the associated set of variation parameters
31
10/13/2012
Techniques for capturing variability Techniques may depend on the kind of asset
Requirements level
Template documents Multiple-choice documents
Design principle
Structure your asset in components to minimize the impact of variations. Localize the differences in variation points, using abstraction and information hiding. Examples
Layered architecture: layer n+1 is independent of the
32
10/13/2012
Flexible components
Flexible component: a representation of a set of similar software components in one single source using variation points. A flexible component is defined by the following elements:
An interface with a set of variation parameters A declaration with a set of used (elementary) flexible
components An implementation
Variation parameters: they univocally specify one single application component among the set of similar components represented by the flexible component
33
10/13/2012
Capturing variability
Flexible component approach may be applied to any non sw document. Domain assets may be hierarchically structured No need to build domain assets for the complete domain No need to specify completely how the variation impacts on the work-product Question: How should we deal with the decision regarding the language in a natural language document?
34
10/13/2012
35