UML & Modelling Questions with Answers

25 practice questions on UML & Modelling (Software Engineering & Testing) with answers and step-by-step solutions. Try 10 samples below, then practise all 25 free in the AptiNest app.

Sample questions

Question 1Easy

UML stands for

  1. Universal Machine Language
  2. Unified Markup Language
  3. Uniform Modelling Logic
  4. Unified Modeling Language

Answer: D. Unified Modeling Language

Explanation

UML is a standard visual language for modelling software systems.

Step-by-step solution

  1. UML is a standard visual language for modelling software systems.
  2. So the answer is: Unified Modeling Language.

Why the other options are wrong

  • A. UML is not a machine language.
  • B. It is not a markup language like HTML.
  • C. Not the expansion.

Question 2Easy

In a use case diagram, an actor is

  1. A class
  2. A database table
  3. An external user or system that interacts with the system
  4. A function inside the code

Answer: C. An external user or system that interacts with the system

Explanation

Actors can be people, other systems or devices.

Step-by-step solution

  1. Actors can be people, other systems or devices.
  2. So the answer is: An external user or system that interacts with the system.

Why the other options are wrong

  • A. Classes are in class diagrams.
  • B. Tables are in ER diagrams.
  • D. Functions are internal.

Question 3Medium

In UML, the symbol - before a member means

  1. Public
  2. Protected
  3. Private
  4. Static

Answer: C. Private

Explanation

A minus sign marks private visibility.

Step-by-step solution

  1. A minus sign marks private visibility.
  2. So the answer is: Private.

Why the other options are wrong

  • A. Public is +.
  • B. Protected is #.
  • D. Static is shown by underlining.

Question 4Medium

Which UML diagram shows the actors and the functions of a system?

  1. Class diagram
  2. Use case diagram
  3. Sequence diagram
  4. Deployment diagram

Answer: B. Use case diagram

Explanation

A use case diagram shows who uses the system and what they can do.

Step-by-step solution

  1. A use case diagram shows who uses the system and what they can do.
  2. So the answer is: Use case diagram.

Why the other options are wrong

  • A. A class diagram shows structure.
  • C. A sequence diagram shows message order.
  • D. A deployment diagram shows hardware.

Question 5Medium

Which diagram shows how objects interact in time order?

  1. Sequence diagram
  2. Class diagram
  3. Use case diagram
  4. Package diagram

Answer: A. Sequence diagram

Explanation

A sequence diagram shows lifelines and messages from top to bottom in order.

Step-by-step solution

  1. A sequence diagram shows lifelines and messages from top to bottom in order.
  2. So the answer is: Sequence diagram.

Why the other options are wrong

  • B. A class diagram shows static structure.
  • C. A use case diagram shows functions.
  • D. A package diagram shows grouping.

Question 6Medium

A hollow diamond on a class diagram line represents

  1. Composition
  2. Inheritance
  3. Dependency
  4. Aggregation

Answer: D. Aggregation

Explanation

Aggregation is a weak whole-part relationship where the part can exist alone.

Step-by-step solution

  1. Aggregation is a weak whole-part relationship where the part can exist alone.
  2. So the answer is: Aggregation.

Why the other options are wrong

  • A. Composition uses a filled diamond.
  • B. Inheritance uses a hollow triangle.
  • C. Dependency uses a dashed arrow.

Question 7Medium

In a use case diagram, the <<extend>> relationship means

  1. It is mandatory
  2. It connects two actors
  3. It removes a use case
  4. The extension use case adds optional behaviour

Answer: D. The extension use case adds optional behaviour

Explanation

Extend adds behaviour under a condition, such as Apply Coupon extending Checkout.

Step-by-step solution

  1. Extend adds behaviour under a condition, such as Apply Coupon extending Checkout.
  2. So the answer is: The extension use case adds optional behaviour.

Why the other options are wrong

  • A. That describes include.
  • B. It connects use cases.
  • C. It does not remove.

Question 8Medium

Generalisation (inheritance) in UML is drawn as

  1. A dashed arrow
  2. A solid line with a hollow triangle at the parent
  3. A filled diamond
  4. A plain line with numbers

Answer: B. A solid line with a hollow triangle at the parent

Explanation

The hollow triangle points to the superclass.

Step-by-step solution

  1. The hollow triangle points to the superclass.
  2. So the answer is: A solid line with a hollow triangle at the parent.

Why the other options are wrong

  • A. A dashed arrow is a dependency.
  • C. A filled diamond is composition.
  • D. A plain line is an association.

Question 9Hard

A realisation relationship in UML is drawn as

  1. A dashed line with a hollow triangle
  2. A solid line with a filled diamond
  3. A solid line with a large hollow triangle
  4. A plain solid line

Answer: A. A dashed line with a hollow triangle

Explanation

A class realises an interface using a dashed line with a hollow triangle.

Step-by-step solution

  1. A class realises an interface using a dashed line with a hollow triangle.
  2. So the answer is: A dashed line with a hollow triangle.

Why the other options are wrong

  • B. A filled diamond is composition.
  • C. A solid line with a hollow triangle is generalisation.
  • D. A plain line is association.

Question 10Hard

An object diagram shows

  1. The time order of messages
  2. Instances of classes and their links at a point in time
  3. All use cases
  4. Hardware nodes

Answer: B. Instances of classes and their links at a point in time

Explanation

An object diagram is a snapshot of the system.

Step-by-step solution

  1. An object diagram is a snapshot of the system.
  2. So the answer is: Instances of classes and their links at a point in time.

Why the other options are wrong

  • A. That is a sequence diagram.
  • C. That is a use case diagram.
  • D. That is a deployment diagram.

Practise all 25 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Software Engineering & Testing topics · All topics