OMG Certified UML Professional 2 (OCUP 2) - Foundation Level OMG-OCUP2-FOUND100 Exam Practice Test

Page: 1 / 14
Total 90 questions
Question 1

Choose the correct answer:

Consider the following diagram:

Which change could the modeler make to fix the UML error in this model?



Answer : B

In the UML diagram given, we see two classes, ClassA and ClassB, with ClassB inheriting from ClassA. ClassA has two attributes, position of type Integer and description of type String. ClassB introduces an additional attribute, version of type Real.

Looking at the instance specifications (the right part of the diagram), we have three instances: a1 of type ClassA, b1 of type ClassB, and b2 also of type ClassB.

In UML, an instance specification must comply with the structure of its classifier, which means an instance of ClassA must show slots for both position and description, whereas an instance of ClassB must show slots for position, description, and version.

In the provided diagram, instance a1 of ClassA only shows a slot for position. This is an error because it does not show a slot for description, which is a defined attribute of ClassA. To correct this error, we would need to add a description slot to a1.

This means that the correct answer is:

B . Add a description slot to a1.

The other options do not correct the error in the model:

A) Specifying unique values for position does not address the missing description slot in a1. C) Changing the type of ClassB.version from Real to Integer is not required by any UML constraint in the context given. D) Changing the type of ClassA.position from Integer to Real does not address the missing description slot in a1 and is unrelated to the inheritance structure.


Question 2

Choose the correct answer:

Which diagram shows inherited properties?

A)

B)

C)

D) Inherited properties cannot be shown In a specialized class.



Answer : B

In UML, inherited properties are those attributes that are defined in a superclass and inherited by a subclass. According to UML notation, when a subclass inherits from a superclass, it inherits all the attributes and operations of the superclass unless they are redefined.

Let's examine each option:

A . In Option A, the Customer class shows the attributes name and address repeated from the Person class. This is not necessary in UML to show inheritance and could imply these are different attributes that happen to have the same name.

B . In Option B, the attributes of the Person class are not shown in the Customer class. This is correct as UML assumes that all attributes and operations are inherited by the subclass, and there is no need to repeat them unless they are overridden or extended. In this case, the diagram shows inheritance correctly without redundant representation of inherited properties.

C . In Option C, the inherited properties name and address are explicitly marked as inherited. While it's possible to show inherited properties in this way for clarity, it's not necessary and is less common in standard UML class diagrams.

D . Statement D is incorrect because inherited properties can be shown in a specialized class, although it is not a requirement to do so for the properties to be inherited.

Based on the UML 2 Foundation specification, the correct way to depict inheritance without redundantly listing inherited attributes is shown in Option B.


Question 3

Choose the correct answer:

How many class instances can be shown on an Object Diagram?



Answer : D

In UML, an Object Diagram is a type of static structure diagram that shows a snapshot of the detailed state of a system at a point in time. It focuses on some particular set of objects and attributes, and the links between them. When it comes to the number of instances that can be represented in an Object Diagram, it can range from zero (in cases where the diagram is used to show that no instances of a class exist under certain conditions) to many instances. Therefore, an Object Diagram can show 0 instances, 1 instance, or many instances, which is represented by the multiplicity notation 0..*.

Therefore, the correct answer is:

D . 0..*


Question 4

Choose the correct answer:

Which category of stakeholders should have prime responsibility for making decisions on the contents of a domain model, and why?



Answer : B

In the development of a domain model, the prime responsibility for decision-making should ideally rest with the users, as they are the ones who will be using the system operationally. Users have the most direct and frequent interactions with the system, making them best positioned to provide relevant insights into what the system should do and how it should behave to meet their needs effectively. While other stakeholders such as customers, project managers, and developers play significant roles, the users' intimate knowledge of the domain processes and their requirements make them key contributors to ensuring that the domain model aligns closely with real-world application and utility.


Question 5

Choose the correct answer:

The BchaviorA state machine shown below is at rest in state s1 and the value of x Is 0.

If a signalA event occurs, what is the state machine's subsequent behavior?



Answer : C

The image showcases a state machine named 'BehaviorA'. It consists of two states: s1 and s2. There's also a transition labeled 'signalA' connecting these states. However, a guard condition, '[x > 0]' is placed on the transition. This indicates that the signalA event will only trigger the transition if the expression x > 0 evaluates to true.

In the scenario you described, the state machine is currently in state s1, and the value of x is 0. Since the guard condition '[x > 0]' is not satisfied (because x is 0), the signalA event will not trigger a transition to state s2.

Here's a breakdown of why other options are incorrect:

Option A (The state machine will transition to state s2 and execute ActivityA during the transition) is not valid because the guard condition prevents the transition.

Option B (The state machine will execute ActivityA and remain in state s1) is incorrect as ActivityA is only associated with the transition, which isn't happening in this case.

Option D (The state machine will remain in state s1, and processing of the signalA event occurrence will be deferred until either the value of x changes or the state machine changes state) is not entirely accurate. While the state machine remains in s1, the processing of the signalA event is consumed immediately, not deferred.

Therefore, considering the state machine's visual representation and the guard condition, option C best describes the state machine's behavior. The signalA event is acknowledged but has no effect because the transition requirements aren't met.


Question 6

Choose the correct answer:

In your model, you need to represent accounts.

Which statement supports using a Class, rather than a DataType. lor this purpose''



Answer : C

In UML, a Class is a template that defines the structure and behavior of objects, whereas a DataType is a type of classifier which specifies a domain of values without identity. Operations (such as money transfers and withdrawals) are behaviors that change the state of an object and, therefore, are defined in Classes rather than DataTypes. This suggests that accounts, which require operations to transfer and withdraw money, should be modeled as Classes.


UML 2.x Superstructure Specification: Provides definitions for Classes and DataTypes, and details the circumstances under which each should be used. It specifically states that Classes can have operations while DataTypes cannot.

UML 2.x Infrastructure Specification: This foundational document provides an in-depth explanation of UML modeling constructs, supporting the use of Classes when operations are needed to manage an object's state.

Question 7

Choose the correct answer:

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



Answer : C

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 edge1. This means that only one 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 elements2.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 covered3.

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.


Page:    1 / 14   
Total 90 questions