aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes  UML Sample  testing questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark " UML Sample  testing questions" Watch " UML Sample  testing questions" New topic
Author

UML Sample testing questions

qcom
Greenhorn

Joined: Jul 03, 2001
Posts: 4
Hi all,
I am prepairing for IBM UML test. I have read the following sample questions, but I am not sure I can get all the correct answers . IF you'd like to help me, please post your answers .

Thanks a lot ,
wenbing Shangguan
1.UML interfaces are used to:

A. define an API for all classes.

B. program in Java, but not in C++ or Smalltalk.

C. define executable logic to reuse across classes.

D. specify required services for types of objects.
Select the best answer.
2. Which of the following are recommended when developing an OO system?
A. Write a description of the concept that a class represents whenever a new class is declared.
B. Use interfaces for types or roles that objects may play, independent of their location in the class hierarchy.
C. Apply design patterns where applicable in the system.
D. Name classes based on their design specifics, such as "array" or "queue".
Select the best answer.
3. What, if anything, is WRONG with the following analysis use case?
Use case: Sell goods
Description: Accept tender from a customer, package products being purchased, and remove the products from inventory.
Actors: Clerk
Preconditions: Customer has chosen products to buy from inventory.
Postconditions: Products are no longer in inventory. Store cash balance is increased.
Steps:
A. There are design details intermixed with the requirements.
B. The actor's actions and system responses are not separated.
C. "Sell goods" is too broad to be a use case.
D. There is nothing wrong with this use case.
Select the best answer.
4. In an OO system, it is desirable to assign responsibilities:
A. according to interaction diagram messaging.
B. more heavily in a few controlling classes.
C. relatively evenly across the classes.
D. to minimize the overhead of message-passing.
Select 2 answers.
6. There is a non-OO legacy application which interacts with a database. It is now required to redesign this application into an OO system that caters to high volume of requests. Which of the following need to be considered while modeling the system?
A. It is not necessary to define classes such that they represent the fields in the database schema. The object model should capture the behavior of the legacy system.
B. The object model should consist of classes whose attributes match the fields defined in the database schema.
C. Perform dynamic modeling to understand the behavior of the existing legacy system.
D. The GUI client objects need to be behavioral driven and they directly communicate with the database.
Select 2 answers.
7. Which of the following is the BEST strategy for resolving class name collisions that occur during OO analysis?

A. Allow each team member to choose names for only those classes which they will build.

B. Create a class for each domain name, passing on requests to the one class that implements the behavior for all of them to share.
C. Refine domain analysis to expose unique names for different concepts that are referred to by the same term.
D. Defer resolution of the collisions to the implementor of the classes.
Select the best answer.
8. What is the BEST model change for the following new requirements in the mortgage processing system?
A government agency (taxing authority) maintains and updates its tax rates on an annual basis. A property's taxable value is also reassessed annually by the taxing authority. When the taxable value changes, it must be remembered. Requests for the amount of taxes due use the present taxable value for the property and tax rates in effect for the taxing authority.
A. Add an updateAssessedValue( newValue ) method to the Mortgage class, which uses newValue in collaboration with the Property's tax rates to provide tax amounts.
B. Add an updateAssessedValue( newValue ) method to the Property class, which uses newValue in collaboration with the TaxingAuthority's tax rates to provide tax amounts.

C. Add an updateAssessedValue( newValue ) method to the TaxingAuthority class, which uses its tax rates to provide tax amounts.

D. Add an updateAssessedValue( newValue ) method to the Property class, which uses its tax notes to provide tax amounts.
Select the best answer.
9. Which of the following details are REQUIRED in OO diagrams?

A.
Show navigability of associations in conceptual (analysis) class diagrams.

B.
Show multiple scenarios of a use case on the same interaction diagram for clear understanding.

C.
Show message sequence numbers in collaboration diagrams.

D.
If asynchronous messages are significant in a scenario, show them in interaction diagrams.
Select 2 answers.
10 . When it comes time to write code, an interaction diagram can quickly provide information on which of the following?

A.
Navigability of associations

B.
The sequence of method calls

C.
Conditions under which a message is sent

D.
State changes in an object

E.
Iteration in the control flow
Select 3 answers.
11.
Scenario: Prepare for an Event
In preparation for a party, the chef will look at the menu. The chef requires a shopping list from each recipe on the selected menu. The system generates the shopping list of ingredients that he needs to buy. Then he just crosses off anything that he already has.
Because the chef is picky about his cooking utensils, he brings his own and doesn't like to depend on the clients to supply anything. In order to make sure that he doesn't forget anything, he uses the system to generate the list of utensils that he'll have to bring with
him to the party. He then proceeds to generate a to do list for the day of the party based on the time that the dinner is to be ready. He finds this to be useful so that everything's ready at the specified time, and nothing is forgotten.
When creating the use cases related to the "Prepare for an Event" scenario, which of the following BEST represents the type of terminology that the use cases should contain?

