Object Oriented and Analysis with UML (part 1 – 10 questions)

Objective: Design and Implementation Techniques

1.  Which circumstances should you start implementing your program code?
Answer Explanation: When you start to implement your program, it is best to have a core part of your design solidified first. Once you have a set of solidified classes/packages, you can implement them. If there are parts of your program that are not solidified, you should not implement these sections of code, as they may change radically.

You should have most of your program design solidified before you start the implementation of your program.

If you do not create a program model before you start to implement your program code, the overall development time of the system can increase. You should have most of your program design solidified before you start the implementation of your program.

Although you can review other developers’ code to create your own coding pattern, this will not generally assist in implementing your program design. You should have most of your program design solidified before you start the implementation of your program.

================================================================================

Objective: Requirements Modeling

2. When examining a requirements document, which is BEST to concentrate on for the development of initial use cases?Answer Explanation: Business requirements represent the main goals and purpose of the system. It is these use cases that should be expanded to expose and develop the high-risk requirements for the first iteration of development.Security requirements, hardware requirements, and classes are not considered when developing initial use cases.===============================================================================
3. Objective: Dynamic Modeling
When developing a system for your client, you incrementally release milestones to generate feedback for your project. These milestones would be released at set intervals of the project’s iterative life-cycle, which consists of the Plan and Elaborate phase, the Build phase, and the Deploy phase. Each of these three phases may contain multiple development cycles.

Which of the following indicates the correct order of a development cycle?

Testing, analysis, implementation, and design
Analysis, implementation, design, and testing
Analysis, design, implementation, and testing
Analysis, design, testing, and, implementation

Answer Explanation: An iterative life-cycle is based on building and refining the system through multiple development cycles of analysis, design, implementation, and testing. The system grows through each development cycle, in which additional functionality is added within each development cycle. Each of these cycles addresses a small set of requirements, proceeding through the analysis, design, implementation, and testing phases. With iterative development, the complexity is not overwhelming and early feedback is generated with a working subset of the system.

The option “Testing, analysis, implementation, and design” is incorrect. This is not the correct order for an iterative life-cycle. In an iterative life-cycle, first the project is analyzed, designed, implemented, and finally tested for distribution.

The option “Analysis, implementation, design, and testing” is incorrect. This is not the correct order for an iterative life-cycle. The iterative life-cycle begins with analysis, proceeds with design and implementation respectively, and finishes with testing.

The option “Analysis, design, testing, and, implementation” is incorrect. This is not the correct order for an iterative life-cycle. Testing is the final stage of the iterative life-cycle and implementation is conducted prior to testing.=================================================================================4. Which of the following UML components is BEST used to examine the behavior of several objects within a single use case?Class Diagram (0r) Interaction Diagram (or) Use case Diagram (or) Activity DiagramAnswer Explanation: Interaction diagrams are especially useful for showing the correlation between two or more objects within a single use case. There are two types of interaction diagrams to choose from: sequence diagrams and collaboration diagrams. Both these types of diagrams convey the same message, but in a slightly different format.

The “Class diagram” option is incorrect. Class diagrams are best employed to display the types of objects in a system and the static relationships they have with each other. They are not very good at displaying the behavior of objects.

The “Use case diagram” option is incorrect. Use case diagrams are best used for demonstrating relationships between the various use cases of the system and the actors that initiate them. Use case diagrams do not contain classes.

The “Activity diagram” option is incorrect. An activity diagram is much like an interaction diagram but is best used to display object behavior over many use cases or many threads.=================================================================================5. Objective: Static Modeling
When searching use cases and requirements documents for candidate classes, it is best to concentrate on:

Nouns
Adjectives
Verbs
Actors

Answer Explanation: Since a noun, by definition, is a person, place, thing, or idea, nouns will represent most of the candidate classes in your system. Consider the following sentence from one of the business use cases of an online music store.

“A customer clicks a button to add a CD to their shopping cart.”

In this case, candidate classes are customer, button, CD, and shopping cart.

The “Adjectives” option is incorrect. Adjectives describe nouns or pronouns and best represent properties of classes. If a portion of a requirements document for a racing game states that “All opponents’ vehicles will be blue”, the vehicle class will most likely have a color property and in this case be set to blue.

The “Verbs” option is incorrect. Verbs show actions or states of being and are usually representative of the methods that some of the classes will contain. Words contained in a requirements document or use case such as move, lift, or throw will be a good indication of some of the methods that will end up in your application.

The “Actors” option is incorrect. Actors are initiators of use cases but are external to the use cases that they are initiating. They may sometimes be represented as classes in your application, but a list of actors will never be a complete list of candidate classes.=================================================================================
6. You are a project manager hired to design an online shopping site for a new pharmaceutical company. You are creating use cases and use case diagrams for the purpose of extracting software requirements for the first iteration of development. After meeting with several domain experts, you come up with the following use cases:

