Unit 12
Unit 12
Unit 12
ENGINEERING
Structure Page Nos.
12.0 Introduction 49
12.1 Objectives 50
12.2 Evolution of Formal Methods 50
12.3 Use of Mathematics in Software Development 51
12.4 Formal Methods 51
12.4.1 What Can Be Formally Specified?
12.4.2 Goals of Formal Specification
12.5 Application Areas 53
12.6 Limitations of Formal Specification Using Formal Methods 54
12.7 Cleanroom Software Engineering 55
12.8 Conventional Software Engineering Models Vs. Cleanroom Software
Engineering Model 56
12.9 Cleanroom Software Engineering Principles, Strategy and
Process Overview 56
12.10 Limitations of Cleanroom Engineering 57
12.11 Similarities and Differences between Cleanroom and OO Paradigm 58
12.12 Software Reuse and its Types 58
12.13 Why Component based Software Engineering? 59
12.14 Component based Software Engineering (CBSE) Process 60
12.14.1 Domain Engineering
12.14.2 Component based Development
12.15 Component Technologies Available 62
12.16 Challenges for CBSE 62
12.17 Reengineering: An Introduction 64
12.18 Objectives of Reengineering 64
12.19 Software Reengineering Life Cycle 65
12.20 Summary 66
12.21 Solutions / Answers 67
12.22 Further Readings 68
12.23 Glossary 68
12.0 INTRODUCTION
In the first few units we have studied the various methods for conventional software
engineering. Software engineering methods can be categorised on a “formality
spectrum.” The analysis and design methods discussed previously would be placed at
the informal to moderately rigorous end of the spectrum. In these methods, a
combination of diagrams, text, tables, and simple notation is used to create analysis
and design models.
At the other end of the formality spectrum are formal methods, which are completely
mathematical in form. A specification and design are described using a formal syntax
and semantics that specify system function and behaviour. Other specialised models
being the Cleanroom software engineering, component-based software engineering,
re-engineering and reverse engineering.
Harlan Mills has developed the Cleanroom software engineering methodology, which
is an approach for integrating formal methods into the lifecycle. The Cleanroom
approach combines formal methods and structured programming with Statistical
Process Control (SPC), the spiral lifecycle and incremental releases, inspections, and
software reliability modeling. It fosters attitudes, such as emphasising defect
prevention over defect removal, that are associated with high quality products in non-
software fields.
49
Web, Mobile and
CASE tools In most engineering disciplines, systems are designed by composition (building
system out of components that have been used in other systems). Software
engineering has focused on custom development of components. To achieve better
software quality, more quickly, at lower costs, software engineers are beginning to
adopt systematic reuse as a design process. There are various ways to achieve this and
one of the models is the Component-based software engineering.
Let us study the various specialised software engineering models like the formal
method, Cleanroom engineering, component-based engineering, re-engineering and
reverse engineering in this unit.
12.1 OBJECTIVES
After going through this unit, you should be able to:
understand the pitfalls of the conventional software engineering;
know various advanced methods of software engineering – their advantages and
drawbacks;
describe the methodology of formal methods and Cleanroom software
engineering, and
discuss the Re-engineering and Reverse engineering process.
51
Web, Mobile and The major concerns of the formal methods are as follows:
CASE tools
i) The correctness of the problem
o producing software that is “correct” is famously difficult;
o by using rigorous mathematical techniques, it may be possible to make
probably correct software.
ii) Programs are mathematical objects
o they are expressed in a formal language;
o they have a formal semantics;
o programs can be treated as mathematical theories.
Formal methods support precise and rigorous specifications of those aspects of a
computer system capable of being expressed in the language. Since defining what a
system should do, and understanding the implications of these decisions, are the most
troublesome problems in software engineering, this use of formal methods has major
benefits. In fact, practitioners of formal methods frequently use formal methods solely
for recording precise specifications, not for formal verifications.
Formal methods were originally developed to support verifications, but higher interest
currently exists in specification methods. Several methods and languages can be used
for specifying the functionality of computer systems. No single language, of those
now available, is equally appropriate for all methods, application domains, and
aspects of a system. Thus, users of formal specification techniques need to understand
the strength and weaknesses of different methods and languages before deciding on
which to adopt. The distinction between a specification method and a language is
fundamental. A method states what a specification must say. A language determines
in detail how the concepts in a specification can be expressed. Some languages
support more than one method, while most methods can be used in several
specification languages.
Some of the most well-known formal methods consist of or include specification
languages for recording a system’s functionality. These methods include:
Z (pronounced “Zed”)
Communicating Sequential Processes (CSP)
Vienna Development Method (VDM)
Larch
Formal Development Methodology (FDM)
12.4.1 What can be Formally Specified?
Formal methods can include graphical languages. Data Flow Diagrams (DFDs) are the
most well-known graphical technique for specifying the function of a system. DFDs
can be considered a semi-formal method, and researchers have explored techniques
for treating DFDs in a completely formal manner. Petri nets provide another well-
known graphical technique, often used in distributed systems. Petri nets are a fully
formal technique.
Finally, finite state machines are often presented in tabular form. This does not
decrease the formalism in the use of finite state machines. So the definition of formal
methods provided earlier is quite encompassing.
Software engineers produce models and define the properties of systems at several
levels of abstraction. Formal methods can be employed at each level. A specification
should describe what a system should do, but not how it is done. More details are
provided in designs, with the source code providing the most detailed model.
For example, Abstract Data Types (ADTs) frequently are employed at intermediate
levels of abstraction. ADTs, being mathematical entities, are perfect candidates for
formal treatment and are often so treated in the literature.
Formal methods are not confined to the software components of large systems.
System engineers frequently use formal methods. Hardware engineers also use formal
methods, such as VHSIC Hardware Description Language (VHDL) descriptions, to
52
model integrated circuits before fabricating them. The following section lists the goals Advanced Topics in
Software Engineering
of the formal specification.
12.4.2 Goals of Formal Specification
Once a formal description of a system has been produced, what can be done with it?
Usable formal methods provide a variety of techniques for reasoning about
specifications and drawing implications. The completeness and consistency of a
specification can be explored. Does a description imply a system should be in several
states simultaneously? Do all legal inputs yield one and only one output? What
surprising results, perhaps unintended, can be produced by a system? Formal methods
provide reasoning techniques to explore these questions. Do lower level descriptions
of a system properly implement higher level descriptions? Formal methods support
formal verification, the construction of formal proofs that an implementation satisfies
a specification. The possibility of constructing such formal proofs was historically the
principal driver in the development of formal methods. Prominent technology for
formal verification includes E Dijkstra's “weakest precondition” calculus and Harlan
Mills’ “functional correctness” approach which we are not going to discuss here. The
following are the goals of the formal specification:
Removal of ambiguity: The formal syntax of a specification language enables
requirements or design to be interpreted in only one way, eliminating the
ambiguity that often occurs when using natural language. Removes ambiguity
and encourages greater rigour in the early stages of the software engineering
process.
Consistency: Facts stated in one place should not be contradicted in
another. This is ensured by mathematically proving that initial facts can be
formally mapped (by inference) into later statements later in the specification.
Completeness: This is difficult, even when using formal methods. Some
aspects of a system may be left undefined by mistake or by intention. It is
impossible to consider every operational scenario in a large, complex system.
Let us see the drawbacks of the formal specifications in the next section.
53
Web, Mobile and
CASE tools 12.6 LIMITATIONS OF FORMAL SPECIFICATION
USING FORMAL METHODS
Some problems exist, however formal specification focuses primarily on function and
data. Timing, control, and behavioural aspects of a problem are more difficult to
represent. In addition, there are elements of a problem (e.g., HCI, the human-machine
interface) that are better specified using graphical techniques. Finally, a specification
using formal methods is more difficult to learn than other analysis methods. For this
reason, it is likely that formal mathematical specification techniques will be
incorporated into a future generation of CASE tools. When this occurs,
mathematically-based specification may be adopted by a wider segment of the
software engineering community. The following are the major drawbacks:
Cost: It can be almost as costly to do a full formal specification as to do all the coding.
The solution for this is, don’t formally specify everything, just the subsystems you
need to (hard, complex, or critical).
Complexity: Not everybody can read formal specifications (especially customers and
users). The solution is to provide a very good and detailed documentation. No one
wants to read pure formal specifications–formal specifications should always be
interspersed with natural language (e.g. English) explanation.
Deficiencies of Less Formal Approaches: The methods of structured and object-
oriented design discussed previously make heavy use of natural language and a
variety of graphical notations. Although careful application of these analysis and
design methods can and does lead to high–quality software, sloppiness in the
application of these methods can create a variety of problems which are:
Contradictions: statements that are at variance with one another.
Ambiguities : statements that can be interpreted in a number of ways
Vagueness : statements that lack precision, and contribute little information.
Incomplete statements : a description is not functionally complete.
Mixed levels of abstraction : statements with high and low levels of detail are
interspersed, which can make it difficult to comprehend the functional
architecture.
This method gained popularity among the software developers who must build safety-
critical software like aircraft avionics and medical devices. But the applicability in the
business environment has not clicked.
Let us study the Cleanroom Software Engineering in the next section.
56
Certification: Once verification, inspection, and usage testing are complete and all Advanced Topics in
Software Engineering
defects removed, the increment is certified as ready for integration.
Figure 12.1 depicts the Cleanroom software engineering development overview:
Develop
operational Design Test
profile statistical integrated
tests system
59
Web, Mobile and the team now examines the requirements to determine what subset is directly
CASE tools amenable to composition, rather than construction.
For each requirement, we should question:
Whether any commercial off-the-shelf (COTS) components available to
implement the requirement?
Whether internally developed reusable components available to implement the
requirement?
Whether interfaces for available components compatible within the architecture
of the system to be built?
The team will attempt to modify or remove those system requirements that cannot be
implemented with COTS or in-house components. This is not always possible or
practical, but reduces the overall system cost and improves the time to market of the
software system. It can often be useful to prioritise the requirements, or else
developers may find themselves coding components that are no longer necessary as
they have been eliminated from the requirements already.
The CBSE process identifies not only candidate components but also qualifies each
component’s interface, adapts components to remove architectural mismatches,
assembles components into selected architectural style, and updates components as
requirements for the system change.
Two processes occur in parallel during the CBSE process. These are:
Domain Engineering
Component Based Development.
CBSE is facing many challenges today, some of these are summarised as follows:
Dependable systems and CBSE: The use of CBD in safety-critical domains,
real-time systems, and different process-control systems, in which the reliability
requirements are more rigorous, is particularly challenging. A major problem
with CBD is the limited possibility of ensuring the quality and other non-
functional attributes of the components and thus our inability to guarantee
specific system attributes.
Tool support: The purpose of Software Engineering is to provide practical
solutions to practical problems, and the existence of appropriate tools is
essential for a successful CBSE performance. Development tools, such as
Visual Basic, have proved to be extremely successful, but many other tools are
yet to appear – component selection and evaluation tools, component
repositories and tools for managing the repositories, component test tools,
component-based design tools, run-time system analysis tools, component
configuration tools, etc. The objective of CBSE is to build systems from
components simply and efficiently, and this can only be achieved with extensive
tool support.
Trusted components: Because the trend is to deliver components in binary
form and the component development process is outside the control of
component users, questions related to component trustworthiness become of
great importance.
Component certification: One way of classifying components is to certificate
them. In spite of the common belief that certification means absolute
trustworthiness, it is in fact only gives the results of tests performed and a
description of the environment in which the tests were performed. While
certification is a standard procedure in many domains, it is not yet established in
software in general and especially not for software components.
Composition predictability: Even if we assume that we can specify all the
relevant attributes of components, it is not known how these attributes
determine the corresponding attributes of systems of which they are composed.
The ideal approach, to derive system attributes from component attributes is still
a subject of research. A question remains - “Is such derivation at all possible?
Or should we not concentrate on the measurement of the attributes of
component composites?”
Requirements management and component selection: Requirements
management is a complex process. A problem of requirements management is
that requirements in general are incomplete, imprecise and contradictory. In an
in-house development, the main objective is to implement a system which will
satisfy the requirements as far as possible within a specified framework of
different constraints. In component-based development, the fundamental
approach is the reuse of existing components. The process of engineering
requirements is much more complex as the possible candidate components are
usually lacking one or more features which meet the system requirements
exactly. In addition, even if some components are individually well suited to the
62
system, it is not necessary that they do not function optimally in combination Advanced Topics in
Software Engineering
with others in the system- or perhaps not at all. These constraints may require
another approach in requirements engineering – an analysis of the feasibility of
requirements in relation to the components available and the consequent
modification of requirements. As there are many uncertainties in the process of
component selection there is a need for a strategy for managing risks in the
components selection and evolution process.
Long-term management of component-based systems: As component-based
systems include sub-systems and components with independent lifecycles, the
problem of system evolution becomes significantly more complex. CBSE is a
new approach and there is little experience as yet of the maintainability of such
systems. There is a risk that many such systems will be troublesome to maintain.
Development models: Although existing development models demonstrate
powerful technologies, they have many ambiguous characteristics, they are
incomplete, and they are difficult to use.
Component configurations: Complex systems may include many components
which, in turn, include other components. In many cases compositions of
components will be treated as components. As soon as we begin to work with
complex structures, the problems involved with structure configuration pop up.
Modification
Forward Engineering
System Requirements System Requirements
Reverse Engineering
Re specify
Re design
System Design System Design
Source code analysis phase: This phase refers to the identification of the parts of the
code that are responsible for violations of requirements originally specified in the
system’s analysis phase. This task encompasses the design of methods and tools to
inspect, measure, rank, and visualize software structures. Detecting error prone code
that deviates from its initial requirement specifications requires a way to measure
where and by how much these requirements are violated. Problem detection can be
based on a static analysis of the legacy system (i.e., analysing its source code or its
design structure), but it can also rely on a dynamic usage analysis of the system (i.e.,
an investigation of how programs behave at run-time).
Remediation phase: It refers to the selection of a target software structure that aims
to repair a design or a source code defect with respect to a target quality requirement.
Because legacy applications have been evolved in such a way that classes, objects,
and methods may heavily depend on each other, a detected problem may have to be
decomposed into simpler sub-problems.
Evaluation phase refers to the process of assessing the new system as well as
establishing and integrating the revised system throughout the corporate operating
environment. This might involve the need for training and possibly the need for
adopting a new improved business process model.
Such a reengineering life-cycle yields a reengineering process. First, the source code
is represented as an Abstract Syntax Tree. The tree is further decorated with
annotations that provide linkage, scope, and type information. Once software artifacts
have been understood, classified and stored during the reverse engineering phase, their
behaviour can be readily available to the system during the forward engineering phase.
Then, the forward engineering phase aims to produce a new version of a legacy
system that operates on the target architecture and aims to address specific
maintainability or performance enhancements. Finally, we use an iterative procedure
to obtain the new migrant source code by selecting and applying a transformation
which leads to performance or maintainability enhancements. The transformation is
selected from the soft-goal interdependency graphs. The resulting migrant system is
then evaluated and the step is repeated until the specific quality requirements are met.
65
Web, Mobile and 2) What is Reverse Engineering?
CASE tools
……………………………………………………………………………………
……………………………………………………………………………………
12.20 SUMMARY
In this unit, we have gone through the Formal Methods, Cleanroom software
engineering, Component Based Software Engineering and the Software
Reengineering process.
Formal methods promise to yield benefits in quality and productivity. They provide
an exciting paradigm for understanding software and its development, as well as a set
of techniques for use by software engineers. Formal methods can provide more
precise specifications, better internal communication, and an ability to verify designs
before executing them during test, higher quality and productivity. To get their full
advantages, formal methods should be incorporated into a software organisation’s
standard procedures. Software development is a social process, and the techniques
employed need to support that process. How to fully fit formal methods into the
lifecycle is not fully understood. Perhaps there is no universal answer, but only
solutions that vary from organisation to organisation.
Harlan Mills has developed the Cleanroom methodology, which is one approach for
integrating formal methods into the lifecycle. The Cleanroom approach combines
formal methods and structured programming with Statistical Process Control (SPC),
the spiral lifecycle and incremental releases, inspections, and software reliability
modeling. It fosters attitudes, such as emphasising defect prevention over defect
removal, that are associated with high quality products in non-software fields.
Component Based Software Engineering introduced major changes into design and
development practices, which introduces extra cost. Software engineers need to
employ new processes and ways of thinking – this, too, can introduce extra cost in
training and education. However, initial studies into the impact of CBSE on product
quality, development quality and cost, show an overall gain, and so it seems likely
that continuing these practices in the future will improve software development. It is
still not clear how exactly CBSE will mature, but it is clear that it aids in the
development of today’s large-scale systems, and will continue to aid in the
development of future systems, and is the perfect platform for addressing the
requirements of modern businesses.
66
iii) Automated programming: Automating the process of program Advanced Topics in
Software Engineering
generation.
Check Your Progress 2
1) The Cleanroom methodology is an iterative, life-cycle approach focused on
software quality, especially reliability. Begun by Harlan Mills, it combines
formal specifications, structured programming, formal verifications, formal
inspections, functional testing based on random selection of test data,
software reliability measurement, and Statistical Process Control (SPC) in an
integrated whole. The Cleanroom approach fosters attitudes, such as
emphasising defect prevention over defect removal, that are associated with
high quality products in fields other than software.
2) Statistical Process Control (SPC) is commonly used in manufacturing,
involves continuous process monitoring and improvement to reduce the
variance of outputs and to ensure that the process remains under control.
3) Benefits of Cleanroom software engineering include significant improvements
in correctness, reliability, and understandability. These benefits usually
translate into a reduction in field-experienced product failures, reduced cycle
time, ease of maintenance, and longer product life.
4) Cleanroom techniques are too theoretical, too mathematical, and too radical
for use in real software development. They rely on correctness verification
and statistical quality control rather than unit testing (a major departure from
traditional software development). Organisations operating at the ad hoc level
of the Capability Maturity Model do not make rigorous use of the defined
processes needed in all phases of the software life cycle.
Check Your Progress 3
1) Benefits of software reuse are:
Increased Reliability: components already exercised in working systems
Reduced Process Risk: Less uncertainty in development costs
Effective Use of components: Reuse components instead of people
Standards Compliance: Embed standards in reusable components
Accelerated Development: Avoid custom development and speed up delivery.
2) COTS systems usually have a complete applications library and also offers an
applications programming interface (API). These are helpful in building large
systems by integrating COTS components is a viable development strategy for
some types of systems (e.g., E-commerce or video games).
Check Your Progress 4
1) Software reengineering is a process that aims to either
i) Improve understanding of a piece of software, or
ii) Prepare for an improvement in the software itself (e.g., increasing its
maintainability or reusability).
As the name suggests software reengineering is applied to existing pieces of software,
in an after-the-fact fashion, via the reapplication of an engineering process. Software
reengineering is a very wide-ranging term that encompasses a great many activities.
For example, software reengineering could involve refactoring a piece of software,
redocumenting it, reverse engineering it or changing its implementation language.
2) Reverse engineering is a process which is used to improve the understanding of
a program. So-called program comprehension is crucial to maintenance.
Approximately 50% of the development time of programmers is spent
understanding the code that they are working on. Reverse engineering often
involves the production of diagrams. It can be used to abstract away irrelevant
67
Web, Mobile and implementation and design details to recover the original requirements of the
CASE tools program.
Mc Graw-Hill.
Reference websites
http://www.rspa.com
http://www.ieee.org
12.23 GLOSSARY
Software Reengineering: The examination and alteration of an existing subject
system to reconstitute it in a new form. This process encompasses a combination of
sub-processes such as reverse engineering, restructuring, redocumentation, forward
engineering, and retargeting.
Reverse Engineering: The engineering process of understanding, analysing, and
abstracting the system to a new form at a higher abstraction level.
Forward Engineering: Forward engineering is the set of engineering activities that
consume the products and artifacts derived from legacy software and new
requirements to produce a new target system.
Data Reengineering: Tools that perform all the reengineeering functions associated
with source code (reverse engineering, forward engineering, translation,
redocumentation, restructuring / normalisation, and retargeting) but act upon data
files.
Redocumentation: The process of analysing the system to produce support
documentation in various forms including users manuals and reformatting the
systems’ source code listings.
Restructuring: The engineering process of transforming the system from one
representation form to another at the same relative abstraction level, while preserving
the subject system’s external functional behavior.
68