0% found this document useful (0 votes)
52 views36 pages

SE Lab Manual 2024

Uploaded by

MANYA MISHRA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views36 pages

SE Lab Manual 2024

Uploaded by

MANYA MISHRA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

Indira Gandhi Delhi Technical University for Women

(Established by Govt. of Delhi vide Act 09 of 2012)


Kashmere Gate, Delhi-110006

DEPARTMENT OF IT

Lab Manual
Subject Name : Software Engineering
Subject Code : BIT 203
Programme : B.Tech. (IT) & B.Tech (AI&ML)
Batch 2023-2027
Semester : 3rd
Session : August 2024-December 2024

Prepared By
Prof R K Singh, Professor (IT)

Document Date of Revision: 05.08.2024


CONTENTS

S.No Topic Page No


1 Objectives of Software Engineering Lab 3
2 Learning Outcomes 4
3 Guidelines for Students 4
4 Lab Exercise -1 5-6
5 Lab Exercise 1A 7
6 Lab Exercise 2 8
7 Lab Exercise 2A 8-9
8 Case Study : Famous State University Course Registration 10
Problem Statement
9 Lab Exercise 3 11
10 Lab Exercise 4 12
11 Lab Exercise 4A 12
12 Lab Exercise 5 13
13 Lab Exercise 5A 14
14 Lab Exercise 6 15
15 Schedule for Submission of Lab Assignments 16
16 Format for the deliverables 17-22
i). Use Case Specification Document
ii). Class Analysis Document
iii). Sequence Diagram Document
iv). Collaboration Diagram
v). Document Class Diagram Document
17 Tutorial on Rational Rose 23-35

2
3
Objectives of Software Engineering Lab

The Software Engineering Lab provides a deep insight into the importance of
requirement modeling in the software industry. It will enable us to learn the
Rational Rose/Star UML tool employed in the software development life cycle,
which makes the process of requirement modeling easy to understand and
implement.

Requirements modeling is an information technology for making it easier to


capture, communicate, track, analyze, verify, validate, view, and manage the
hundreds of hierarchical and interrelated engineering requirements necessary for
large and/or complex systems. It will significantly reduce the cost of systems
development and will reduce the probability and severity of cost and schedule
growth (overruns) by enabling the description of human readable and “computer
friendly”, specifications of a system’s engineering requirements.

Rational Rose/Star UML is the tool which will be used for the requirement
modeling. It gives us the environment where the entire process of development
can be specified to its minutest detail. It gives us the facility to design our front-
end process as well as our database structure.

Application Tools

• Rational Rose/Star UML

4
Learning Outcomes

1. The students shall be able to Understand, analyze and design and document
software applications.
2. Students will be able to create analysis model of their project using Star
UML by Developing Use Case Diagram, Sequence Diagram, Class
Diagram etc.
3. Students shall be able to prepare DFD, Entity Relationship Diagram and
create Software Requirement Specification Document
4. Student shall also able to apply the Engineering to the development of the
Software application

Guidelines for the Students:

1. The students will work individually under the guidance of the faculty.
2. They should have at least one meeting in a week with the faculty for the
assessment of their work progress.
3. The students should meet the faculty with the formal documents and
proper presentations prepared of their work till date.
4. Every student should always be prepared for a viva-voice or
presentation of her work.
5. Regularity and sincerity will be taken into consideration while
evaluating the students.

Please note that Analysis and Design follows an iterative


approach.

Therefore, solving the Lab Exercises and the Case Studies will
follow a series of iterations to evolve into the Solution

5
Lab Exercise -1
All the students in the class has pre-requisite of a programming language. As a part of
verification of the program you must have done the dry run of the program without actually
executing the program. A program must execute the decision statement correctly to achieve the
desired output. One of the approach to achieve this is to draw Control Flow Graph [CFG] of
the given program to verify the logic and the correctness of the program.

Objectives:
1) Understand the Logic of the Program
2) Create the Control Flow Graph.
3) This flow Graph will be subsequently used for White Box Testing of the Program

Control Flow Graph [CFG]

CFG is graphical representation of control flow or computation during the execution of the
programs. Control flow graph are mostly used in static analysis as they can accurately represent
the flow inside of a program.

A CFG is a directed graph in which each node represents a basic block and each edge represents
the flow of control between basic blocks. A basic block is a sequence of consecutive statements
in which flow of control enters at the beginning and leaves at the end without halt or possibility
of branching except at the end. To build a CFG we first build basic blocks, and then we add
edges that represent control flow between these basic blocks. Each statement of the Program
is numbered and considered as node for drawing the CFG. The ‘Entry’ and ‘Exit’ nodes defines
the ‘Start’ and ‘End’ of the Program. For example, on the left side of the Fig. 1, all the
statements of the Program ‘Sums’ has been numbered and on the Right side Control Flow
Diagram has been drawn. The diagram depicts the traversal of the nodes and branching
statements.