Enter new product, login, order prescription, refill prescription, apply for job, pay bill, defer payment, and bill insurance.

Which use case diagram represents the BEST design of the software system (see Exhibit)?

Answer Explanation: Correct diagram is “A“.  A solid line with a triangular arrowhead represents the generalization relationship. The arrow runs from the more specific component to the more general. Since the “Pay bill with check” and “Pay bill with credit card” use cases are more specific forms of the “Pay bill” use case, it is best modeled in this manner. The “Check customer information” use case is utilized for both the “Refill prescription” and “Fill order” use cases. This situation is best modeled with an include relationship. The include relationship is represented by a broken line with an open arrowhead running from the base use case to the included use case.

The “B” option is incorrect. The extend relationship is much like the generalization relationship but is best used when the points of extension or extension rules are specified. Since there are no extension points specified in the “Pay bill” use case, it is not the best relationship to use. Also, since the “Check customer information” use case is not a more specific version of either the “fill order” or the “Refill prescription” use cases, it should not be represented with the generalization relationship.

The “C” option is incorrect. Since the “Pay bill with check” and “Pay bill with credit card” use cases are more specific forms of the “Pay bill” use case, they are best modeled with the generalization relationship.

The “D” option is incorrect. The extend relationship should not be used to link the “Check customer information” use case to the “Fill order” and “Fill prescription” use cases since it is not a more specific version of these use cases.===============================================================================7. You are a project manager for a team hired to develop an application for an insurance company to track fraudulent claims. You want to create a short list of people to interview for the purpose of developing use cases. From these use cases you will extract the requirements of the application.

Who are the best people to interview?ans: Senior employee and company manager
Answer Explanation: Use cases are narrative descriptions of the required system processes, using the language and terminology of the problem domain. Since they are created from the point of view of the domain experts for the purpose of determining functionality requirements, and are void of implementation details, no programming expertise is required to conceive use cases. Therefore, the most valuable information would come from these domain experts. A senior employee would provide valuable information regarding the needed functionality of the system and the company manager would make the primary decisions on which requirements are feasible with the time and budget allotted.

The “Lead developer” and “Object-oriented programming consultant” options are incorrect. Since implementation details or programming specifics are not included in use cases, the expertise that these professionals provide is of limited use.===============================================================================Objective: Dynamic Modeling
There are two types of iterative expressions, either a conditional or iterative execution.

Which of the following best describes an iteration, in relation to an iteration expression?

A representation of a condition
A representation of a sequence of messages
A representation of actions
A style of messages

Ans: A representation of a sequence of messagesAnswer Explanation: An iterative expression represents the execution of zero or more messages, depending on the conditions involved. The conditions of the clause in an iteration do not need to be specified. The iteration clause can either be expressed in a programming language or in pseudocode.

The option “A representation of a condition” is incorrect. A conditional clause is a representation of a condition. An iteration represents the sequence of messages.

The option “A representation of actions” is incorrect. An iteration does not represent actions. It represents the sequence of messages.

The option “A style of messages” is incorrect. An iteration represents the sequence of messages.=================================================================================Which of the following diagrams is an example of shared aggregation?

Answer Explanation: A shared aggregation relationship is specified with a hollow diamond at the component end of the relationship line. The multiplicity of the relationship can optionally be specified.

The “A” option is incorrect. A solid diamond signifies a composition or composition aggregation relationship. This relationship exists when a component can be part of only one composite at a time. An engine to car relationship would be an example of this.

The “C” option is incorrect. A hollow triangle arrowhead indicates a generalization relationship. This occurs when a class is a more specific form of another class. The arrow runs from the more specific to the more general class.

The “D” option is incorrect. An open arrowhead signifies an association relationship between classes. The direction of the arrow is the direction of navigability. The arrowhead can be omitted if the direction of navigability is either bi-directional or unknown.

==============================================================================Each option represents a simplified class diagram of a company’s employee tracker software (see Exhibit).

Which diagram displays the BEST use of multiplicity?

Answer Explanation: This diagram shows that a Company object can be associated with many Person objects through the Employment association class and a Person object can be associated with zero or one Company objects. A many-to-zero or one (* – 0..1) association is specified instead of many-to-one (* – 1) because it is possible for a company to have a record of, and therefore an association to, a person without that person being employed by the company.

The “a” option is incorrect. Association classes do not have multiplicity. If you create an association class that appears to need multiplicity, it would normally be better modeled as a distinct class.

The “b” option is incorrect. Association classes do not have multiplicity. If you create an association class that appears to need multiplicity, it would normally be better modeled as a distinct class.

The “c” option is incorrect. The Person-to-Company association of many-to-zero or one (* – 0..1) is better than a many-to-many (* – *) association, even though it is technically possible for a person to work for more than one company. Since this class diagram is in the context of an employee tracker application for a single company, it does not need to track associations of other companies.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: