Skip to main content

OMG-OCUP2-FOUND100 Real Exam Questions

OMG Certified UML Professional 2 (OCUP 2) - Foundation Level

108 questions available · Page 1 of 11

Updated Exam DumpsVerified AnswersPass Guarantee

Get Complete Exam Dumps
Question 1 Single choice

Consider the following diagram:

According to the diagram, which statement describes the property db?

  1. A

    The property db is a primary key

  2. B

    The property db is a static property.

  3. C

    The property db is inherited from a superclass.

  4. D

    The property db is important and is emphasized by the modeler with an underline.

Show answer and explanation

Correct answer: B

Explanation

In UML, a static property is one that belongs to the class itself rather than any instance of the class. In UML diagrams, static properties are denoted by underlining the property name.
Now, let's review the options:
A. There is no UML notation in the diagram that specifies whether the property db is a primary key. Primary keys are a database concept and UML does not have a standard way to denote them. B. The property db is underlined, which
indicates that it is a static property. This is the correct UML notation for depicting a class-level attribute. C. There is no indication in the diagram that db is inherited from a superclass. Inherited properties typically are not underlined (unless they are also static), and there is no superclass shown in the diagram.
D. Underlining in UML does not signify importance or emphasis by the modeler, it indicates that a property is static.
Therefore, the answer is B: The property db is a static property. This is based on standard UML notation as outlined in the UML 2.5 Specification by the Object Management Group (OMG), which dictates that static members (attributes or operations) are underlined in class diagrams.

Question 2 Single choice

How many activities can feed an initial node at the beginning of an activity thread?

  1. A

    0

  2. B

    0..*

  3. C

    1

  4. D

    1..*

Show answer and explanation

Correct answer: C

Explanation

In UML, an initial node is the starting point of an activity thread and represents the start of the flow in an activity diagram. According to the UML 2.5.1 specification, an initial node has no incoming edges and precisely one outgoing edge 1. This means that onlyone activity can feed an initial node at the beginning of an activity thread, which aligns with option C. The initial node is depicted as a filled circle and is used to show where the control starts within the activity. When the activity is invoked, control tokens are placed on the initial node and can then traverse the outgoing edge to the first action or activity node. The specification clearly states that there should be only one outgoing edge, ensuring that the flow of control is unambiguous at the start of the activity.
For further details and verification, you can refer to the UML 2.5.1 specification, particularly Chapter 15.7, which covers the Activity, ActivityFinalNode, InitialNode, and other related elements 2. Additionally, the Object Management Group (OMG) provides resources and guidelines for the UML exams, including the types of questions that may appear and the knowledge areas covered 3. It's important to note that while multiple initial nodes can exist within a single activity diagram, each initial node can only be the source of one outgoing edge, and thus, only one activity can feed each initial node.

Question 3 Single choice

Consider the following diagram:

Is this diagram valid?

  1. A

    No, because a DataType cannot have Associations to a Class.

  2. B

    No, because a DataType cannot have Operations.

  3. C

    No, because a DataType cannot have Attributes.

  4. D

    Yes, it is formally correct.

Show answer and explanation

Correct answer: A

Explanation

The provided diagram depicts a DataType named Route with operations, attributes, and associations to a Class named City. In UML, a DataType is a type of classifier that specifiesthe values that do not have identity (i.e., are not distinguishable from other objects). DataTypes may contain Attributes and Operations, so options B and C are incorrect.
However, DataTypes should not have associations to Classes because DataTypes are meant to be value types without identity, and associations typically imply a relationship between instances (which have identity). Thus, the presence of associations from Route to City is not consistent with the definition of a DataType.
References:
UML 2.x Superstructure Specification: Sections on Classifiers and DataTypes provide definitions of what constitutes a DataType and what features they can have. They specifically mention that DataTypes are kinds of classifiers that do not have identity and are often used to type attributes. UML 2.x Infrastructure Specification: This foundational document gives additional context on the semantics of different types of classifiers, including DataTypes, and how they relate to other elements in a UML model.

Question 4 Single choice

Consider the following diagram;

What is the minimum number of occurrences that must happen before the reception of m(200)?

  1. A

    0

  2. B

    2

  3. C

    4

  4. D

    5

  5. E

    6