6
Program Sums
1. read(n);
2. i = 1;
3. sum = 0;
4. while (i<= n) do
5. sum = 0;
6. j = 1;
7. while (j <= i) do
8. sum = sum + j;
9. j = j + 1;
endwhile;
10. write(sum, i);
11. i = i + 1;
endwhile;
12. write(sum, i);
End Sums

Exercise 1.1: Write a program to compute 𝑎𝑒 and draw its corresponding CFG.

Exercise 1.2: Write a program to accept a number and find the sum of its digits repeatedly till
the result is a single digit. For example: if entered digits are 8953, program will compute and
print 8953, 25, 7 . Draw its corresponding CFG.

Exercise 1.3: Write a program to compute the average of 100 or fewer numbers that lie between
the bounding values: It also computes the sum and the total number valid.

7
Exercise-1A for Advanced Learner
Exercise AL1.1 : Write a program to find prime factors of a number. Find the largest and
smallest prime factor. Draw CFG for the program.

Exercise AL1.2: Write a program that accepts three integers, a, b, and c, as input. These are
taken to be sides of a triangle. The output of the program is the type of triangle determined by
the three sides: Equilateral, Isosceles, Scalene, Right Triangle or NotATriangle. Draw the CFG
of the program.

Exercise AL1.3: NextDate is a function of three variables: month, date, and year. It returns the
next date of the day after the input date. The month, date, and year variables have integer
values. Draw its CFG.

8
Lab Exercise -2
Objectives:
1) To refresh the Programming Skills in any language like C, C++, Python or JAVA

2) To understand the given scenario and read the problem in between the lines for building
up the generic program

3) Showcase the programming skills and provide the generic optimized solution

Exercise 2.1 : Every year new students are admitted in the various program offered by the
college. On admission of the students in a program, the Academic Branch generates the
Enrollment Number to every student. Presently, the college is generating the enrollment
number manually which sometime results into anomaly.

You are required to write a program for auto generation of the enrollment number to the
students.

Exercise 2.2: A college is having number of Departments. The IT Inventory like Server,
Desktop Computer, Laptop, Printer, UPS, Scanner, Projector are being issued to the various
departments for smooth conduct of the Academics. For effective management of the
Department IT Inventory, a Unique Code for each inventory is required to be allotted. The
Department may be issued additional Inventory Items based on their requirement.

You are required explore the problem thoroughly and write a Program for auto generation of
Unique Number to the listed IT Inventory.

Exercise 2A for Advanced Learner


Exercise AL2.1 : After writing the program, the programmer checks the logic by creating some
test cases that traverse over the various branches of the program. In the previous exercise, you
have learned to create the control flow graph for a given program.

In this lab exercise you are required to write a program that imitate the behavior of the CFG.
Your program should take “another program as input’ and generates its Control Flow Graph.
The CFG program shall also traverse the various node for the test cases prepared for the dry
run and changes the color of the path and nodes that have been traversed.

9
Exercise AL2.2 You have been hired as an Engineer for supporting the Project Manager in the
Project “Online Examination System [NOES]” for Examination like GATE. As a part of the
Project, you are required to manage a large corpus of the multiple choice questions submitted
by faculty/expert in the area of General English, Quantitative Reasoning, Logical Reasoning,
Mathematics, Computer Science and Electronics & Communication. Questions can also be
obtained directly through website and books etc.

Another group of faculty member will do the validation of the questions online for the
allotted subject or part thereof. Online Examination System (NOES) shall use the validated
questions for the generation of the question paper. Controller of Examination (COE) shall be
the Administrator of the Question Bank System. COE shall be able to manage the different
types of the users, grant the rights for accessing the various type of information from the system
to the various users. He shall also be responsible management of the question pool and
authorizing the payment to the various users. COE shall be able to delegate his responsibilities
to one or more officials in the department.

The broader areas of subject in which questions are collected are classified as under:
a. General Subjects
i. English Language and Comprehension
ii. Quantitative Aptitude
iii. Logical Reasoning
iv. Mathematics

b. Engineering and Technology Subjects


i. Computer Science / IT
a) Theory Subjects
b) Programming Subjects
c) Computer Networking and Communication Subjects
ii. Electronics and Communication
a) Electronics: Analog
b) Electronics: Digital
c) Electronics: Communication
d) Electronics: Signals
e) Electronics: Control System
f) Electronics: Microwave Communication

(ii) Addition of New Subjects : For the richness of the question bank, a new
subject may be added

You are required explore the problem thoroughly and write a Program that generates the
Unique Number to question bank so that each question can be uniquely identified with
traceability to the faculty submitting the question or source (Book/Website, if collected
directly] and the reviewer who is validating the question.

10
CASE STUDY

Famous State University Course Registration Problem Statement [FSU]

