Assignment-2 Ques:1 List The Principles of OOSE With Its Concepts. Ans:1
Assignment-2 Ques:1 List The Principles of OOSE With Its Concepts. Ans:1
Encapsulation
Encapsulation is the mechanism of hiding of data implementation by restricting access to public
methods. Instance variables are kept private and accessor methods are made public to achieve
this.
Abstraction
Abstract means a concept or an Idea which is not associated with any particular instance. Using
abstract class/Interface we express the intent of the class rather than the actual
implementation. In a way, one class should not know the inner details of another in order to
use it, just knowing the interfaces should be good enough.
Inheritance
Inheritances expresses “is-a” and/or “has-a” relationship between two objects. Using
Inheritance, in derived classes we can reuse the code of existing super classes. In Java, concept
of “is-a” is based on class inheritance (using extends) or interface implementation
(using implements).
Polymorphism
It means one name many forms. It is further of two types — static and dynamic. Static
polymorphism is achieved using method overloading and dynamic polymorphism using method
overriding. It is closely related to inheritance. We can write a code that works on the superclass,
and it will work with any subclass type as well.
Ques:2 What are the metrics of Process? Explain it with example?
Ans:2
Process Metrics: -These are metrics that pertain to Process Quality. They are used to measure
the efficiency and effectiveness of various processes.
Types of Process Metrics: -
2.Cost of poor quality: It is the cost of implementing imperfect processes and products.
Cost of poor quality = rework effort/ total effort x 100.
3.Defect density: It is the number of defects detected in the software during development
divided by the size of the software (typically in KLOC or FP)
Defect density for a project = Total number of defects/ project size in KLOC or FP
4.Review efficiency: defined as the efficiency in harnessing/ detecting review defects in the
verification stage.
Review efficiency = (number of defects caught in review)/ total number of defects caught) x 100.
6.Defect removal efficiency: Quantifies the efficiency with which defects were detected and
prevented from reaching the customer.
Defect removal efficiency = (1 – (total defects caught by customer/ total number of defects)) x
100.
7.Residual defect density = (total number of defects found by a customer)/ (Total number of
defects including customer found defects) x 100.
A method is implemented in a system by means of one or more operators. Operators are used
to manipulate the attributes corresponding to objects and may result in changes of object states,
i.e., events. On the other hand, events may trigger opera- tors as well. The sequence of states of
the different objects can be described by a state-transition or event diagram. Such an event
diagram may describe the links between operators and events. An operator may be regarded as
the way in which a method is implemented in the software. Any given operator may be part of
several methods. Some methods may be very basic and can be used for simple manipulations of
objects, e.g., a pairwise interchange of two jobs in a schedule. Some methods may be very
sophisticated or high level. They may be intricate heuristics for application on given sets of jobs
(objects) in given machine environments (also objects). The application of a method to an object
usually triggers an event.
The application of a method to an object may cause information to be transmitted from one
object to another. In what follows, such information is referred to as a message, Messages
represent information (or content) that are transmitted from one object (for example, a
schedule) via a method to another object (for example, a user interface display). A message may
consist of simple attributes or of an entire object. Messages are transmitted at the times that
events occur (caused by the application of methods to objects). Messages have also been
referred to in the literature as memos. The transmission of messages from one object to another
can be described by a transition event diagram. Such transmissions require the specification of
protocols. However, the specification of protocols is at a level of detail of system design that we
will not address in this paper. Figure 2 depicts the interplay between objects, methods and
messages. In order to see the sometimes-complicated relationships between objects, methods
and messages, consider the following example of a somewhat specialized object, a so- called
agent object. This very specialized object usually contains other objects, e.g., machines, jobs and
so on, as well as one or more methods. An input message into such an object is the states of one
or more objects, while the output message may be the states of the same objects or other
objects. An agent object usually performs a decision-making function.
A scheduling system may be object-oriented in its conceptual design and/or in its development.
A scheduling system is object-oriented in its conceptual design if the design of the system is
object-oriented throughout. The design being object- oriented throughout implies that every
concept used and every functionality of the system is either an object or a method of an object
(whether it is in the data or knowledge base, the algorithm library, the schedule generator or the
user interfaces). Even the largest modules within the system are objects, including the algorithm
library and the user interface modules. A scheduling system is object-oriented in it development
if only the more detailed design aspects are object-oriented and the code is based on a
programming language with object-oriented extensions, e.g., C++. Many scheduling systems
developed in the past have object-oriented aspects and many systems tend to be object-oriented
in their development. A number of these systems also have conceptual design aspects that are
object oriented.
1 Creational Patterns
These design patterns provide a way to create objects while hiding the creation logic, rather
than instantiating objects directly using new operator. This gives program more flexibility in
deciding which objects need to be created for a given use case.
2 Structural Patterns
These design patterns concern class and object composition. Concept of inheritance is used
to compose interfaces and define ways to compose objects to obtain new functionalities.
3 Behavioral Patterns
These design patterns are specifically concerned with communication between objects.
4 J2EE Patterns
These design patterns are specifically concerned with the presentation tier. These patterns
are identified by Sun Java Center.
1)Abstraction: - Abstraction refers to a powerful design tool, which allows software designers
to consider components at an abstract level, while neglecting the implementation details of the
components. IEEE defines abstraction as 'a view of a problem that extracts the
essential information relevant to a particular purpose and ignores the remainder of the
information.' The concept of abstraction can be used in two ways: as a process and as an entity.
As a process, it refers to a mechanism of hiding irrelevant details and representing only the
essential features of an item so that one can focus on important things at a time. As an entity, it
refers to a model or view of an item.
There are three commonly used abstraction mechanisms in software design, namely, functional
abstraction, data abstraction and control abstraction. All these mechanisms allow us to control
the complexity of the design process by proceeding from the abstract design model to concrete
design model in a systematic manner.
1. Functional abstraction: This involves the use of parameterized subprograms. Functional
abstraction can be generalized as collections of subprograms referred to as 'groups'. Within these
groups there exist routines which may be visible or hidden. Visible routines can be used within
the containing groups as well as within other groups, whereas hidden routines are hidden from
other groups and can be used within the containing group only.
2. Data abstraction: This involves specifying data that describes a data object. For example, the
data object window encompasses a set of attributes (window type, window dimension) that
describe the window object clearly. In this abstraction mechanism, representation and
manipulation details are ignored.
3. Control abstraction: This states the desired effect, without stating the exact mechanism of
control. For example, if and while statements in programming languages (like C and C++) are
abstractions of machine code implementations, which involve conditional instructions. In the
architectural design level, this abstraction mechanism permits specifications of sequential
subprogram and exception handlers without the concern for exact details of implementation.
2.Architecture: - Software architecture refers to the structure of the system, which is composed
of various components of a program/ system, the attributes (properties) of those components
and the relationship amongst them. The software architecture enables the software engineers
to analyze the software design efficiently. In addition, it also helps them in decision-making and
handling risks. The software architecture does the following.
• Provides an insight to all the interested stakeholders that enable them to communicate
with each other
• Highlights early design decisions, which have great impact on the software engineering
activities (like coding and testing) that follow the design phase
• Creates intellectual models of how the system is organized into components and how
these components interact with each other. Currently, software architecture is
represented in an informal and unplanned manner. Though the architectural concepts
are often represented in the infrastructure (for supporting particular architectural styles)
and the initial stages of a system configuration, the lack of an explicit independent
characterization of architecture restricts the advantages of this design concept in the
present scenario.
Note that software architecture comprises two elements of design model, namely, data design
and architectural design.
c) Idioms: These patterns are low-level patterns, which are programming-language specific. They
describe the implementation of a software component, the method used for interaction among
software components, etc., in a specific programming language. Note that idioms are often
termed as coding patterns.
4.Modularity: - Modularity is achieved by dividing the software into uniquely named and
addressable components, which are also known as modules. A complex system (large program)
is partitioned into a set of discrete modules in such a way that each module can be developed
independent of other modules. After developing the modules, they are integrated together to
meet the software requirements. Note that larger the number of modules a system is divided
into, greater will be the effort required to integrate the modules.
Modularizing a design helps to plan the development in a more effective manner, accommodate
changes easily, conduct testing and debugging effectively and efficiently, and conduct
maintenance work without adversely affecting the functioning of the software.
5.Information Hiding: - Modules should be specified and designed in such a way that the data
structures and processing details of one module are not accessible to other modules. They pass
only that much information to each other, which is required to accomplish the software
functions. The way of hiding unnecessary details is referred to as information hiding. IEEE defines
information hiding as 'the technique of encapsulating software design decisions in modules in
such a way that the module's interfaces reveal as little as possible about the module's inner
workings; thus, each module is a 'black box' to the other modules in the system.
8.Structural Portioning: - When the architectural style of a design follows a hierarchical nature,
the structure of the program can be partitioned either horizontally or vertically.
In horizontal partitioning, the control modules are used to communicate between functions and
execute the functions. Structural partitioning provides the following benefits.
• The testing and maintenance of software becomes easier.
• The negative impacts spread slowly.
• The software can be extended easily.
Besides these advantages, horizontal partitioning has some disadvantage also. It requires to pass
more data across the module interface, which makes the control flow of the problem more
complex. This usually happens in cases where data moves rapidly from one function to another.
9.Concurrency: - Computer has limited resources and they must be utilized efficiently as much
as possible. To utilize these resources efficiently, multiple tasks must be executed concurrently.
This requirement makes concurrency one of the major concepts of software design. Every system
must be designed to allow multiple processes to execute concurrently, whenever possible. For
example, if the current process is waiting for some event to occur, the system must execute some
other process in the meantime.
Design Principle: -
Ques:6 How OOA and OOD models helps while Testing a software?
Ans:6 OO Testing begins by evaluating the correctness and consistency of the OOA and OOD
models.
o The nature of OO software changes testing strategies.
o the concept of the ‘unit’ broadens due to encapsulation
o cannot test class methods in isolation due to object collaborations and inheritance
o class testing is driven by its methods and behavior (states).
o Conventional integration testing (top-down and bottom-up) are not applicable to OO
software.