Show answer and explanation

Correct answer: B

Explanation

The diagram shown is a UML Sequence Diagram, which is used to depict the interaction and order of messages between objects.
In the given diagram, we can see two occurrences of the message 'm' with different parameters (100 and 200), and one occurrence of the message 'p' with the parameter "run". To determine the minimum number of occurrences that must happen before the reception of 'm(200)', we look at the order of messages: The message 'm(100)' must occur.
The message 'p("run")' must occur after 'm(100)' and before 'm(200)'. These two occurrences are the minimum necessary before 'm(200)' can be received by the object. The dashed line represents a return message, which does not count as an occurrence for this purpose.

Question 5 Single choice

Consider the following diagram:

What is the name of the property that the lifeline represents in the Start Sensor Device Driver interaction?

  1. A

    Driver

  2. B

    x-axisGyro

  3. C

    sensorDriver

  4. D

    DeviceDriver

  5. E

    cannot determine from the information shown

Show answer and explanation

Correct answer: C

Explanation

In a UML sequence diagram, a lifeline is represented by a box at the top of a dashed line. The box contains the name of the lifeline and can optionally include the object name, a colon, and the class name or the type (if the lifeline represents a specific instance of a class or type). In the provided sequence diagram, the lifeline has the following notation:
sensorDriver[x-axisGyro]: DeviceDriver
This notation includes three parts: sensorDriveris the name of the lifeline, which represents the identity of the participating element. [x-axisGyro]is a selector that specifies that the lifeline represents a specific object within a set of similar objects. DeviceDriveris the type of the object that the lifeline represents. Based on this, the name of the property that the lifeline represents in the "Start Sensor Device Driver" interaction is sensorDriver.

Question 6 Single choice

Which statement is correct about PackageMerge?

  1. A

    It is the same as a dependency between two classes.

  2. B

    It is a mechanism for combining the contents of packages.

  3. C

    It may only be used between actors and use cases.

  4. D

    It is used to connect a package to an instance specification.

Show answer and explanation

Correct answer: B

Explanation

PackageMerge is a UML mechanism used to combine the contents of packages so that the receiving package is extended by the merged package. It is not a class dependency, not a relationship between actors and use cases, and not something used with instance specifications. PackageMerge is specifically about organizing and composing package contents in a structured way.

Question 7 Single choice

Consider the following two diagrams:

Which description of these diagrams is true?

  1. A

    In both diagrams, the activity will end after action READY and no further signals will be accepted.

  2. B

    Initial and final nodes are optional. Therefore the execution semantics of both diagrams are equivalent.

  3. C

    In diagram Act1. action a can get executed once. In diagram Act2. action a can get executed many times.

  4. D

    Diagram Act2 is incomplete: It should get completed with exactly one start and at minimum one final node. If this would be done, both diagrams become equivalent.

Show answer and explanation

Correct answer: A

Explanation

Start Node: Represented by a black circle, indicating the starting point of the activity. Action a: Represented by a rounded rectangle, signifying an action or step within the activity. Action READY: Another rounded rectangle representing an action. End Node: A circle with a black dot inside, marking the end point of the activity.
Based on the common elements in both Act1 and Act2: The activity starts at the designated start node.
It proceeds to action "a".
Then it moves to action "READY".
Finally, it reaches the end node, signifying completion.
There are no additional branches or loops that would allow for re-starting the activity or re-executing action "a" multiple times.
Analysis of Other Options:
B. Initial and final nodes are optional... While it's true that initial and final nodes can be implicit in some cases, well-formed activity diagrams typically include them for clarity. Here, both diagrams have them explicitly. C. In diagram Act1. action
a can get executed once... There's no basis to claim a difference in the number of executions of action "a" between the two diagrams. D. Diagram Act2 is incomplete... Both diagrams seem complete as they have proper start and end nodes, and the flow goes from start to finish without any ambiguity. Therefore, considering the structure and execution flow, both Act1 and Act2 will end after the "READY" action, and no further signals will be accepted, making answer A the most accurate description.

Question 8 Single choice