At the beginning of each semester, students may request a course catalog containing a
list of course offerings for the semester. Information about each course, such as professor,
department and prerequisites will be included to help students make informed decisions.
The new system will allow students to select four courses offering for the coming
semester. In addition, each student will indicate two alternative choices in case a course
offering becomes filled or canceled. No course offering will have more than ten students
or fewer than three students. A course offering with fewer than three students will be
cancelled.

Once the registration process is completed for as student, the registration system sends
information to the billing system so the student can be billed for the semester.

Professor must be able to access the online system to indicate which courses they will
be teaching, and to see which students signed up for their course offerings.

For each semester, there is a period of time that students can change their schedule.
Students must be able to access the system during this time to add or drop courses.

11
Lab Exercise -3
Objectives:
1) To understand the process of identification of Actors and Use Case from a given
scenario for detailing the functionality.
2) Install and explore UML Diagramming Tool “StarUML”

Exercise 3.1 :
i) Define Use Case Diagrams
ii) Why we model Use Case Diagrams
iii) What is the difference between use case diagrams and use case
iv) What are the four major components of a use case diagram
v) What do actors represent in a Use Case Diagram
vi) Interpret and explain the following use case diagram

vii) Briefly describe the purpose of Use Case Specification Document Template

12
Lab Exercise-4
Objectives:
✓ To understand and analyze the FSU Case Study
✓ Draw the Use Case Diagram
✓ Prepare the Use Case Description Document

Exercise 4.1 Identify the use cases and actors for the FSU Case Study.
Exercise 4.2 Draw the Use Case Diagram using StarUML
Exercise 4.3: Prepare the Use Case Description for the various Use Case(s) identified for the
FSU Case following the Use Case Description Template.

Exercise 4A for Advanced Learner


Exercise AL4.1 TicketDistributor is a machine that distributes tickets for trains. Traveler have
the option of selecting a ticket for a single trip or for multiple trips or selecting
a time card for a day or a week. The TicketDistributor computes the price of
the requested ticket based on the area in which the trip will take place and
whether the traveler is a child or an adult. The TicketDistributor must be able
to handle several exceptions, such as travelers who do not complete the
transactions, travelers who attempt to pay with large bills and resource outages
such as running out tickets, change or power
Prepare the Use Case Description - PurchaseOnewayTicket

13
Lab Exercise 5
Objectives:
✓ To understand the process of Drawing Data Flow Diagram
✓ To decompose the Zero Level/Context DFD into First Level DFD
✓ Draw Use Case Diagram and Use Case Description

Following is the description of the working of a bank:

A customer presents a cheque to a clerk who issues a token. The clerk checks the customer’s
signature and if the balance in the customer’s account is sufficient. The cheque is passed for
payment after entering the transaction in the ledger. An accountant checks the entries and
certifies the cheque for payment and passes it to the cashier. The cashier pays the amount to
the customer by collecting the token and enters the transaction in the Cash Book. On the other
hand, a customer can remit cash to the cashier using a challan and the cashier passes the challan
indicating the amount in the ledger.

Exercise 5.1 Draw a DFD to represent the working of a bank as described above.

Exercise 5.2 Draw Use Case Diagram to represent the working of a bank as described above

Perfect Pizza wants to install a system to record orders for Pizza and Chicken wings. When
regular customers call Perfect Pizza on the phone, Perfect Pizza asks for their phone number.
When the number is typed into the computer, the name, address and the last order date is
automatically brought up on the screen. Once the order is taken, the total, including tax and
delivery expenses is calculated. Then the order is given to the cook and a receipt is printed.
Occasionally, special offers(coupons) are printed so that the customer can get a discount.
Drivers who make deliveries give customers a copy of the receipt and a coupon(if any). He
also collects the payment from the customer and deposits the same in the cash section. Weekly
totals are kept for comparison with last year’s performance.

Exercise 5.3 : Draw a context diagram for Perfect Pizza.


Exercise 5.4 Explode the context diagram showing all the major processes in First Level
DFD.
Exercise 5.5 : Draw the Use Case Diagram for the Perfect Pizza

14
Consider the following Library Information System (LIS) software:
The Librarian can create a new member record by entering the new member’s name and
address. LIS would assign a unique membership number to each new library member. The
Librarian can also delete a membership by entering the membership number.

LIS registers each book issued to a member. When a member returns a book. LIS deletes the
book from the member’s account and makes the book available for future issue.

When a member returns an overdue book, the LIS software computes the penalty charge and
prints a bill towards fine payable by the member.

A member can query about the availability of a book by inputting the name of a book or the
name of the author of the book. If the book is available, LIS would print the book location
(rack number in which the book is located), the number of copies of the books available for
issue and the number of copies of the book already issued.

Exercise 5.6: Draw a context diagram for Library Information System.


Exercise 5.7: Explode the context diagram showing all the major processes of Library
Information System in First Level DFD.
Exercise 5.8: Draw the Use Case Diagram for the Library Information System

Exercise 5A for Advance Learners


Consider the Employee Hiring System described in the following narrative. While drawing
various diagrams, If you discover that the narrative is incomplete, make up reasonable
explanations to complete the story. Supply these extra explanations along with the diagrams.
Here is the narrative.

