III Ooad
III Ooad
Dependency
Dependency is a relationship between two things in which change in one element also affects the
other.
Association
Association is basically a set of links that connects the elements of a UML
model. It also describes how many objects are taking part in that relationship.
Generalization
Generalization can be defined as a relationship which connects a specialized element with a
generalized element. It basically describes the inheritance relationship in the world of objects
Realization
Realization can be defined as a relationship in which two
elements are connected. One element describes some responsibility, which is not implemented
and the other one implements them. This relationship exists in case of interfaces.
UNIT -I1
1. Define pattern and design pattern.
Pattern can be defined as a named, and well known problem solution pair, which can be applied in
new context, and guides on how to apply it in current situations and discussion of its trade-offs,
implementation, variations and so on.
Design Pattern: The common software problem and the corresponding solutions to these problems can
be represented in a formal manner. This representation is given by a design pattern.
2 An element with low coupling is not An element with high is responsible for doing o
dependent upon too many objects. thing at a time. Hence high cohesion is preferre
Hence normally low coupling is good design
preferred for good design
Knowing
7. Define polymorphism.
In object-oriented programming, polymorphism (from the Greek meaning "having multiple
forms") is the characteristic of being able to assign a different meaning or usage to something in different
contexts - specifically, to allow an entity such as a variable, a function, or an object to have more than one form.
9. Define indirection.
To avoid direct coupling between objects, assign an intermediate object as a mediator. Recall that
coupling between two classes of different subsystems can introduce maintenance problems. Another
possibility is that two classes would be otherwise reusable (in other contexts) except that one has to know
of the other.
Solution: Convert the original interface of component into another interface through intermediate
adapter object.
Problem: How to keep object focused ,understandable and manageable, and as a side effect, support low
coupling?
Nine GRASP patterns: Creator, Information Expert, Low Coupling, Controller, High Cohesion,
Indirection, Polymorphism, Protected Variations ,Pure Fabrication.
UNIT-III
17. List out the relationships used in use cases diagram. May -12
Include relationship.
External relationship.
Generalization.
Inception is the initial short step to establish a common vision and basic scope for the project. It will
include analysis of perhaps 10% of the use cases, analysis of the critical non-functional requirement, creation of a
business case, and preparation of the development environment so that programming can start in the following
elaboration phase.
19 . What is generalization relationship?
It is a relationship in which one model element (the child) is based on another model element
Generalization relationships are used in class, component, deployment, and use-case diagrams to indicate that the
child receives all of the attributes, operations, and relationships that are defined in the parent
UNIT IV
4. Define a layer.
A layer is a very coarse-grained grouping of classes, packages, or subsystems that has cohesive responsibility
for a major aspect of the system. Layers are organized such that higher layers (such as the UI layer) call
upon services of lower layers, but not normally vice versa.
5. What is the use of system sequence diagram?
Following are the things that are carried out by the sequence diagram -
System sequence diagram are useful UML notations for depicting the behavior of the system.
The time based events are messages can also be represented by the sequence diagram.
The sequence diagrams are useful tool to represent what the system does and not how the does.
The sequence diagram is used as a tool to represent the system as a black box.
A stereotype represents a refinement of an existing modeling concept and is defined within a UML profile
informally, a collection of related stereotypes, tags, and constraints to specialize the use of the UML for a
specific domain or platform, such as a UML profile for project management or for data modeling. Eg.
destroy
The stereotype declares a set of tags, using the attribute syntax.
11. Define UML Package diagram. Dec- 13
Package diagram are used to illustrate the logical architecture of a system the layers,
subsystems, packages etc. A layer can be modeled as a UML package. A UML package diagram provides a
way to group elements. The group may contain classes, other packages, use cases and so on.
12. Define system operation.
Operation that the system as a black box component offers in its public interface is called
system operation. System operations can be identified while sketching System sequence diagrams. The
system sequence diagram show system events or I/O messages relative to the system.
13. What do you mean by synchronous and asynchronous call?
An asynchronous message call does not wait for a response. They are used in multi threaded
environments such as .Net and Java so that the new thread executions can be created and initiated. When a
task is being executed asynchronously, there is no need to wait for it to finish, before starting with another
task. In Synchronous message calls, the task has to be completed before starting another task.
14. Define Active class.
An active object runs on and controls its own thread of execution. Active classes are just
Classes which represents an independent flow of control. Active class shares the same properties as all the other
classes. When an active object is created, the associated flow of control is started. When the object is destroyed
the associated flow of control is terminated.
15. How to show methods in class diagram?
A UML method is the implementation of an operation. If constraints are defined, the
method must satisfy them. A method may be illustrated in class diagrams with a UML note symbol stereotype
with <<method>>.
16. Justify why class diagram is called static object modeling.
The UML class diagram does not have any dynamic elements and all the
representations are static. The classes and the methods in the classes do not change with respect to any external
criteria. The characteristics and the methods of a class are standard and constant and cannot be changed.
Therefore, the class diagram is called as static object modeling.
17. List the relationships used in class diagram.
The various relationships used in class diagrams are:
Association with multiplicities
Interface implementation
Inheritance
Dependency
Composition over Aggregation
18. Define singleton class with an example.
When exactly one instance of a class is allowed, it is called a singleton class. In UML
diagram, such a class can be marked with a I in the upper right corner of the name component
19. What is Logical Architecture?
The logical architecture is the large scale organization of the software classes into
packages, namespaces, subsystems and layers. Its called the logical architecture because theres no decision
about how these elements are deployed across different operating system processes or across physical
computers in a network. An architectural pattern expresses a fundamental structural organization schema for
software systems. It provides a set of predefined subsystems, specifies their responsibilities, and
includes rules and guidelines for organizing the relationships between them.
20. What are the types in layered architecture? List the layers in OO system.
Strict layered architecture
Relaxed layered architecture
Layers in OO architecture:
User Interface
Application Logic and Domain Objects
Technical Services
The UML interaction diagrams are used to illustrate how objects interact via messages. They
are used for dynamic object modeling. There are two common types: sequence and communication interaction
diagrams
The components that are involved in sequence diagrams are:
Lifeline boxes
A found message
Synchronous message
Asynchronous message
Execution specification bar
Frame with guard expression
Objects
Links
Messages
Sequence numbers
Conditional messages
Looping or iteration messages
UNIT- V
1. What is test driven development?
The test driven development or test first development method is promoted by extreme
programming method and is applicable to unified process and iterative methods, In TDD, the small piece of
code is produced and then tested. If it passes the test then further code is written and then tested. This
procedure is followed for the complete implementation of the system.
2. Enlist the approaches used for generating code from the design?
Various approaches used for generating code from the design are
Define class with methods and attributes from the class diagram.
Creating methods from the interaction diagram.
3. For mapping design to code, what are the fundamental criteria for the order of implementation?
While mapping the design to code, the fundamental criteria is classes need to be
implementation from least coupled to the most coupled.
4. What is the significance of exception and error handling in mapping design to code?
While implementing the code from the design, the exception and error handling is necessary
because on the occurrence of any undesired condition in the code , the code can crash suddenly , In order to
come out of such undesirable situation gracefully, the exception is raised
There are various issues in object oriented testing. Following questions lead to various issues in
object oriented testing-
The class is used in state chart in which the behavior of the object is represented.
Due to testing classes under the unit testing , the integration testing has clear goals.
7. What is the implication of inheritance in OO testing? What is remedy?
If the class is considered as unit in the OO testing, then having inheritance hierarchy
makes the testing complex because testing all the derived classes is not always possible. To avoid this
problem the classes are flattened, that means, there wont be inheritance at all, all the attribute or methods
that need to be inherited from super class to subclass need to be included in the subclasses explicitly.
Security testing: verify that protection mechanisms built into the system will protect from unauthorized
access such as hackers, disgruntled employees, fraudsters.
Stress testing: Place abnormal load on the system and then test the system.
Performance testing: Investigate the run- time performance within the context of an integrated
system.
Testing is the process of using suitable test cases to evaluate and ensure the quality of a
product by removing or sorting out the errors and discrepancies. It is also used to ensure that the product has
not regressed (such as, breaking a feature that previously worked).Testing involves various types and levels
based on the type of object/product under test.
Testing can be described as a process used for revealing defects in software, and for establishing
that the software has attained a specified degree of quality with respect to selected attributes.
In system testing the test data and the classes are combined as one and tested as a
whole to find out how the entire system works in the test or launch environment.
21. What are test cases? When we say test case is effective?
The usual approach to detecting defects in a piece of software is for the tester to
select a set of input data and then execute the software with the input data under a particular set of
conditions. The tester bundles this information into an item called test case.
Cluster testing - groups of collaborating classes are tested for interaction errors.
25. Why do conventional top down and bottom up integration testing methods have less meaning in an
object oriented context?
Basic object oriented software does not have a hierarchical control structure,
hence top down approach and bottom up approach of testing is of less use in testing. Therefore, thread
based, use based and cluster based testing methods are incorporated for performing integration testing.
The burden of ensuring quality to a product simply shifts from the developer to the
tester and then to the customer.
Testing is done when you run out of time or money.
Use a statistical model:
Assume that errors decay logarithmically with testing time
Measure the number of errors in a unit period
Fit these measurements to a logarithmic curve.