A.
Chef, menu, recipes, ingredients

B.
End user, bill of fare, cooking specifications, food contents

C.
Chef object, menu object, recipe object, ingredient object

D.
Person record, menu print stream, recipe container, ingredient array
Select the best answer.
12.
Store.com sells small appliances over the Internet. Currently, the store's catalog includes over 50 appliances from 10 different suppliers.
If there is a new requirement to re-stock the warehouse automatically as products are sold, how is the new requirement BEST handled?

A.
Add a deliver() method to the Supplier class that uses the InventoryProduct's amountOnHand attribute to maintain the InventoryProducts in the warehouse.

B.
Add "reorderLevel" and "reorderQuantity" to InventoryProduct. Create a Warehouse class that monitors the InventoryProducts' "amountOnHand", generating an order as levels drop below a "reorderQuantity".

C.
Add "reorderLevel" and "reorderQuantity" attributes used by a new deplete() method in the Inventory class. Use these to generate new orders as InventoryProducts are sold.

D.
Add "reorderLevel" and "reorderQuantity" attributes used by a new deplete() method in the InventoryProduct class. Use these to generate new orders as InventoryProducts are sold.
Select the best answer.
13.
When the loan officer receives the completed application for a new mortgage, a folder will be created for the customer. The loan officer will then commission an appraisal of the collateral property and request financial information from the customer's financial
institutions and workplace.
Which of the following is TRUE?

A.
The verbs in the requirements become methods in the object model.

B.
Some of the verbs in the requirements become methods of the nouns they reference. E.g., a FinancialInstitution
class would have a getFinancialInformationFor( aCustomer ) method.

C.
Some of the verbs in the requirements become methods of the concept taking the action. E.g., a LoanOfficer class
would have a getFinancialInformationFor( aCustomer ) method.

D.
Some of the verb phrases in the requirements become overriding methods of the related superclass, due to the
specialization of the action.
Select the best answer.
14. Which of the following are TRUE about State diagrams?

A. They are good at depicting the behavior of an object across multiple use cases.

B. They are good at depicting interactions among multiple objects.

C. They are best used for objects that have multiple interesting states and not for most or all the objects in the system.

D. They can be used for user interface or control objects.
Select 3 answers.
15.
An iterative development process:

A. represents a structured methodology, which includes functional decomposition.

B. is a technique for managing complexity and plans for change during software development.
C. is a top-down approach without the dataflow diagrams.

D. is equivalent to an incremental development process.
Select the best answer.
16.
Which of the following are TRUE about implementing a system based on existing OOAD assets?

A.
Due to constraints introduced by the target language, such as C++, Smalltalk, or Java, as well as physical packaging, the OO analysis model does not carry forward into detailed design and implementation.

B.
The classes, methods, attributes, and relationships identified during the OO analysis carry forward into detailed design and implementation.

C.
Design 'The OO analysis model is usually refactored later in the project.

D.
The classes from the OO analysis are expanded to add private methods and collaborations with helper classes.
Select 3 answers.
18. The design for a complex application with a large number of classes has just been completed. Which of the following is the BEST approach for unit-testing the classes?
A.
Use the package diagrams to group classes logically and perform unit-testing on a package-by-package basis.

B.
Use activity diagrams to identify parallel behavior and test classes that use threads.

C.
Use the interaction diagrams to step through the interactions between the classes and perform visual inspection of the code to identify discrepancies.

D.
Use the class diagram to ensure that the classes have been correctly coded and perform unit-testing for each class association and for each class.
Select the best answer.
19. When using OOAD artifacts to organize and assign team responsibilities on a project, it is BEST to:
A.
evenly distribute use cases among team members and have them work as independently as possible in order to minimize code dependencies.

B.
designate one team for implementing interaction diagrams related to the "common code path" and another team for implementing interaction diagrams related to "code path variations" (for example, conditional or error paths)

C.
divide teams according to package diagram dependencies and utilize use cases to schedule the work for the individual team members.