Projects, Inc. is an engineering firm with approximately 500 engineers of different types. The
company keeps records on all employees, their skills, projects assigned, and departments
worked in. New employees are hired by the personnel manager based on data in an application
form and evaluations collected from other managers who interview the job candidates.
Prospective employees may apply at any time. Engineering managers notify the personnel
manager when a job opens and list the characteristics necessary to be eligible pool of applicants
with the characteristics of an open job, then schedules interviews between the manger in charge
of the open position and the three best candidates from the pool. After receiving evaluations on
each interview from the manger, the personnel manager makes the hiring decision based upon
the evaluations and applications of the candidates and the characteristics of the job, and then
notifies the interviewees and the manger about the decision. Applications of rejected applicants
are retained for one year, after which time the application is purged. When hired, a new
engineer completes a nondisclosure agreement, which is filed with other information about the
employee.
Exercise AL 5.1 : Starting with a context diagram, draw as many nested DFD’s as you
consider necessary to represent all the details of the “Employee Hiring
System”
Exercise AL 5.2 : Draw Use case Diagram for the “Employee Hiring System”

15
Lab Exercise-6

Objective:
✓ To understand the different type of analysis classes for a use case.
✓ To create the structure of the s/w in terms of analysis classes.
✓ To understand the concept of stereotype.

Exercise 6.1 : Prepare a Class for describing the object “Briefcase”


Exercise 6.2 :A car consists of different structural components such as the engine, body,
suspension, gearbox, etc. Each component in turn contains its own attributes and operations.
For example, the engine has its capacity, and it can be started or stopped.

Document a simplified structural model of a car in a class diagram.

Exercise 6.3 : In sales order system, there are three methods of payment: cash, credit card or
check. These three payment methods have the same attribute (amount), but
they have their own individual behaviors and attributes.

Document a structural model of this sales order system in a class diagram.

16
Schedule for Submission of Lab Assignments

Lab Exercise Class Last Date of Submission

Lab Excersice-1 IT

AI & ML

Lab Exercise-2 IT

AI & ML

Lab Excersie-3 IT

AI & ML

Lab Excersie-4 IT

AI & ML

Lab Excersie-5 IT

AI & ML

Lab Exercise -6 IT

AI & ML

Almost each Lab Exercise contain “Exercise for Advanced Learner”. Students are expected
to solve these exercise and submit the solutions as per the deadlines for the Lab.

Please note that all the Lab Exercise are to be uploaded on the e-LMS on or before the deadline.
The e-LMS portal will not accept the submission beyond the schedule. The Exercise can be
submitted latest by 11:30 p.m. on the given date on the e-LMS Portal.

Note: Additional Lab Exercises will be added during the course of study

17
Formats For The
Deliverables

18
Use Case Specification Document Template

1. Use Case Name

1.1 Brief Description

[ The description should briefly convey the role and purpose of the use
case. A single paragraph should suffice for this description.]

2. Flow of Events

2.1 Basic Flow

[ This use case starts when the actor does something. An actor always
initiates use Cases. The use case should describe what the actor does and
what the system does in response. It should be phrased in the form of a
dialog between the actor and the system.

The use case should describe what happens inside the system, but not how
or why. If information is exchanged be specific about what is passed back
and forth. For example, it is not very illuminating to say that the Actor
enters customer information; it is better to say the Actor enters the
customer’s name and address. A Glossary of Terms is often useful to keep
the complexity of the use case manageable; you may want to define things
like customer information there, to keep the use case from drowning in
details.

19
Simple alternatives may be presented within the text of the use case. If it
only takes a few sentences to describe what happens when there is an
alternative; do it directly within the flow of events section. If the
alternative flows are more complex, use a separate section to describe it.
For example An Alternative Flow describes how to describe more
complex alternatives.

A picture is sometimes worth a thousand words (though there is no


substitute for clean, clear prose). If it improves clarity, feel free to paste
graphical depictions of user interfaces, process flows, or other figures
into the use case to improve its clarity. If a flow chart is useful to present
a complex decision process, by all means use it! Similarly for state-
dependent behavior, a state-transition diagram often clarifies the
behavior of a system better than pages upon pages of text. Use the right
presentation medium for your problem, but be wary of using terminology,
notation or figures that your audience may not understand. Remember
that your purpose is to clarify, not obscure.]

2.2 Alternative Flows

2.2.1 <First Alternative Flow>

[More complex alternatives should be described in a separate section,


which is referred to in the basic flow of events section. Think of the
alternative flow sections like alternative behavior – each alternative flow
represents alternative behavior (many times, because of exceptions that
occur in the main flow). They may be as long as necessary to describe the
events associated with the alternative behavior. When an alternative flow

20
ends, the events of the main flow of events are resumed unless otherwise
stated.]

2.2.1.1 <An Alternative sub-flow>

[Alternative flows may in turn be broken down into sub-sections if it


improves clarity.]

2.2.2 <Second Alternative Flow>

[There may be, and most likely will be, a number of alternative flows in a
use case. Keep each alternative separate to improve clarity. Using
alternative flows improves the readability of the use case, as well as
preventing use cases from being decomposed into hierarchies of use cases.
Keep in mind that use cases are just textual descriptions, and their main
purpose is to document the behavior of a system in a clear, concise and
understandable way.]

3. Special Requirements

[A Special Requirement is typically a non-functional requirement that is


specific to a use case but is not easily or naturally specified in the text of
the use case’s event flow. Examples of special requirementsinclude legal
and regulatory requirements, application standards, and quality attributes
of the system to be built, including usability, reliability, performance or
supportability requirements. Additionally, other requirements such as
operating systems and environments, compatibility requirements, and
design constraints should be captured in this section.]

21
3.1 <First special requirement>

4. Preconditions

[A precondition (of a use case) is the state of the system that must be
present prior to a use case being performed.]

4.1 <Precondition One>

5. Post Conditions

[A post condition (of a use case) is a list of possible states the system can
be in immediately after a use case has finished.]

5.1 <Post condition one>

6. Extension Points
[Extension points of the use case.]
6.1 <Name of extension point>
[Definition of the location of the extension point in the flow of events.]

22
Class Analysis Document

The class analysis document should contain the following information:


• A brief description on what does one understand by Class Analysis
• A brief description on types of Analysis Classes.
• Identify all the Analysis Classes for your problem statement and briefly describe their
purpose.

Sequence Diagram Document


The Sequence Diagram Document should contain the following information:
• A sequence diagram for each Use case of your system.
• A brief description on the symbols used in the sequence diagram explaining the
reason for the usage of that particular symbol.
• A brief description on the flow of each event in each sequence diagram.

Collaboration Diagram Document


The Collaboration Diagram Document should contain the following information:
• A collaboration diagram for each Use case of your system.
• A brief description on the symbols used in the collaboration diagram explaining the
reason for the usage of that particular symbol.
• A brief description on the flow of each event in each collaboration diagram.

Class Diagram Document


The Class Diagram Document should contain the following information:
• A Class diagram for each Use case of your system.
• A brief description on the symbols used in the Class diagram explaining the reason for
the usage of that particular symbol.
• A brief description on the flow of each event in each Class diagram.

23
Tutorial on Rational Rose

Analysis and Design Methodology


Framework: A framework in Rational Rose is a set of predefined model elements that are
needed to model a certain kind of system. The purpose of a specific framework can be to define
the architecture of systems of a certain kind or to provide a set of reusable components.
Frameworks are used as templates when creating a new model. Each framework is stored in a
separate folder in the \Framework\Frameworks folder (the framework library) in your Rational
Rose installation folder.

Use Case Diagram:Depicts interaction between Actors and Use Cases.

Use Case: A use case is a sequence of actions a system performs that yields an observable
result of value to a particular actor.

Actor: An actor represents many things that interact with the system.

24
Stereotype: Representing one model element in the form of another model element.

Classes are stereotyped depending on the following categories:

Boundary Class: A boundary class is used to model interaction between the systems
surroundings and its inner workings. They are of following types:

• User Interface Classes: Intermediate communication with human users of the system.
• System Interface Classes: Intermediate communication with other system.
• Device Interface Classes: Intermediate communication with external devices.

Control Class: A control class provides coordinating behavior in the system.

25
Entity Class: An entity class stores and manages information in the system.

Sequence Diagram: A sequence diagram is a graphical view of a scenario that shows object
interaction in a time-based sequence—what happens first, what happens next. They help define
operations of the classes.

Collaboration Diagram: A collaboration diagram is an interaction diagram that shows the


order of messages that implement an operation or a transaction.

Sequence diagrams are closely related to collaboration diagrams and both are alternate
representations of an interaction.

Main difference between sequence and collaboration diagrams: sequence diagrams show time-
based object interaction while collaboration diagrams show how objects associate with each
other.

State Chart Diagram: State chart diagrams model the dynamic behavior of individual classes
or any other kind of object. They show the sequences of states that an object goes through, the
events that cause a transition from one state to another, and the actions that result from a state
change.

Activity Diagram: An activity diagram is basically a special case of a state machine in which
most of the states are activities and most of the transitions are implicitly triggered by
completion of the actions in the source activities.

26
Object Model Diagram: The object model is built and graphically represented in the Class
Diagram. You can use an object model for two purposes. First, you can use the object model
as an application object model. An application object model captures a conceptual view of the
application and can be assigned to a component language like Java, Visual Basic, or Analysis.

Second, you can use the object model as a logical data model. A logical data model captures a
conceptual view of a database. You can use the Analysis language as the component language
if you want to create a database-independent logical data model. However, to implement the
model you are required to transform it to a data model and assign it to a supported DBMS.

