UML and Software Modeling # MCQs Practice set

Q.1 What does UML stand for?

Unified Modeling Language
Universal Modeling Logic
User Model Layout
Unified Machine Learning
Explanation - UML stands for Unified Modeling Language, a standardized way to visualize system design.
Correct answer is: Unified Modeling Language

Q.2 Which of the following is NOT a UML diagram type?

Class Diagram
Sequence Diagram
Flowchart Diagram
Use Case Diagram
Explanation - Flowchart diagrams are not part of UML. They belong to general process modeling.
Correct answer is: Flowchart Diagram

Q.3 Which UML diagram shows the dynamic behavior of objects?

Class Diagram
Sequence Diagram
Deployment Diagram
Component Diagram
Explanation - Sequence diagrams capture the interaction between objects in a time sequence.
Correct answer is: Sequence Diagram

Q.4 In a UML class diagram, what does a solid line with a diamond represent?

Association
Composition
Aggregation
Inheritance
Explanation - A solid line with a hollow diamond represents aggregation, showing whole-part relationships.
Correct answer is: Aggregation

Q.5 Which UML diagram is mainly used for system requirements?

Use Case Diagram
Activity Diagram
Class Diagram
Package Diagram
Explanation - Use Case diagrams represent system functionality and requirements from the user’s perspective.
Correct answer is: Use Case Diagram

Q.6 What symbol is used to represent an actor in a Use Case Diagram?

Rectangle
Stick Figure
Ellipse
Diamond
Explanation - Actors are represented by stick figures in UML Use Case diagrams.
Correct answer is: Stick Figure

Q.7 Which diagram is best suited for showing workflow?

Activity Diagram
Class Diagram
State Machine Diagram
Component Diagram
Explanation - Activity diagrams are used to model workflows and processes.
Correct answer is: Activity Diagram

Q.8 What does a filled diamond represent in a UML class diagram?

Aggregation
Composition
Association
Dependency
Explanation - A filled diamond represents composition, a stronger form of aggregation where parts cannot exist independently.
Correct answer is: Composition

Q.9 Which UML diagram represents deployment of software on hardware nodes?

Deployment Diagram
Class Diagram
Package Diagram
Use Case Diagram
Explanation - Deployment diagrams map software artifacts to hardware nodes.
Correct answer is: Deployment Diagram

Q.10 Which UML diagram models finite state behavior?

State Machine Diagram
Sequence Diagram
Activity Diagram
Collaboration Diagram
Explanation - State Machine diagrams model object behavior through states and transitions.
Correct answer is: State Machine Diagram

Q.11 In UML, which relationship is represented by a hollow arrow pointing to a parent class?

Association
Aggregation
Generalization
Dependency
Explanation - A hollow arrow represents generalization (inheritance).
Correct answer is: Generalization

Q.12 What is the purpose of a Package Diagram?

To show workflow
To group classes into packages
To model hardware nodes
To show object interactions
Explanation - Package diagrams group elements into packages for modularity.
Correct answer is: To group classes into packages

Q.13 Which UML diagram emphasizes time-ordering of messages?

Sequence Diagram
Class Diagram
Activity Diagram
Deployment Diagram
Explanation - Sequence diagrams emphasize message order across time.
Correct answer is: Sequence Diagram

Q.14 Which UML element is used to represent a real-world entity in a Class Diagram?

Actor
Class
Component
Node
Explanation - Classes represent real-world entities with attributes and behaviors.
Correct answer is: Class

Q.15 Which diagram would you use to model software components and their relationships?

Component Diagram
Use Case Diagram
Sequence Diagram
Class Diagram
Explanation - Component diagrams show software components and their dependencies.
Correct answer is: Component Diagram

Q.16 Which UML diagram shows parallel processes explicitly?

Activity Diagram
Class Diagram
Deployment Diagram
Object Diagram
Explanation - Activity diagrams show concurrency and parallel workflows.
Correct answer is: Activity Diagram

Q.17 What is an Object Diagram mainly used for?

Showing class structure
Showing object instances
Showing workflows
Showing deployment
Explanation - Object diagrams capture a snapshot of object instances at a given time.
Correct answer is: Showing object instances

Q.18 Which of the following is true about a Use Case?

Represents a system function
Represents a class
Represents a component
Represents a node
Explanation - A Use Case describes a system’s functionality as perceived by an actor.
Correct answer is: Represents a system function

Q.19 In a Sequence Diagram, what represents lifelines?

Vertical dashed lines
Horizontal arrows
Ellipses
Rectangles
Explanation - Lifelines are shown as vertical dashed lines indicating an object’s existence over time.
Correct answer is: Vertical dashed lines

Q.20 Which diagram is best for modeling database schema?

Class Diagram
Deployment Diagram
Sequence Diagram
Activity Diagram
Explanation - Class diagrams can model database schema by representing tables as classes.
Correct answer is: Class Diagram

Q.21 Which UML diagram is closely related to algorithms and flowcharts?

Activity Diagram
Class Diagram
Use Case Diagram
Deployment Diagram
Explanation - Activity diagrams resemble flowcharts and model control flows.
Correct answer is: Activity Diagram

Q.22 Which UML relationship is represented with a dashed arrow?

Dependency
Generalization
Association
Composition
Explanation - A dashed arrow represents a dependency relationship.
Correct answer is: Dependency

Q.23 Which UML diagram is mainly used for real-time systems to model concurrent behavior?

State Machine Diagram
Sequence Diagram
Activity Diagram
Object Diagram
Explanation - State Machine diagrams effectively model concurrency and states in real-time systems.
Correct answer is: State Machine Diagram

Q.24 Which element in UML is shown as a rectangle with compartments?

Class
Actor
Component
Node
Explanation - A class is shown as a rectangle with compartments for attributes and operations.
Correct answer is: Class

Q.25 Which UML diagram can be used to model system architecture at a high level?

Component Diagram
Activity Diagram
Sequence Diagram
Class Diagram
Explanation - Component diagrams provide a high-level architectural view of software systems.
Correct answer is: Component Diagram