D.
divide teams according to the layers in the software architecture and have them work as independently as possible in order to minimize dependencies between the layers.
Select the best answer.
20. Which of the following are TRUE about interaction diagrams?
A.
Interaction diagrams are at their best when they illustrate multiple scenarios.
B.
Interaction diagrams are good at designing part or all of one use case's functionality across multiple objects.
C.
Interaction diagrams are good for static modeling, since they fill out the classes and methods in the domain.
D.
Interaction diagrams allow the analyst to show iteration and conditional execution for messaging between objects.
E.
Sequence diagrams are logically equivalent to collaboration diagrams, differing primarily in format of presentation.
Select 3 answers.
21. A resulting benefit of using polymorphism is reduction of:
A.
methods in the associated classes.

B.
subclasses needed to accomplish the same functionality.

C.
case statements and conditionals.

D.
coupling between classes in the system.
Select the best answer.
22. Benefits resulting from designing and implementing layered application components include:

A.
Reduced initial design time.

B.
Reduced time for initial development cycle.

C.
Reduction of GUI layer changes impacting the model layer.

D.
Maintainability and reuse of the application components.
Select 2 answers.
23. When creating a subclass, which of the following are TRUE?

A.
The selected superclass should be chosen because it has some methods the subclass can reuse, even if others do not apply.

B.
The class name should normally be a qualification of its superclass' name.

C.
The subclass has the same type as all of its superclasses.

D.
The superclass should be marked as abstract.
Select 2 answers.
24. Valid reasons for grouping classes into the same package are that the classes:
A.
are related by aggregation.

B.
are worked on by the same group of developers.

C.
are related by specialization.

D.
support the same high-level services.
Select 2 answers.

25. Which of the following are TRUE about interpreting class diagrams from different perspectives?
A.
Specification (design) perspective class diagrams are developed without considering the programming language that might be used to implement it.

B.
The conceptual (analysis) perspective class diagram of an application would not include all the classes required and their details, rather, they would only identify domain classes.

C.
In the conceptual (analysis) perspective, associations represent relationships between classes, whereas they represent responsibilities in the specification perspective.

D.
Operations (the processes that a class knows to carry out) should be used in conceptual (analysis) models to specify the interface of a class.
Select 2 answers.

28. When designing the user interface for an application, if it is unclear what skill level the end user of an application will possess, which of the following is the BEST approach to take?
A. Define the skill level that will be required by the end user and make the necessary arrangements for educating the users.

B. Define the skill level that will be required by the end user and provide detailed on-line help that can be accessed by the users when needed.

C. Prototype portions of the user interface and perform some usability tests to identify any problem areas. Document any issues in the product readme and have the users read it before using the product.

D. Prototype portions of the user interface and perform some usability tests to determine the users' level of satisfaction. Make any necessary changes and repeat the process.
Select the best answer.
29. Which of the following are TRUE about the strengths and weaknesses of activity diagrams?
A.
Activity diagrams are good at enumerating object collaborations to accomplish a task.

B.
Activity diagrams are good at exploring the interactions related to one or more use cases.

C.
It is difficult to discern exactly how to map the activity diagram actions to object model specifics.

D.
Since activity diagrams allow parallel behavior modeling, they are good for workflow modeling.
Select 3 answers.
30. Which of the following are TRUE about a deployment diagram?

A.
Since there is always some kind of response to a message, the dependencies are two-way between deployment components.

B.
Dependencies between deployment components tend to be the same as the package dependencies.

C.
Deployment diagrams can used to show physical modules of code.

D.
Deployment diagrams can be used to show the physical distribution of a system across computers.
Select 3 answers.
31. Use case: Book a Party
Description: The chef can book a party for an existing client
Actors: Chef
Preconditions: The chef is logged onto the system. The client account already exists.
Postconditions: The party is booked and the chef's calendar is updated.
Steps:
1. A client calls to book the chef for a party. The chef does a search on his calendar for his availability.
2. Once the client and chef agree on a date, the chef then does a search on the client to pull up the client's previous social engagements and preferences.
3. The chef and the client discuss various menu alternatives until they agree on one. The chef books the event with the menu selected.
4. The chef tells the client how much the party will cost based on the menu and the number of guests. He asks the client to send him a deposit.
5. Once the conversation is over, the chef generates a letter to confirm the date, time, menu selected, the number of guests, and the total cost. The letter also requests that the client send a deposit.
Which of the following is the BEST list of candidate interaction diagrams to support the use case?

A.
Find available date, Search for client, View client preferences, Book an event, Calculate cost of event, Generate confirmation letter

B.
Find available date, Search for client, View client preferences, Explain menu alternatives, Book an event, Calculate cost of event, Generate confirmation letter

C.
Find available date, Search for client, View client preferences, Book an event, Calculate cost of event, Request deposit, Generate confirmation letter