Regardless of its purpose, you design an object model by creating Logical View packages.
Each package must contain persistent classes with attributes assigned to the classes. The classes
relate to one another by associations or aggregations. You add roles and multiplicity to provide
additional context to your associations and model design. Object models use UML terminology
and notation to express a complete model. Elements in an object model map to elements in a
data model.
Data Model Diagram: Data Model Diagrams use the UML profile notation for representing
data model entities. When you have an existing data model, you can drag-and drop data model
elements from the browser to the Data Model Diagram or you can use the Add Tables sub-
menu on the Query menu to populate the diagram. When you are creating a new data model,
you can use the toolbox or the Create sub-menu on the Tools menu to create data model
elements in the Data Model Diagram.

Object Model Elements Data Model Elements


Class Table
Operation Constraint
Attribute Column
Package Schema
Component Database
Association or Aggregation Non-Identifying Relationship
Composite Aggregation Identifying Relationship
Role Role
Multiplicity Cardinality

27
Creating Use Cases
Creating Actors in Rational Rose

1. Right-click on the Use Case View package in the browser to make the shortcut menu
visible.
2. Select the New: Actor menu option. A new actor called New Class is placed in the browser.
3. With the actor called New Class selected, enter the desired name of the actor.

Documenting Actors in Rational Rose


1. If the documentation window is not visible, open the documentation window by selecting
the Documentation menu choice from the View menu.
2. Click to select the actor in the browser.
3. Position the cursor in the documentation window and enter the documentation.

Creating Use Cases in Rational Rose


1. Right-click on the Use Case View in the browser to make the shortcut menu visible.
2. Select the New: Use Case menu option. A new unnamed use case is placed in the browser.
3. With the use case selected, enter the desired name of the use case.

Creating a Use Case brief Description in Rational Rose


1. Click to select the use case in the browser.
2. Position the cursor in the documentation window and enter the brief description for the use
case. If the documentation window is not visible, select the View: Documentation menu
choice to make the window visible.

Linking Flow of Events Documents to use cases in Rational Rose


1. Right-click on the use case in the browser to make the shortcut menu visible.
2. Select the Open Specification menu option.
3. Select the Files tab.
4. Right-click to make the shortcut menu visible.
5. Select the Insert File menu option.
6. Browse to the appropriate directory and select the desired file.
7. Click the Open button
8. Click the OK button to close the specification

28
Creating the main use case Diagram in Rational Rose

1. Double-click on the Main diagram in the Use Case View in the browser to open the
diagram.
2. Click to select an actor in the browser and drag the actor onto the diagram.
3. Repeat step 2 for each additional actor needed in the diagram
4. Click to select a use case in the browser and drag the use case onto the diagram.
5. Repeat step 4 for each additional use case needed in the diagram.
Note: Actors and use cases may also be created directly on a use case diagram by using the toolbar.

Creating Communicate Associations in Rational Rose


1. Click to select the Association icon or the Unidirectional Association icon from the diagram
toolbar. Note: If the Association icon is not present on the toolbar, it may be added by right-
clicking on the toolbar, selecting the Customize menu choice from the shortcut menu, and
adding the icon to the toolbar.
2. Click on an actor initiating a communication and drag the association line to the desired
use case.

To add the communicate stereotype (optional):


1. Double-click on the association line to make the Specification visible.
2. Click the arrow in the Stereotype field to make the drop-down menu visible, and select
communicate.
3. Click the OK button to close the Specification.
4. Repeat the preceding steps for each additional communicate relationship.

Creating Include Relationships in Rational Rose


1. Click to select the Dependency icon from the toolbar.
2. Click on the base use case and drag the Dependency icon to the used use case.
3. Double-click on the dependency arrow to make the Specification visible.
4. Click the arrow in the Stereotype filed to make the drop-down menu visible, and select
include.
5. Click the OK button to close the Specification.

Creating Extend Relationships in Rational Rose


1. Click to select the Dependency icon from the toolbar.
2. Click on the use case containing the extended functionality and drag the Dependency icon
to the base use case.
3. Double-click on the dependency arrow to make the Specification visible.
4. Click the arrow in the Stereotype field to make the drop-down menu visible and select
extend.
5. Click the OK button to close the Specification.

29
Creating Additional Use Case Diagrams in Rational Rose
1. Right-click on the Use Case View in the browser to make the shortcut menu visible.
2. Select the New: Use Case Diagram menu option.
3. While the use case diagram is selected, enter the name of the actor.
4. Open the diagram and add actors, use cases, and interactions to the diagram as needed.

Creating Activity Diagrams in Rational Rose


1. Right-click on the Use Case View in the browser to make the shortcut menu visible.
2. Select the New: Activity Diagram menu choice. This will add an activity diagram called
New Diagram to the browser.
3. While the new diagram is still selected, enter the name of the diagram.
4. Double-click on the activity diagram in the browser to open the diagram.

Creating Activities in Rational Rose


