You are on page 1of 20

Software modeling and Design with UML

Question Bank
Short Questions and Answers
1. What is model?
 A Model is a simplification of reality.
 It’s a representation of something in the real world

2. Why do we model?
 Model is a simplification of reality.
 A model provides the blueprints of a system.
 We build models so that we can better understand the system we are
developing.

3. What is modeling?
 Modeling is a proven and well-accepted engineering technique which helps
build a model.
 It is a blueprint of the actual system that needs to be built.

4. What is the advantage of model?


 Visualizing the system
 Help to specifying the structural and behavioral of the system
 Make template to constructing the system
 Documenting the system

5. Define class and class diagram.


 A class is a description of a set of objects that share the same properties
and behavior.
 Class diagram shows the collection of classes and their relationships.

6. What are structural diagrams?


 Class Diagram
 Object Diagram
 Component Diagram
 Composite Structure Diagram
 Deployment Diagram
 Package Diagram

7. What are behavioral diagrams?


 State Machine Diagram
 Activity Diagram
 Sequence Diagram
 Communication Diagram
 Use Case Diagram
 Interaction Overview Diagram
 Timing Diagram

8. What are the types of things?


 Structural things
 Behavioral things
 Grouping things
 Annotational things

9. What are building blocks?


 Things
 Relationship
 Diagram

10.What are things, relationships and Diagrams in UML?


 Things - important modeling concepts
 Relationships - tying individual things
 Diagrams - grouping interrelated collections of things and
relationships

11.What are the differences between class and object diagram?


S.No Class Diagram Object diagram

Graphic notation for modeling Graphic notation for


1 classes and their relationships modeling objects and their
relationships

2 Static Diagram Static Diagram

Class notation includes name, All objects in a class share


3 attributes and operations the same operations or
methods

4 Person David:person

12.Explain different types of Relationship with example.


Association:
 Association is a structural relationship that represents how two entities
are linked or connected to each other within a system.
 It can form several types of associations, such as one-to-one, one-to-
many, many-to-one, and many-to-many. 
 It is also known as Has-a relationship.


Example:

Aggregation:
 In aggregation, a part can exist independent of the whole.
 It is known as Whole – Part relationship.
Example:
 Let us consider an example of a car and a wheel. It can also be
used with the bike, bicycle, or any other vehicles but not a
particular car. Here, the wheel object is meaningful even without
the car object.


Example:

Composition:
 In a composition relationship, the part depends on the whole.
 It is known as Whole – Part relationship.

Example:
 A hospital and its wards. If the hospital is destroyed, the wards also get
destroyed.

Example:

Generalization:
 The generalization relationship implements the object-oriented concept
called inheritance or is-a relationship.
 It exists between two objects (things or entities), such that one entity is a
parent (superclass or base class), and the other one is a child (subclass or
derived class).
 These are represented in terms of inheritance.
 Generalization is an “is-a” or “kind of” relationship.

Example:

Dependency:
 Whenever there is a change in either the structure or the
behavior of the class that affects the other class, such a
relationship is termed as a dependency.
 It is a unidirectional relationship.

Example:

13.Define aggregation and composition. give example.


Aggregation:
 In aggregation, a part can exist independent of the whole.
 It is known as Whole – Part relationship.
Example:
 Let us consider an example of a car and a wheel. It can also be used
with the bike, bicycle, or any other vehicles but not a particular car.
Here, the wheel object is meaningful even without the car object.


Example:

Composition:
 In a composition relationship, the part depends on the whole.
 It is known as Whole – Part relationship.

Example:
 A hospital and its wards. If the hospital is destroyed, the wards also get
destroyed.

Example

14.How are the diagrams divided? 


 Structural Diagrams
 Behavioral Diagrams

15.Which diagrams give a static view of a system?


 Class diagram
 Object diagram

16.Which diagrams provide a dynamic view of a system?


 Activity diagram
 Sequence diagram
 State diagram

17.What is the difference between an aggregation and composite?

18.Draw the notation of class and mention the name of the


compartments.

Class Name Professor


name
Attributes empID
Operations create( )
save( )
delete( )
change( )
19.Name the three levels of visibility and describe what each one
means.
 public (+) – external objects can access the member
 private (-) – only internal methods can access the member
 protected (#) – only internal methods, or methods of specialized objects
can access the member

20.Define. Multiplicity. Give example.


 Indicate the number of instance of one class linked with one instance of
other class.
 1-no more than one
 0-zero
 *-many
 Example:
1 1…….*
CardHolder Account
hold
21. Define object and object diagram.s
Object:
 Object is instance of class.
 Object is a real world entity, it refers any place, any person or any
things.

Object diagram:
 Object diagram is a collection of objects and their links.
 Object diagram is UML structural diagram.it represent the static
view.
22.Define use case diagram.
 Use case diagram is UML behavioral diagram
 It represents the use case view.
 Use case diagram are consisting of actor, use case and their
relationships.

23.What are the elements of use case diagram?


 Use case =

 Actor =

 Other elements :
system boundary =

Association =

Generalization =

24.Define actor.
 Someone interacting with use case.

25.Define use case.

 System functionality.
 Each actor must be linked to a use case
26.Define state.
 States is a Condition or situation during the life cycle of an object

27.What are the Elements of state diagram?


 State =
 Transition =

 Initial state =

 Final state =

28.What is state diagram?


 State diagram shows the state of single object
 State diagram also called state chart diagram or state machine diagram.
 State diagram is UML behavioral diagram.
 It represents the dynamic view

S.No State Diagram Activity Diagram

shows the dynamic behavior of an shows the workflow behavior of an


1
object operation as set of actions

It gives a clear picture of the changes shows the flow of activity of a process. 
2
in the object's state in this process. 

ATM Card object state: Withdraw cash activity:


3 Checking, Approving, Rejecting  Insert Card, Enter PIN, Check balance,
with draw money, get card 

29.Differentiate state and activity diagrams.

30.Define activity.
 Sequence of behavior. activity
 Activity means state of doing something.

31.What is activity diagram?


 Activity diagram is basically a flow chart to represent the flow from one
activity to another activity.
 Activity diagram is a UML behavioral diagram.
 It represents dynamic view.

32.Define control flow.


 Flow control from one activity to another.

33.What are the elements of activity diagram?

 Initial node=

 Final node=

 Decision =

 Merge =

 Fork =

 Join =
 Activity =

34.Draw class diagram for person.


35.Draw class diagram for flight.

36.Draw class diagram for product.

37.Draw class diagram for circle.

38.Draw class diagram for washing machine.


39.Draw object diagram for product.

40.Draw object diagram for country, capital city class.

41.Draw object diagram for person, company class.

42.What are the four principles of modeling?


 The model you choose influences how the problem is attacked.
 Every model may be expressed at different levels of precision.
 The best models are connected to reality.
 No single model is sufficient.
43.Why UML for Modeling?
 A diagram/picture = thousands of words
 Uses graphical notation to communicate more clearly than natural
language and code (too detailed).
 Makes it easier for programmers and software architects to communicate.
 Helps acquire an overall view of a system.
 UML is not dependent on any one language or technology.

44.What Is UML?
 The UML is a language for
 Visualizing
 Specifying
 Constructing
 Documenting
the artifacts of a software-intensive system.

45.What is object diagram?


 Object diagrams are used to render a set of objects and their relationships.
 Object diagrams are derived from class diagrams
 Object diagrams represent an instance of a class diagram.

46.What are the disadvantages of Procedural Programming?

 Procedures and data are clearly separated.


 Transformation of concepts between analysis & implementation.
 Design models are a long step from implementation.
 Procedures are often hard to reuse.
 Programs are often hard to extend and maintain
47.What are three major steps of OOAD methods?
1. Identify the objects
2. Determine their attributes and services
3. Determine the relationships between objects

48.What are the general advantages of Object-Oriented approach?


 Understandable
 Practical
 Productive
 Stable
49.List out the Strengths of Object Technology.
 A single paradigm
 Facilitates architectural and code reuse
 Models more closely reflect the real world
 Stability
 Adaptive to change
50.What Is an Operation?
 An operation is the implementation of a service that can be requested
from any object of the class to affect behavior.
 A class may have any number of operations or none at all.

Student

+ get tuition()
+ add s chedule()
Operation + get schedule()
s + delete schedule()
+ has pre-requisites ()
51.What is a message?
 A specification of a communication between objects that conveys
information with the expectation that activity will ensue
o One object asks another object to perform an operation.

52.What Is Object Technology?


 A set of principles guiding software construction together with
languages, databases, and other tools that support those principles.

53. What Is a Class?


 A class is a description of a set of objects that share the same properties
and behavior.
 An object is an instance of a class.

54. What Is an Attribute?

 An attribute is a named property of a class that describes a range of values


instances of the property may hold.
 A class may have any number of attributes or no attributes at all.

Student
- name
- addres s
Attribute - studentID
s - dateOfBirth
55. Compare: Abstraction and Encapsulation
 Abstraction is focused mainly on what should be done while Encapsulation
is focused on how it should be done.
 Abstraction hides complexity by giving you a more abstract picture while
Encapsulation hides internal working so that you can change it later.
 Abstraction solves problem at design level while Encapsulation solves
problem at implementation level.

56. What are the two approaches for analysis & design?
SSAD(System Structured Analysis and Design)
 Structured Analysis (SA), resulting in a logical design, drawn as a set of data
flow diagrams
 Structured Design (SD) transforming the logical design into a program
structure drawn as a set of structure charts
OOAD
 Designing systems using self-contained objects and object classes
57. How problem-solving approach is similar to SDLC?
 Organization recognizes problem (Project Planning)
 Project team investigates, understands problem and solution requirements
(Analysis)
 Solution is specified in detail (Design)
 System that solves problem built and installed (Implementation)
 System used, maintained, and enhanced to continue to provide intended
benefits (Support)
Brief Answer Questions:
1. List and explain basic building blocks of UML?
2. Explain the basic characteristics of Object Orientation.
3. Compare: class and object diagram.
4. Differentiate Aggregation and Composition.

CLASS DIAGRAM:
1. Draw class +diagram for the following classes. Person, Employee,
Part-time employee, Full-time employee, Building, office (Mention
the attributes and methods)
2. Draw class diagram for banking system.
3. Draw class diagram for ATM system.
4. Draw class diagram for the following classes. Vehicle, Motor Vehicle,
Bicycle, Motorbike, Car. (Mention the attributes and methods)
5. Draw class diagram for the following classes. Bank, Customer, ATM,
Account (Mention the attributes and methods)
6. Draw class diagram for the following classes. Company, Employee,
Project, ProjectManager, Programmer, Tester. (Mention the
attributes and methods)
7. Draw class diagram for customer, order, special order, and normal
order. (Mention the attributes and methods).

OBJECT DIAGRAM:
1. Draw object diagram for company and employee.
2. Draw object diagram for order management system.
3. Draw object diagram for Employee and Address.
4. Draw object diagram for University and student.
5. Draw object diagram for product.
6. Draw object diagram for country, capital city class.
7. Draw object diagram for person, company class.
USE CASE DIAGRAM:
1. Draw use case diagram for library management system.
2. Draw use case diagram for Railway reservation.
3. Draw use case diagram for vending machine (Point of Sale
System).
4. Draw use case diagram for online shopping system.
5. Draw use case diagram for ATM System.
STATE DIAGRAM:
1. Draw state diagram for Washing Machine.
2. Draw state diagram for traffic light.
3. Draw state diagram for door object.
4. Draw state diagram for computer object.

ACTIVITY DIAGRAM:

1. Draw activity diagram for order management system.


2. Draw activity diagram for create word document.
3. Draw activity diagram for ATM.
4. Draw activity diagram for online shopping.
5. Draw activity diagram for buy computer from the shop.

You might also like