When is a state machine for an object created and ready to accept events?

  1. A

    by the time the last state ends

  2. B

    immediately after the sequence diagrams start

  3. C

    by the time the object has finished its initialization

  4. D

    when all objects in the system are ready to receive events

Show answer and explanation

Correct answer: C

Explanation

In a UML system, the state machine associated with an object becomes active and ready to process events as soon as the object's initialization process is complete. Here's why: Object Creation and State Machines: When an object is created, its associated state machine is instantiated along with it. This means the state machine's structural elements (states, transitions, etc.) are established. Initialization and the Initial State: During the object's initialization phase, essential attributes and relationships might be set up, and the state machine enters its designated initial state. Event Readiness: Once initialization is complete, the object and its state machine are considered "operational" and can respond to events as defined by the state machine's logic.
Why Other Options are Incorrect:
A. by the time the last state ends: State machines often don't have a designated "last" state. Their execution is based on events and can continue indefinitely. Additionally, a state machine can be ready to handle events long before ending. B.
immediately after the sequence diagrams start: Sequence diagrams illustrate interactions between objects, but they don't dictate the exact timing of object creation or state machine readiness in the overall system. D. when all objects in the system are ready to receive events: While system-wide coordination might be necessary, an individual object's state machine readiness is dependent on its own initialization, not on the state of every other object.
References:
UML Specification (Superstructure) Version 2.5.1: Specifically, sections covering state machines (https://www.omg.org/spec/UML/2.5.1)
. Practical guides to UML and object-oriented modeling often discuss object creation and state machine lifecycles.

Question 9 Single choice

A classifier declares an Operation called approve().

What kind of UML element is approve()?

  1. A

    Behavioral Feature

  2. B

    PrimitiveType

  3. C

    Slot

  4. D

    InstanceSpecification

Show answer and explanation

Correct answer: A

Explanation

An Operation is a kind of Behavioral Feature in UML. It specifies behavior that instances of the classifier may be requested to perform. A PrimitiveType is a kind of type, a Slot is used within an InstanceSpecification to hold a value for a structural feature, and an InstanceSpecification represents an instance. Since approve() defines behavior available on a classifier, it is correctly classified as a Behavioral Feature.

Question 10 Single choice

Consider the following class diagram:

Which statement is true about the class diagram?

  1. A

    The preferred age to open a bank account is 18 years old or older

  2. B

    Only customers who are 18 years old or older can open a bank account.

  3. C

    The age condition should only hold when the setAge(Integer) function is called

  4. D

    An object of Customer with age set to 18 or greater will raise an exception.

Show answer and explanation

Correct answer: B

Explanation

In UML 2, a class diagram is used to depict the structure of a system by showing the system's classes, their attributes, operations (or methods), and the relationships among the classes. The constraint {age >= 18} in the Person class diagram indicates a condition that must hold true for the instances of the Person class whenever they are used in the
context of a BankAccount. This constraint is an invariant of the Person class that specifies the rule for the attribute age.
Now, let's consider the provided options and explain why option B is correct:
A. The preferred age to open a bank account is 18 years old or older - This statement is incorrect because the diagram does not indicate a preference; it indicates a constraint or a rule. B. Only customers who are 18 years old or older can
open a bank account - This is the correct statement. The {age >= 18} constraint next to the age attribute of the Person class signifies that any instance of Person associated with a BankAccount must be at least 18 years old. Since Person is connected to BankAccount with the role name customer, this implies that only persons who are at least 18 can be customers of a bank account. C. The age condition should only hold when the setAge(Integer) function is called - This
statement is incorrect because the constraint {age >= 18} is not a condition that applies only when the setAge operation is invoked. Instead, it is a class invariant that must always hold true for any instance of Person.
D. An object of Customer with age set to 18 or greater will raise an exception - This is incorrect because the UML diagram specifies a constraint, not an exception condition. The constraint ensures validity, not the raising of an exception. The
answer is verified according to the UML 2 Foundation documents, such as the UML 2.5 specification, where class diagrams and constraints are defined. The specification states that constraints are semantic conditions or restrictions expressed in natural language text or in a machine-readable language that must hold true for the system being modeled (UML 2.5 specification, section 7.9).