1. Click to select the Activity icon from the toolbar.
2. Click on the activity diagram window to place the activity.
3. While the activity is still selected, enter the name of the activity.

Creating Transitions in Rational Rose


1. Click to select the state transition icon from the toolbar.
2. Click on the originating activity and drag the transition arrow to the successor activity.

Creating Decision Points in Rational Rose


1. Click to select the Decision icon from the toolbar.
2. Click on the activity diagram window to place the decision.
3. While the decision is still selected, enter the name of the decision.
4. Click to select the Transition icon the toolbar.
5. Click on the originating activity and drag the transition to the decision icon.

Creating Guarded Transitions in Rational Rose


1. Click to select the State Transition icon from the toolbar.
2. Click on the decision and drag the transition to the successor activity.
(Note: Rational Rose may place the transition on top of an existing transition. To separate the transition,
select the transition and drag it onto the activity diagram window.)
3. Double-click on the transition arrow to make the Specification visible.
4. Select the Detail tab.
5. Enter the guard condition in the Guard Condition field.
6. Click the OK button to close the Specification.

30
Creating Rectilinear Lines in Rational Rose
1. Click to select the line that should be rectilinear (multi-select may be accomplished by
first selecting the Shift button).
2. Select the Format: Line Style: Rectilinear menu choice.
3. Relocate the lines as needed by selecting the line and dragging it to the desired location
on the activity diagram window.

Creating Synchronization Bars in Rational Rose


1. Click to select the Horizontal Synchronization or the Vertical Synchronization icon
from the toolbar.
2. Click on the activity diagram window to place the synchronization bar.
3. Click to select the State Transition icon on the toolbar and add any needed incoming
the outgoing transitions to the synchronization bar.

Creating Swimlanes in Rational Rose


1. Click to select the Swimlane icon from the toolbar.
2. Click on the activity diagram window to place the swimlane. This will add a swimlane
called NewSwimlane to the diagram.
3. Double-click on the NewSwimlane (the words) to open the Specification.
4. Enter the name of the swimlane in the Name filed.
5. Click the OK button to close the Specification.
6. To resize the swimlane, click on the swimlane border and drag the swimlane to the
desired location.
7. Drag all needed activities and transitions into the swimlane, (Note: You may also create
new activities and transitions in the swimlane.)

Creating Starting and Ending Activities in Rational Rose


1. Click to select the StartState or the EndState icon from the toolbar.
2. Click on the activity diagram window to place the start or end state.
3. If you added a start state, click on the state Transition icon, click on the start state, and
drag the transitions to the first activity in the workflow.
4. If you added an end state, click on the State Transition icon, click on the successor
activity, and drag the transition to the end state.

31
Finding Classes

Creating Classes in the Rose Browser


1. Right-click to select the Logical View in the browser.
2. Select the New: Class menu choice. A class called New Class is placed in the browser.
3. While the new class is still selected, enter the name of the class.

Creating Stereotypes for Classes in Rational Rose


1. Right-click to select the class in the browser and make the shortcut menu visible.
2. Select the Open Specification menu choice.
3. Select the General tab.
4. Click the arrow in the Stereotype field to make the drop-down menu visible and select
the desired stereotype or, to create a new stereotype, enter the name of the stereotype
in the Stereotype field.
5. Click the OK button to close the Specification.

Creating Packages in the Rose Browser


1. Right-click to select the Logical View in the browser.
2. Select the New: Package menu choice.
3. While the package is still selected, enter the name of the package.

Relocating Classes in the Rose Browser


1. Click to select the class in the browser.
2. Drag the class to the desired package.
3. Repeat the steps for each class that is to be relocated.

The Main Class Diagram in Rational Rose


Rose automatically creates the Main class diagram in the Logical View of the model.
1. To add packages to the Main class diagram:
2. Double-click on the Main diagram in the browser to open the diagram.
3. Click to select the package in the browser.
4. Drag the package onto the diagram.
5. Repeat the preceding steps for each package that is to be added to the diagram.

Creating a Package Main Class Diagram in Rational Rose


1. Double-click on the package on a class diagram.
2. Rose will “open” the package and create (or display) the main class diagram for the
package.
3. Click to select a class in the browser and drag the class onto the diagram
4. Repeat step 3 for each additional class that is to be placed on the diagram.

32
To Set Visibility Display in Rational Rose
To set the default visibility display:
1. Select the Tools: Options menu choice.
2. Select the Diagram tab.
3. Select the Show Visibility checkbox to set the default to show the visibility of all classes.

To set the visibility for a selected class:


1. Right-click to select the class on a diagram and make the shortcut menu visible.
2. Click to select or deselect the Options: Show Visibility menu choice.

Creating Package Relationships in Rational Rose


1. Select the dependency relationship icon from the toolbar.
2. Click on the client package and drag the arrow to the supplier package.

33
Discovering Object Interaction

Creating A Logical View Use Case Diagram in Rational Rose


