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

Page: 1 / 14
Total 90 questions
Question 1

Choose the correct answer:

The stale machine below is in state1:

When does it transition to state2?



Answer : C

The image depicts a state machine with three states labeled 'state1' and 'state2'. Three events, e1, e2, and e3, are shown triggering transitions.

Analyzing the diagram, we can observe that all three events (e1, e2, and e3) are required for the transition from state1 to state2. The events are arranged sequentially, implying a specific order for the transition to occur.

Here's a breakdown of the reasoning for excluding other options:

Option A (When all of el. e2. and e3 occur in any order) is incorrect because the order of events matters.

Option B (When any one of the events e1. e2. or e3 occurs) is incorrect because all three events are necessary for the transition.

Option D (Never, because a transition cannot have more than one trigger) is incorrect because the state machine can transition with multiple triggers, but in this specific case, the order is crucial.

Therefore, based on the visual representation of the state machine, the correct answer is that the transition to state2 happens only when events e1, e2, and e3 occur in precisely the specified order


Question 2

Choose the correct answer:

Which diagram is invalid?

A)

B)

C)

D)



Answer : C

Option C shows a UML diagram where a class (One) appears to have an aggregation relationship with itself. In UML, an aggregation is a special type of association that represents a whole-part relationship between the aggregate (whole) and a component part. However, it does not make sense for a class to aggregate itself; such a relationship implies that instances of the same class are parts of each other, which is conceptually invalid.

Let's consider the other options: A) This diagram shows a class contained within another, which is a valid use of nesting classes. B) This diagram shows a composition relationship, which is a form of aggregation with a stronger lifecycle dependency between the whole and the part. This is a valid relationship in UML. D) This diagram shows a class containing two nested classes, one of which contains another nested class. This is also a valid representation of nested classes in UML.

Therefore, the correct answer is:

C . Option C


Question 3

Choose the correct answer:

Consider the following diagram fragment:

What makes this fragment invalid?



Answer : F

In the given UML package diagram fragment, various elements are listed with stereotypes indicating their nature (class, interface). Stereotypes are used in UML to extend the vocabulary of UML in order to create new kinds of building blocks. They are typically enclosed in guillemets ( ).

The last element, 'six', does not have a stereotype indicating whether it's a class, interface, or some other kind of element. This lack of a stereotype leads to ambiguity about the nature of 'six'. Therefore, the fragment is considered invalid due to this omission.

All the other options do not constitute an error in the UML fragment: A) A list of elements is allowed in a package body. B) Visibility is not required for every element, especially within package diagrams. C) Interfaces are allowed in packages. D) Private elements are allowed in a package. E) Protected elements are also allowed in a package.

Therefore, the correct answer is:

F . Element six is missing its stereotype.


Question 4

Choose the correct answer:

Which statement is correct regarding the diagram below?



Answer : C

The dashed arrow with an open arrowhead in the UML diagram represents a dependency relationship. In UML, a dependency is a relationship that signifies that one element, or set of elements, requires another element (or set of elements) for its specification or implementation. This means that changes to the target element(s) (the element(s) that the arrow points to) may cause changes to the source element(s).

The statement 'One or more of the elements in Package G depends on one or more of the elements in Package F' correctly describes the nature of a dependency relationship in UML. It indicates that there is at least one element in Package G that requires some element(s) from Package F. This does not necessarily imply that all elements from Package G depend on all elements from Package F.

Therefore, the correct answer is:

C . One or more of the elements in Package G depends on one or more of the elements in Package F.


Question 5

Choose the correct answer:

How would you refer lo element One of Package PI. when inside Package P2?



Answer : D

In UML, when you need to reference an element from another package while inside a different package, you use the qualified name. A qualified name includes the package name followed by two colons and then the element name. This ensures that the reference is clear and unambiguous, especially when different packages may have elements with the same name.

The correct syntax for referring to element One of Package P1 from inside Package P2 is P1::One, where :: is the scope resolution operator used to separate the package name from the element name.

Therefore, the correct answer is:

D . P1::One


Question 6

Choose the correct answer:

Consider the following diagram:

What does the filled diamond mean?



Answer : A

In UML, a filled diamond represents a composite aggregation, also known as a composition. It indicates a whole-part relationship with strong ownership and coincident lifetime of the parts with the whole. Here's what it means in relation to the options provided:

A . This is partially correct. A filled diamond indeed indicates that the Ship instance is responsible for the existence of the associated Person instances, but it is not complete as it does not explicitly state that the Person instances will be deleted when the Ship instance is deleted.

B . This option is the most accurate. A filled diamond represents a composite aggregation, which means that the existence of the Person instances (parts) is dependent on the Ship instance (whole). When the Ship instance is deleted, so are the Person instances it contains.

C . The filled diamond is not a placebo; it has a well-defined meaning in UML, indicating strong ownership and lifecycle dependency between the whole and the part.

D . While the filled diamond does indicate ownership, it specifies more than just an attribute relationship; it indicates that the Ship class has a composition relationship with the Person class. This means that the Ship object contains Person objects as parts of itself, not just as an attribute reference.

E . The filled diamond is connected to the Ship class, not the Person class, so this statement is incorrect. The composition relationship is from Ship to Person, not the other way around.

Based on the UML specification for composite aggregation, the most accurate statement is B: Class Person's existence depends on the ship. It will get deleted when the ship gets deleted. This aligns with the definition of composite aggregation, where the part's lifecycle is dependent on the whole's lifecycle.


Question 7

Choose the correct answer:

Which statement is correct regarding Enumeration Literals?



Answer : A

Enumeration literals in UML are used within an enumeration to define a set of named constants. According to the UML specification:

A . This statement is correct. Enumeration literals are indeed immutable, which means once they are defined within an enumeration, their values cannot be changed.

B . Enumeration literals cannot be anonymous; they must be named so that they can be referenced unambiguously within the model.

C . Enumeration literals can be compared for equality. In fact, this is one of their primary uses, to allow for comparison between different values of an enumerated type to determine if they are the same.

D . Enumeration literal names must be unique within their enumeration. They cannot appear more than once as this would cause ambiguity in references to the literals.

The most accurate statement according to the UML 2 Foundation specification is A: EnumerationLiterals are immutable.


Page:    1 / 14   
Total 90 questions