Chapter 5

Questions for Chapter 4

1. How many UML 2.5 diagrams are there?

A. 6

B. 7

C. 9

D. 13

E. 14

2. Besides OMG, which organization publishes the UML specifications?

A. W3C

B. IEEE

C. ISO

D. CCITT/ITU-T

E. EXPRESS/STEP

3. Which diagram type is an Interaction Diagram?

A. Activity Diagram

B. Protocol State Machine Diagram

C. Sequence Diagram

D. State Machine Diagram

E. Use Case Diagram

4. Why is the Metamodel considered an Abstract Syntax?

A. Because all classes used in the metamodel are abstract

B. Because the metamodel expresses syntax rules that apply no matter what surface notation or concrete syntax is used

C. Because all classes in the specification, except for examples, are abstract data types

D. Because it is written in MOF

5. What does the BNF used in the UML specification show?

A. The BNF shows the surface syntax for textual fields.

B. The BNF shows the Business Notation Format used within UML.

C. The BNF shows unambiguously parsable textual fields.

D. The BNF shows how the textual fields relate to the abstract syntax.

6. How does the UML specification indicate the abstract syntax?

A. UML uses Extended Backus-Naur Form (EBNF).

B. UML uses an LL(0) grammar.

C. UML uses both UML structure and UML behavior diagrams.

D. UML uses natural language English.

E. UML uses a MOF metamodel.

7. What part of the UML specification defines the meaning of UML notation?

A. UML expresses the meaning in UML.

B. UML expresses the meaning in its abstract syntax.

C. UML expresses the meaning in its concrete syntax.

D. UML uses natural language to describe the semantics.

E. UML expresses the meaning in BNF.

8. In the terminology of UML, what is a metamodel?

A. The diagrams in a language

B. A model of a modeling language

C. A way of expressing the notation of UML

D. The concrete syntax of UML

9. Which list contains only behavior diagrams?

A. Communication, Component, Sequence

B. Collaboration, Interaction, State Machine

C. Sequence, State Machine, Timing

D. Class, Component, Profile

E. Component, Deployment, Use Case

10. What does the OCL used in the UML specification show?

A. The syntax of calling objects

B. The constraints embedded in the model

C. The textual surface syntax

D. The ISO change history of the document

E. The format to exchange UML models

11. What is the XMI in the UML specification used for?

A. The textual surface syntax

B. The constraints embedded in the model

C. To express models for interchange purposes

D. The ITU format to express models

12. Which diagram emphasizes the exchange of messages or events among peer participants?

A. Sequence

B. State Machine

C. Collaboration

D. Timing

13. Examine the sample lines below.

image

Which line indicates a composition relationship?

A. A

B. B

C. C

D. D

E. E

F. F

14. Which list contains only structure diagrams?

A. Communication, Component, Sequence

B. Collaboration, Interaction, State Machine

C. Sequence, State Machine, Timing

D. Class, Component, Profile

E. Component, Deployment, Use Case

15. Examine the sample lines below.

image

Which line indicates a depends/dependency relationship?

A. A

B. B

C. C

D. D

E. E

F. F

16. Examine the metamodel diagram below, where the multiplicities were replaced by ent and ent as placeholders.

image

What multiplicity values should be used for ent and ent if we want the Instance Specification to be correct for UML, which states that the name is optional and there can be zero or more classes?

A. ent 1 ent 0+

B. ent 0..1 ent 0..*

C. ent 0..* ent 0,1,2,…

D. ent 0..1 ent 0..More

E. ent ? ent 0..*

F. ent 0/1 ent 0..∞

17. The heading on a diagram is stored in what shape?

A. A regular pentagon

B. An irregular rectangle

C. An irregular pentagon

D. A tab

18. Which of the following diagrams contain a properly diagramed comment?

A. image

B. image

C. image

D. image

Answers for Chapter 4

1. How many UML 2.5 diagrams are there?

A. 6

B. 7

C. 9

D. 13

E. 14

Discussion:

A—No.

B—No, the Foundation Exam only covers seven UML diagrams, though you need to know the names and purposes of them all. The seven covered diagrams are Activity, Class, Object, Package, Sequence, State Machine, and Use Case diagrams. Not all details or variants of these diagrams are covered on the first exam. The not yet-covered diagrams are Communication, Component, Composite Structure, Deployment, Interaction Overview, Profile, and Timing diagrams. Therefore, if you only counted the diagrams covered, you would get this wrong.

C—No, there were nine diagrams in UML 1.x.

D—No, there were 13 diagrams in UML 2.1.1.

E—Yes, UML 2.2 added a 14th diagram, the Profile diagram.

These test the currency of your knowledge.

2. Besides OMG, which organization publishes the UML specifications?

A. W3C

B. IEEE

C. ISO

D. CCITT/ITU-T

E. EXPRESS/STEP

Discussion:

A, B, D, and E—Incorrect. These are all standards bodies with different portfolios