1. Right-click to select the Logical View package in the browser and make the shortcut
menu visible.
2. Select the New: Use Case Diagram menu choice. This will add a new use case diagram
called NewDiagram to the browser.
3. While the NewDiagram is still selected, enter the name Realizations:

Creating Use Case Realizations in Rational Rose


1. Double-click on the Realizations use case diagram in the browser to open the diagram.
2. Click to select the Use Case icon from the toolbar.
3. Click on the use case diagram window to place the use case. This will place the new use
case on the diagram and also add it to the browser.
4. Double-click on the use case to open the Use Case Specification.
5. Enter the name of the use case (same name as the use case in the Use Case View) in the
Name field. (Note: You must enter the name in the Specification or in the Browser to invoke
Rational Rose’s namespace support. If you enter the name on the use case diagram,
Rational Rose will assume that the use case is the same use case that is in the Use Case
View.)
6. Click the arrow in the Stereotype field to make the drop-down menu visible.
7. Select use-case realization.
8. Click the OK button to close the Use Case Specification.

Creating A Sequence Diagram in Rational Rose


1. Right-click to select the use case realization in the Logical View of the browser and make
the shortcut menu visible.
2. Select the New: Sequence Diagram menu choice. An unnamed sequence diagram is added
to the browser.
3. With the new sequence diagram selected, enter the name of the sequence diagram.

Creating Objects and Messages in Sequence Diagrams in Rational Rose


1. Double-click on the sequence diagram in the browser to open the diagram.
2. Click to select the actor in the browser.
3. Drag the actor onto the sequence diagram.
4. Click to select the Object icon from the toolbar.
5. Click on the sequence diagram window to place the object.
6. While the object is still selected, enter the name of the object.
7. Repeat the preceding steps for each object and actor in the scenario.
8. Click on the actor or Object Message icon from the toolbar.

34
9. Click on the actor or object sending the message and drag the message line to the actor or
object receiving the message.
10. While the message line is still selected, enter the name of the message.
11. Repeat steps 7 through 9 for each message in the scenario.

Assigning Objects in a Sequence Diagram to Classes in Rational Rose


1. Click to select the class in the browser.
2. Drag the class onto the object in the sequence diagram. Rose will add the class name
preceded by a colon (:) to the object name. If the object is unnamed, the name is set to
:ClassName. If the stereotype display for a class is set to icon, and if an icon exists, then
the icon will be used in the sequence diagram.

Linking Diagrams in Rational Rose


1. Select the Note icon from the toolbar.
2. Click on the diagram to place the note.
3. Select the diagram tat you wish to link in the browser and drag the diagram onto the note.
4. To navigate to the linked diagram, double-click on the note.

Creating Collaboration Diagrams from Sequence Diagrams in Rational Rose


1. Double-click on the sequence diagram in the browser to open the diagram.
2. Choose the Browse: Create Collaboration Diagram menu choice or press the F5 key.
3. Rearranging the objects and messages on the diagram as needed.

Creating a View of Participating Classes in Rational Rose


1. Right-click on the use case realization in the browser to make the shortcut menu visible.
2. Select the New: Class Diagram menu choice.
3. While the diagram is still selected, enter the name of the class diagram.
4. Double-click on the diagram in the browser to open the diagram.
5. Click to select a class in the logical view of the browser and drag the class onto the
diagram.
6. Repeat step 5 for each additional class that is to be placed onto the diagram.

35
Specifying Relationships

Creating an Association Relationship in Rational Rose


1. Click to select the Association icon from the toolbar. The association icon may be added
to the toolbar by right-clicking on the toolbar and selecting the Customize menu
command.
2. Click on one of the associated classes in a class diagram
3. Drag the association line to the other associated class

Creating an Aggregation Relationship in Rational Rose


1. Select the Aggregation icon from the toolbar. The Aggregation icon may be added to the
toolbar by right-clicking on the toolbar and selecting the Customize menu command.
2. Click on the class playing the role of the “whole” in a class diagram and drag the
aggregation line to the class playing the role of the “part”.

Naming Relationships in Rational Rose


1. Click to select the relationship line on a class diagram.
2. Enter the name of the relationship.

Creating Role Names in Rational Rose


1. Right-click on the relationship line near the class tat is modifies to make the shortcut
menu visible.
2. Select the Role Name menu choice.
3. Enter the name of the role.

Creating Multiplicity in Rational Rose


1. Double-click on the relationship line to make the Specification visible.
2. Select the Detail tab for the role being modified (Role A Detail or Role B Detail).
3. Enter the desired multiplicity in the Cardinality field.
4. Click the OK button to close the Specification.

Creating a Reflexive Relationship in Rational Rose


1. Select the Association (or Aggregation) icon from the toolbar.
2. Click on the class and drag the association (or aggregation) line outside the class.
3. Release the mouse button.
4. Click and drag the association (or aggregation) line back to the class
5. Enter the role names and multiplicity for each end of the reflexive association (or
aggregation).

36

You might also like