SE Lab Manual 2024
SE Lab Manual 2024
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)
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.
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
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
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.
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
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.
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
(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
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.
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
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.
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.
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.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.
16
Schedule for Submission of Lab Assignments
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
[ 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
[ 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.
20
ends, the events of the main flow of events are resumed unless otherwise
stated.]
[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
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.]
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.]
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
23
Tutorial on Rational Rose
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.
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.
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.
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.
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.
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.
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.
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.
31
Finding Classes
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.
33
Discovering Object Interaction
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.
35
Specifying Relationships
36