D.
Find available date, Search for client, View client preferences, Book an event, Calculate cost of event, Generate confirmation letter, Mail confirmation letter
Select the best answer.
32.
Which of the following are TRUE about software architectures?

A.
Two tier software architectures do not scale to as many clients as three (or more) tier architectures.
B.
Two tier architectures lead to more reuse than three or more tier architectures.

C.
Thin clients are restricted to GUI parts.

D.
Dividing the application architecture into View, Model, and Persistence layers leads to flexibility.
Select 2 answers.
33. What are good practices to follow during refactoring?
A.
Renaming a method and moving a field from one class to another should be done in small steps, testing changes as required.

B.
Break down classes that are heavily loaded with responsibilities into smaller classes and distribute the responsibilities among them effectively.

C.
Consolidate similar methods from different classes in the same type hierarchy into a common super class wherever possible.

D. Add functionality and refactor simultaneously in order to obtain an efficient and effective design.
Select 3 answers.
34. Which of the following are good practices to use while designing for reuse?

A.
Define a persistence framework that provides services for persisting objects.

B.
Use design patterns, wherein complete solutions are already defined.

C.
Use controller objects to control the flow of processes in the system.

D.
Assign responsibilities to classes such that coupling between them remains low.

E.
Design classes with low cohesion.
Select 2 answers.
35. In a large system consisting of many packages, three are called A, B, and C. Package C is dependent on Package B, and Package
B is dependent on Package A. Which of the following changes may directly affect Package C?

A.
Moving a class from Package B to Package A.

B.
Changing the parameter list of a public method in Package A.

C.
Changing the parameter list of a public method in Package B.

D.
Changing the return type of a private method in Package B.

E.
Changing the return type of a public method in Package B.
Select 3 answers.
36. If a use case had a requirement "Calculate account balance," which OOAD artifact would be the BEST source for determining the name of the public method used to invoke the operation?

A.
Use cases

B.
Interaction diagrams

C.
Class diagram

D.
Activity diagram
Select the best answer.
40. Refer to the designs below:
- In Design #1, the Catalog object has a getProducts() method, which returns a xx collection object, such as a Dictionary or Array,
containing all the Products the company sells.
- In Design #2, the Catalog object has a getProductNumbered(anIdentifier) method, which returns the Product with the specified unique identifier.
Considering a requirement to get a specific product, which of the following BEST characterizes the two designs?

A.
Both designs maintain the objects' encapsulation and reduce coupling by accessing state data via methods only
and not directly.

B.
Both designs break the objects' encapsulation, increasing the amount of coupling.

C.
Design #1 increases the amount of coupling. Design #2 maintains the encapsulation of the Catalog, making future
design changes easier.

D.
Design #1 maintains the encapsulation of the Catalog by hiding the implementation details in the getProducts() method. Design #2 breaks the encapsulation of the Catalog since it uses anIdentifier as the Product key.
Select the best answer.
41.
Given the requirement statement below, which of the following public methods would be used in a related sequence diagram?
When a mortgage payment is received, the appropriate amortization table will be used to calculate the interest and principle amounts to apply against the balance.

A.
aBalance.subtract( anAmount )

B.
anAmortizationTable.calculateInterestUsing( aPayment )

C.
anAmortizationTable.apply( aPayment )

D.
Mortgage.apply( aPayment )
Select 2 answers.
42. A system undergoing performance testing is found to be "thrashing" (a condition that occurs when there is too much concurrency).
Which of the following artifacts would be MOST helpful to uncover the problem?

A.
The use case descriptions

B.
A state diagram

C.
A process view

D.
An activity diagram

E.
A collaboration diagram
Select 2 answers.
43. When scheduling project activities such as functional increments and test case development, which one of the following OOAD artifacts is the MOST useful?

A.
Use cases

B.
Interaction diagrams

C.
Activity diagrams

D.
Package diagrams

E.
Class diagrams
Select the best answer.
44. Which of the following MUST be present to write use cases?

A.
Development team

B.
Object technology expert

C.
Domain expert

D.
Requirements scooping decision maker
Select 2 answers.
47. A use case model should:

A.
Capture as much design detail as possible.

B.
Identify all of the actors, use cases, and their relationships.

C.
Describe all of the implementation specifics of an application.

D.
Address both the problem domain and the solution domain.
Select the best answer.
48. Refer to the exhibit to answer the question.
What methods MUST be implemented by the Account class?
A.
withdraw, checkBalance

B.
withdraw, log, checkBalance

C.
withdraw, checkBalance, acknowledgement