C—Yes, ISO  JTC-1  SC-7 (International Organization for Standardization, Joint Technical Committee on Information Technology, Subcommittee on Software and Systems Engineering) also publishes the UML specifications. OMG, using the PAS process (Publically Available Specification), submits the UML specification for approval to become ISO specs, with numbers like ISO/IEC 1950xx:20yy.

By the way, if you order your UML standard from ISO it will cost you much money, perhaps as much as $400. If you download it from OMG, it is free.

3. Which diagram type is an Interaction Diagram?

A. Activity Diagram

B. Protocol State Machine Diagram

C. Sequence Diagram

D. State Machine Diagram

E. Use Case Diagram

Discussion:

A—No, an Activity diagram is a type of behavior diagram, but not an Interaction Diagram.

B—No, a Protocol State Machine Diagram is a special type of State Machine Diagram. Despite the name, a Protocol State Machine diagram is not considered a separate diagram type. A State Machine Diagram is a behavior diagram, but not an Interaction Diagram.

C—Yes, the Sequence Diagram is type of Interaction Diagram, which is a type of behavior diagram

D—No, a State Machine Diagram is a behavior diagram but not an Interaction Diagrams

E—No, a Use Case Diagram is a behavior diagram but not an Interaction Diagram

4. Why is the Metamodel considered an Abstract Syntax?

A. Because all classes used in the metamodel are abstract

B. Because the metamodel expresses syntax rules that apply no matter what surface notation or concrete syntax is used

C. Because all classes in the specification, except for examples, are abstract data types

D. Because it is written in MOF

Discussion:

A—No, they are not generally abstract in the typical meaning of abstract.

B—Yes, the Metamodel shows the required relationships among model elements, without specifying the necessary notation.

C—No, they are not abstract data types.

D—No, the MOF is a Meta-Object Facility, but not automatically a Metamodel because of it.

5. What does the BNF used in the UML specification show?

A. The BNF shows the surface syntax for textual fields.

B. The BNF shows the Business Notation Format used within UML.

C. The BNF shows unambiguously parsable textual fields.

D. The BNF shows how the textual fields relate to the abstract syntax.

Discussion:

A—Yes, many of the textual fields with UML have BNF to show you possible legal expressions.

B—No, Business Notation Format begins with the initials BNF, but it is not an expression used within UML.

C—No, There are no requirements that UML Textual notation is unambiguously parsable. For example, a modeler can use special characters within a property name, such as “:” for which the BNF indicates a special purpose (to precede the type of a property). This is, of course, very bad naming practice.

D—No, the BNF only shows legal textual fields.

6. How does the UML specification indicate the abstract syntax?

A. UML uses Extended Backus-Naur Form (EBNF).

B. UML uses an LL(0) grammar.

C. UML uses both UML structure and UML behavior diagrams.

D. UML uses natural language English.

E. UML uses a MOF metamodel.

Discussion:

A—No, UML uses BNF (not EBNF) to show the textual surface format.

B—No, a LL(0) grammar is parsable by a LL(0) parser. It is a formal grammar that parses the token input from left to right. The zero indicates that it doesn’t need to do any token look ahead. This does not describe the abstract syntax of UML, which UML does by MOF diagrams.

C—No, the abstract syntax only uses the MOF, which is a subset of UML structure diagrams.

D—No, the abstract syntax uses MOF diagrams, not English.

E—Yes, correct.

7. What part of the UML specification defines the meaning of UML notation?

A. UML expresses the meaning in UML.

B. UML expresses the meaning in its abstract syntax.

C. UML expresses the meaning in its concrete syntax.

D. UML uses natural language to describe the semantics.

E. UML expresses the meaning in BNF.

Discussion:

A—No, the meaning of UML diagrams is in its relationship to elements outside of the model, either real-world or implementation elements. You can express the meaning of UML without some references to an external world.

B—No, the abstract syntax is a grammar, and does not capture meaning.

C—No, the concrete syntax, the notation or text, is just a notation on a diagram.

D—No, the BNF is a type of grammar of the surface textual syntax, indicating legal strings.

E—Yes, the UML specification uses natural language text (English) to explain the meaning along with examples.

8. In the terminology of UML, what is a metamodel?

A. The diagrams in a language

B. A model of a modeling language

C. A way of expressing the notation of UML

D. The concrete syntax of UML

Discussion:

A—No, the diagrams in a language is part of the notation.

B—Yes, a model of a model. It expresses the abstract syntax or grammar of UML.

C—No, the notation, is given in textual descriptions and in examples, not in a metamodel approach.

D—No, the concrete syntax of UML is shown in notation and in BNF.

9. Which list contains only behavior diagrams?

A. Communication, Component, Sequence

B. Collaboration, Interaction, State Machine

C. Sequence, State Machine, Timing

D. Class, Component, Profile

E. Component, Deployment, Use Case

Discussion:

A—No, behavior diagram, structure diagram, behavior diagram

B—No, not a current diagram type in UML—Though it was a behavior diagram in UML 1.x, behavior diagram, behavior diagram

C—Yes, behavior diagram, behavior diagram, behavior diagram

D—No, structure diagram, structure diagram, structure diagram

E—No, structure diagram, structure diagram, behavior diagram

10. What does the OCL used in the UML specification show?

A. The syntax of calling objects

B. The constraints embedded In the model

C. The textual surface syntax

D. The ISO change history of the document

E. The format to exchange UML models

Discussion:

A—No

B—Yes, UML uses the Object Constraint Language (OCL) to express constraints

C—No, the textual surface syntax is shown in BNF

D—No, the change history is captured by other means

E—No, UML uses XMI (XML Metadata Interchange) to exchange models

11. What is the XMI in the UML specification used for?

A. The textual surface syntax

B. The constraints embedded In the model

C. To express models for interchange purposes

D. The ITU format to express models

Discussion:

A—No, the UML specification uses BNF to express textual surface syntax.

B—No, the UML specification uses OCL to express constraints.

C—Yes, the XML Metadata Interchange (XMI), an OMG standard, is used to exchange models. Some tools use XMI for their internal representation of the UML model

D—No, the ITU is a telecommunications standards body.

12. Which diagram emphasizes the exchange of messages or events among peer participants?

A. Sequence

B. State Machine

C. Collaboration

D. Timing

Discussion:

A—Yes, a Sequence Diagram shows the Interaction of participants using message or events.

B—No, a State Machine diagram shows the life history of an object based on responses to incoming events.

C—No, a Collaboration is a special usage of a Composite Structure diagram, but it is not a diagram in itself. It can define the participants for a Sequence Diagram but does not show behavior. A Collaboration diagram was also the UML 1.x precursor to the current Communication diagram.

D—No, a Timing diagram emphasizes time and timing constraints.

13. Examine the sample lines below.

image

Which line indicates a composition relationship?

A. A

B. B

C. C

D. D

E. E

F. F

Discussion:

A—No, this is an aggregation relationship.

B—No, this is an association.

C—No, this is a provided interface.

D—No, this is a dependency relationship.

E—Yes, a solid diagram indicates a composition relationship, with the diamond end indicating the “whole” side and the unadorned end indicating the “part” side.

F—No, this is a generalization/specialization relationship.

14. Which list contains only structure diagrams?

A. Communication, Component, Sequence

B. Collaboration, Interaction, State Machine

C. Sequence, State Machine, Timing

D. Class, Component, Profile

E. Component, Deployment, Use Case

Discussion:

A—No, behavior, structure, behavior

B—No, not a current diagram type in UML—Though it was a behavior diagram in UML 1.x, behavior, behavior

C—No, behavior, behavior, behavior

D—Yes, structure, structure, structure

E—No, structure, structure, behavior

15. Examine the sample lines below.

image

Which line indicates a depends/dependency relationship?

A. A

B. B

C. C

D. D

E. E

F. F

Discussion:

A—No, this is an aggregation relationship

B—No, this is an association

C—No, this is a provided interface

D—Yes, this is a dependency relationship. It usually has an arrow at one end

E—No, a solid diagram indicates a composition relationship, with the diamond end indicating the “whole” side and the unadorned end indicating the “part” side

F—No, this is a generalization/specialization relationship

16. Examine the metamodel diagram below, where the multiplicities were replaced by ent and ent as placeholders.

image

What multiplicity values should be used for ent and ent if we want the Instance Specification to be correct for UML, which states that the name is optional and there can be zero or more classes?

A. ent 1 ent 0+

B. ent 0..1 ent 0..*

C. ent 0..* ent 0,1,2,…

D. ent 0..1 ent 0..More

E. ent ? ent 0..*

F. ent 0/1 ent 0..∞

Discussion:
To summarize what we have covered so far, a multiplicity range is expressed by LowValue. HighValue. If the LowValue is the same as the HighValue, you only need to show one value. The * indicates “or more” or “unlimited”
Some of the common multiplicities are:
1 Mandatory 0..1 Optional 1..* One or more 0..* Zero or more

A—No, ent mandatory (1) ent not legal notation

B—Yes, ent optional (0..1) ent zero or more (0..*)

C—No, ent zero or more (0..*) ent not legal notation

D—No, ent optional (0..1) ent not legal notation

E—No, ent not legal notation ent zero or more (0..*)

F—No, ent not legal notation ent not legal notation

17. The heading on a diagram is stored in what shape?

A. A regular pentagon

B. An irregular rectangle

C. An irregular pentagon

D. A tab

Discussion:

A—No, a regular pentagon has all the sides equal in length.

B—No, I’m not sure what an irregular rectangle would be. Is a regular rectangle a square?

C—Yes, it’s a 5-sided shape.

D—No, a tab is used to contain the name of a package.

18. Which of the following diagrams contain a properly diagramed comment?

A. image

B. image

C. image

D. image

Discussion:
Remember, this applies to constraints also.

A—Yes, the annotation line is optional, especially if the comment applies to the entire diagram.

B—No, there is no arrowhead on the annotation line.

C—No, the circle at the end of the annotation line is obsolete

D—No, the annotation line, if it is used, is a dashed line.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.130.13