D.
withdraw, acknowledgement
Select the best answer.
49.
During implementation, the development team decides to use a third party utility to provide some of the required functionality. What OOAD artifact would MOST likely reflect this change?

A.
Activity diagram

B.
Package diagram

C.
State diagram

D.
Interaction diagram
Select 1 answers.

50. Scenario: Prepare for an Event
In preparation for a party, the chef will look at the menu. The chef requires a shopping list from each recipe on the selected menu.
The system generates the shopping list of ingredients that he needs to buy. Then he just crosses off anything that he already has. Because the chef is picky about his cooking utensils, he brings his own and doesn't like to depend on the clients to supply anything.
In order to make sure that he doesn't forget anything, he uses the system to generate the list of utensils that he'll have to bring with him to the party.
He then proceeds to generate a to do list for the day of the party based on the time that the dinner is to be ready. He finds this to be useful so that everything's ready at the specified time, and nothing is forgotten.
Which of the following is the BEST set of candidate use cases for the "Prepare for an Event" scerio?

A.
Prepare for party, Display menu, Generate shopping list, Exclude ingredients on hand, Generate utensil list, Generate to-do list

B.
Prepare for party, Display menu, Generate shopping list, Generate utensil list, Pack utensils, Generate to-do list

C.
Display menu, Generate shopping list, Generate utensil list, Generate to-do list

D.
Display menu, Generate shopping list, Exclude ingredients on hand, Generate utensil list, Generate to-do list

E.
Generate shopping list, Exclude ingredients on hand, Generate utensil list, Generate to-do list, Check utensil list

Select the best answer.
51. An Observer is a design pattern where dependent objects "register" with another "server" object so that they are notified of changes to the server object. The server object isn't specifically aware of its dependents, but only knows to notify them of changes to its state.

Which of the following uses an Observer pattern to maintain the correct separation of model and view in a layered software architecture?

A.
GUI components register with business components so that they can update their views when the underlying model objects change.

B.
GUI components register with other GUI components so that can be notified of user changes to the state of the system.

C.
Business components register with GUI components so that the GUI components know who to ask for updates to their state.

D.
Business components register with other business components so that they can enforce business rules based on state change.
Select the best answer.
52.
Which of the following are effective ways to manage an OO project?

A.
Organize development teams along the lines of the packages.

B.
Organize the scheduled tasks so that easy, low-risk items are addressed first.

C.
Organize the test cases to follow the use case scenarios.

D.
Organize the user's guide along the lines of the packages.
Select 2 answers.

53. Which of the following are TRUE about services resulting from use cases?

A.
New requirements in use cases generally result in one or more public methods in a domain model class.

B.
Private methods are required by the system's use cases.

C.
Use cases drive the design of interaction diagrams, which in turn define public methods in domain model classes.

D.
Each alternative scenario of a use case generally results in a new association between classes.
Select 2 answers.
54. Based on the following statements from a domain expert on a project, which of the following are requirements that MUST be extracted?
"We get incomplete mortgage applications all the time. In those cases, we just hand them back to the customer with a handwritten note telling them what's missing. We have to log the application anyway, so we use the new mortgage screen to enter the customer
information and assign a unique identifier to the file. In the past, we have entered the address in upper case. The identifier follows an industry standard format of bank number, customer account number, and the next available number for that customer all as one
long number."

A. A note must be sent to the customer for incomplete mortgage applications, listing the missing items.

B. A file must be established for every mortgage application at the time it is submitted, whether the application is complete or not.

C.
Addresses on mortgage applications must be entered as all capital letters.

D.
A unique mortgage number must be assigned to each mortgage file. This identifier must follow financial industry standard format.
Select 2 answers.

57. Refer to the partial requirements below: When the loan officer receives the
completed application for a new mortgage, a folder will be created for the
customer. The loan officer will then commission an appraisal of the collateral
property and request financial information from the customer's financial
institutions and workplace. Which of the following is TRUE?
A. The verbs in the requirements become methods in the object model.
B. Some of the verbs in the requirements become methods of the nouns they
reference. E.g., a FinancialInstitution class would have a
getFinancialInformationFor( aCustomer ) method.
C. Some of the verbs in the requirements become methods of the concept taking
the action. E.g., a LoanOfficer class would have a getFinancialInformationFor(
aCustomer ) method.
D. Some of the verb phrases in the requirements become overriding methods of
the related superclass, due to the specialization of the action.
Select the best answer.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
I'd really like to help you - but I think it would be much better if you tried to answer the questions for yourself, first. Then you can post any specific doubts and we can discuss them.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UML Sample testing questions