software-engineering-lab-manual-4th-sem
software-engineering-lab-manual-4th-sem
LAB MANUAL
IS-503(B)
Software Engineering
NAME:
ENROLMENT NUMBER:
SESSION: 2021-22
List of Experiments:
Date of
Signatur
S. No. Topics/Sub-Topics experimen Remarks
e
t
Objective:
To find the requirement specification (both functional and
nonfunctional) of a given Problem.
Procedure:
Step 1:
Introduction:
Purpose
Project Scope
Overall Description
Product Perspective
Describe the context and origin of the product being specified in this
SRS. For example, state whether this product is a follow-on member of a
product family, a replacement for certain existing systems, or a new, self-
contained product. If the SRS defines a component of a larger system, relate
the requirements of the larger system to the functionality of this software and
identify interfaces between the two. A simple diagram that shows the major
components of the overall system, subsystem interconnections, and external
interfaces can be helpful.
Product Features
Identify the various user classes that you anticipate will use this
product. User classes may be differentiated based on frequency of use, subset
of product functions used, technical expertise, security or privilege levels,
educational level, or experience. Describe the pertinent characteristics of each
user class. Certain requirements may pertain only to certain user classes.
Distinguish the favored user classes from those who are less important to
satisfy.
Operating Environment
Describe any items or issues that will limit the options available to the
developers. These might include: corporate or regulatory policies; hardware
limitations (timing requirements, memory requirements); interfaces to other
applications; specific technologies, tools, and databases to be used; parallel
operations; language requirements; communications protocols; security
considerations; design conventions or programming standards (for example, if
the customer’s organization will be responsible for maintaining the delivered
software).
Step 3:
System Features
This template illustrates organizing the functional requirements for
the product by system features, the major services provided by the product.
You may prefer to organize this section by use case, mode of operation, user
class, object class, functional hierarchy, or combinations of these, whatever
makes the most logical sense for your product.
System Feature 1
Don’t really say “System Feature 1.” State the feature name in just a few words.
2 Stimulus/Response Sequences
List the sequences of user actions and system responses that
stimulate the behavior defined for this feature. These will correspond to
the dialog elements associated with use cases.
3 Functional Requirements
Itemize the detailed functional requirements associated with
this feature. These are the software capabilities that must be present in
order for the user to carry out the services provided by the feature, or to
execute the use case. Include how the product should respond to
anticipated error conditions or invalid inputs. Requirements should be
concise, complete, unambiguous, verifiable, and necessary.
REQ-1:
REQ-2:
Step 4:
User Interfaces
Hardware Interfaces
This may include the supported device types, the nature of the data and
control interactions between the software and the hardware, and
communication protocols to be used.
Software Interfaces
Communications Interfaces
Nonfunctional Requirements
Performance Requirements
Safety Requirements
Security Requirements
Specify any additional quality characteristics for the product that will
be important to either the customers or the developers. Some to consider are:
adaptability, availability, correctness, flexibility, interoperability,
maintainability, portability, reliability, reusability, robustness, testability, and
usability. Write these to be specific, quantitative, and verifiable when possible.
At the least, clarify the relative preferences for various attributes, such as ease
of use over ease of learning.
Other Requirements
Define any other requirements not covered elsewhere in the SRS. This
might include database requirements, internationalization requirements,
legal requirements, reuse objectives for the project, and so on. Add any new
sections that are pertinent to the project.
Experiment No. 2
OVERALL DESCRIPTION:
Data drive business activities and can trigger events (e.g. new sales order
data) or be processed to provide information about the activity. Data flow
analysis, as the name suggests, follows the flow of data through business
processes and determines how organisation objectives are accomplished. In
the course of handling transactions and completing tasks, data are input,
processed, stored, retrieved, used, changed and output. Data flow analysis
studies the use of data in each activity and documents the findings in data flow
diagrams, graphically showing the relation between processes and data.
Names of people
ORDERS
CUSTOMERS
INVOICES
Here, two examples of data flow that describe input and validation of
data are considered. In Fig. 5.1(b), the two processes are directly
connected by a data flow. This means that the ‘validate-number’ process
can start only after the ‘read-number’ process had supplied data to it.
However in Fig 5.1(c), the two processes are connected through a data
store. Hence, the operations of the two bubbles are independent. The
first one is termed ‘synchronous’ and the second one ‘asynchronous’.
Data dictionary
A data dictionary lists all data items appearing in the DFD model of a
system. The data items listed include all data flows and the contents of
all data stores appearing on the DFDs in the DFD model of a system. A
data dictionary lists the purpose of all data items and the definition of
all composite data items in terms of their component data items. For
example, a data dictionary entry may represent that the data grossPay
consists of the components regularPay and overtimePay.
Balancing a DFD
The data that flow into or out of a bubble must match the data flow at
the next level of DFD. This is known as balancing a DFD. The concept of
balancing a DFD has been illustrated in fig. 5.3. In the level 1 of the DFD,
data items d1 and d3 flow out of the bubble 0.1 and the data item d2
flows into the bubble 0.1. In the next level, bubble 0.1 is decomposed.
The decomposition is balanced, as d1 and d3 flow out of the level 2
diagram and d2 flows in.
Decomposition:-
Each bubble in the DFD represents a function performed by the system.
The bubbles are decomposed into sub-functions at the successive levels
of the DFD.
Decomposition of a bubble is also known as factoring or exploding a
bubble. Each bubble at any level of DFD is usually decomposed to
anything between 3 to 7 bubbles. Too few bubbles at any level make that
level superfluous. For example, if a bubble is decomposed to just one
bubble or two bubbles, then this decomposition becomes redundant.
Also, too many bubbles, i.e. more than 7 bubbles at any level of a DFD
makes the DFD model hard to understand. Decomposition of a bubble
should be carried on until a level is reached at which the function of the
bubble can be described using a simple algorithm.
Numbering of Bubbles:-
It is necessary to number the different bubbles occurring in the DFD.
These numbers help in uniquely identifying any bubble in the DFD by its
bubble number. The bubble at the context level is usually assigned the
Example:-
A supermarket needs to develop the following software to encourage
regular customers. For this, the customer needs to supply his/her
residence address, telephone number, and the driving license number.
Each customer who registers for this scheme is assigned a unique
customer number (CN) by the computer. A customer can present his CN
to the check out staff when he makes any purchase. In this case, the
value of his purchase is credited against his CN. At the end of each year,
the supermarket intends to award surprise gifts to 10 customers who
make the highest total purchase over the year. Also, it intends to award
a 22 caret gold coin to every customer whose purchase exceeded
Rs.10,000. The entries against the CN are the reset on the day of every
year after the prize winners’ lists are generated.
Page 14 of 59
Experiment No.4
Page 15 of 59
Experiment No.5
Objective :
To understand the users view of a project using Use case Diagram
Software Required :-
Procedure :-
You can draw use case diagrams in VP-UML as well as to document the event flows of
use cases using the flow-of-events editor of UML 8.2 .The steps are as follows.
Step 1:
Right click Use Case Diagram on Diagram Navigator and select New Use Case
Diagram from the pop-up menu.
Page 16 of 59
Step 2:-
Enter name for the newly created use case diagram in the text field of pop-up box on
the top left corner.
Step 3:
Drawing a system
To create a system, select System on the diagram toolbar and then click it on the
diagram pane. Finally, name the newly created system when it is created .
Page 17 of 59
Step 4:
Drawing an actor
To draw an actor, select Actor on the diagram toolbar and then click it on the
diagram pane. Finally, name the newly created actor when it is created.
Step
5 :-
Page 18 of 59
Besides creating a use case through diagram toolbar, you can also create it through
resource icon.
Move the mouse over a shape and press a resource icon that can create use case. Drag
it and then release the mouse button until it reaches to your preferred place. The
source shape and the newly created use case are connected. Finally, name the newly
created use case.
Step 6:-
Step 7:
Resize a use
case
To create an extend relationship, move the mouse over a use case and press its
resource iconExtend -> Use Case. Drag it to your preferred place and then release the
mouse button. The use case with extension points and a newly created use case are
connected. After you name the newly created use case, a pop-up dialog box will ask
whether you want the extension point to follow the name of use case. Click Yes if you
want it to do so; click NO if you want to enter another name for extension point.
Page 19 of 59
Step 8:
Create an extend
relationship
Drawing <<Include>> relationship
To create an include relationship, mouse over a use case and press its resource
icon Include -> Use Case. Drag it to your preferred place and then release the mouse
button. A new use case together with an include relationship is created. Finally, name
the newly created use case.
Step 9:
Include relationship is
created
Structuring use cases with package
You can organize use cases with package when there are many of them on the
diagram.
Select Package on the diagram toolbar (under Common category).
Step 10:
Create a
Page 20 of 59
package
Drag the mouse to create a package surrounding those use cases .
Step 11:
Surround use cases with
package
Finally, name the package.
Page 21 of 59
Step 12
Name the
package
Assigning IDs to actors/Use cases
You may assign IDs to actors and use cases. By default, IDs are assigned with the order
of object creation, starting from one onwards. However, you can define the format or
even enter an ID manually.
Step 13:
Page 22 of 59
Description
Prefix The prefix you enter in Prefix text field will be inserted before the number.
Num of digits The number of digits for the number. For example, when digit is 3, ID "1" will
become "001".
Suffix The suffix you enter in Suffix text field will be inserted behind the number.
Showing ID on diagram
By default, ID is just a text property. It usually doesn't appear on diagram. However,
you can make it shown within a use case.
Right click on the diagram background, select Presentation Options and the specific
model element display option from the pop-up menu .
Step 14 :
Show ID on
diagram
Page 23 of 59
ID assignment
There are several ways that you can assign an ID to a model element, including:
Through the specification dialog box (Right click on the selected model
element and select Open Specification... from the pop-up menu)
Through the Property Pane
Drawing business use case
1. Right click on a use case and select Model Element Properties > Business
Model from the pop-up menu.
Step 15:
1.
Click Business
Model
2. After selected, an extra slash will be shown on the left edge of
the use case.
Business model
Page 24 of 59
Objective :
To understand the interactions between objects that are represented as
lifelines in a sequential order of a project using Sequence Diagram.
Software Required :-
Procedure :-
A sequence diagram is used primarily to show the interactions between objects
that are represented as lifelines in a sequential order.
Step 1:-
Right click Sequence diagram on Diagram Navigator and select New Sequence
Diagram from the pop-up menu to create a sequence diagram.
Page 25 of 59
Step 2:-
Enter name for the newly created sequence diagram in the text field of pop-up box on
the top left corner.
Creating actor
To create actor, click Actor on the diagram toolbar and then click on the diagram .
Creating lifeline
To create lifeline, you can click LifeLine on the diagram toolbar and then click on the
diagram.
Alternatively, a much quicker and more efficient way is to use the resource-centric
interface. Click on the Message -> LifeLine resource beside an actor/lifeline and drag.
Step 3:-
Page 26 of 59
Move the mouse to empty space of the diagram and then release the mouse button. A
new lifeline will be created and connected to the actor/lifeline with a message.
Step 4:-
Using sweeper and magnet to manage sequence diagram
Sweeper helps you to move shapes aside to make room for new shapes or connectors.
To use sweeper, click Sweeper on the diagram toolbar (under the Tools category).
Page 27 of 59
The picture below shows the message specify visit time is being swept downwards,
thus new room is made for new messages.
Page 28 of 59
Step 5:-
You can also use magnet to pull shapes together. To use magnet,
click Magnet on the diagram toolbar (under the Tools category).
Page 29 of 59
Magnet
Click on empty space of the diagram and drag towards top, right, bottom or left.
Shapes affected will be pulled to the direction you dragged.
The picture below shows when drag the magnet upwards, shapes below dragged
position are pulled upwards.
Step 6:-
Page 30 of 59
Step 7:-
Page 31 of 59
Step 8:-
2. In the Add/Remove Covered Lifelines dialog box, check the lifeline(s) you
want to cover or uncheck the lifeline(s) you don't want to cover. Click OK button.
Page 32 of 59
Managing Operands
After you've created a combined fragment on the messages, you can also add or
remove operand(s).
1. Move the mouse over the combined fragment and select Operand > Manage
Operands... from the pop-up menu.
Step 9:-
1. To remove an operand, select the target operand from Operands and
click Remove button. ClickOK button.
Page 33 of 59
2. Otherwise, click Add button to add a new operand and then name it.
Click OK button.
Page 34 of 59
There are two panes, Lifelines and Messages. The Lifelines pane enables you to
create different kinds of actors and lifelines.
Butto
Shortcut Description
n
Alt-Shift-ATo create an actor
Page 35 of 59
Butto
Shortcut Description
n
Alt-Shift-L To create a general lifeline
Alt-Shift-ETo create an <<entity>> lifeline
Alt-Shift-C To create a <<control>> lifeline
Alt-Shift-BTo create a <<boundary>> lifeline
Alt-Shift-OTo open the specification of the element chosen in quick editor
Ctrl-Del To delete the element chosen in quick editor
To link with the diagram, which cause the diagram element to be selected when selecting an
Ctrl-L
element in editor, and vice versa
Step 10:-
Buttons in Lifelines
pane
Editing messages
The Messages pane enables you to connect lifelines with various
kinds of messages.
Page 36 of 59
Button
Shortc
Description
ut
To link with the diagram, which cause the message to be selected when selecting a message in editor, and vice
Ctrl-L
versa
Page 37 of 59
Step 11:-
If you choose Single Level, all sequence messages will be ordered with integers on
diagram base. On the other hand, if you choose Nested Level, all sequence messages
will be ordered with decimal place on diagram base.
Page 38 of 59
Right click on the diagram's background, select Sequence Number and then
either Frame-based Single Level or Frame-based Nested Level from the pop-up
menu.
When you set the way of numbering sequence messages on frame base, the sequence
messages in frame will restart numbering sequence message since they are
independent and ignore the way of numbering sequence message outside the frame.
Page 39 of 59
Experiment No. 7:
Objective:-
To show diagrammatically the objects required and the relationships between
them while developing a software product.
Software Required :-
Procedure :-
Step 1:-
Page 40 of 59
Right click Class Diagram on Diagram Navigator and select New Class
Diagram from the pop-up menu to create a class diagram.
Step 2:-
Creating class
To create class, click Class on the diagram toolbar and then click on the diagram.
Creating association
To create association from class, click the Association -> Class resource beside it and
drag.
Page 41 of 59
Drag to empty space of the diagram to create a new class, or drag to an existing class
to connect to it. Release the mouse button to create the association.
Step 3:-
To edit multiplicity of an association end, right-click near the association end, select Multiplicityfrom
the popup menu and then select a multiplicity.
To show the direction of an association, right click on it and select Presentation Options > Show
Direction from the pop-up menu.
Page 42 of 59
Step 4:-
Creating generalization
To create generalization from class, click the Generalization -> Class resource beside
it and drag.
Page 43 of 59
Drag to empty space of the diagram to create a new class, or drag to an existing class
to connect to it. Release the mouse button to create the generalization.
Creating attribute
To create attribute, right click the class and select Add > Attribute from the pop-up
menu.
An attribute is created.
Page 44 of 59
Creating operation
To create operation, right click the class and select Add > Operation from the pop-up
menu.
An operation is created.
Similar to creating attribute, you can press the Enter key to create multiple operations
continuously.
Drag-and-Drop reordering, copying and moving of class members
To reorder a class member, select it and drag within the compartment, you will see a
thick black line appears indicating where the class member will be placed.
Page 45 of 59
To copy a class member, select it and drag to the target class while keep pressing the
Ctrl key, you will see a thick black line appears indicating where the class member will
be placed. A plus sign is shown beside the mouse cursor indicating this is a copy action.
To move a class member, select it and drag to the target class, you will see a thick
black line appears indicating where the class member will be placed. Unlike copy, do
not press the Ctrl key when drag, the mouse cursor without the plus sign indicates this
is a move action.
Page 46 of 59
Press up or down key to select class in the list, press Enter to confirm. Upon selecting
an existing class, all class members and relationships are shown immediately.
Page 47 of 59
Step 5:-
Generalization set
A generalization set defines a particular set of generalization relationships that
describe the way
Page 48 of 59
in which a general classifier (or superclass) may be divided using specific subtypes. To
define a generalization set, select the generalizations to include, right click and select
Generalization set > Create Generalization Set... from the popup menu.
Step 6:-
Name the set in the Manage Generalization Sets dialog box, and confirm by pressing
OK.
Page 49 of 59
The selected generalizations are grouped. Adjust the connector to make the diagram
tidy.
Page 50 of 59
Page 51 of 59
Time consuming and tedious: Since test Fast Automation runs test cases
cases are executed by human resources so it significantly faster than human
is very slow and tedious. resources.
Page 52 of 59
What is JUnit ?
Features
JUnit is an open source framework which is used for writing & running
tests.
Provides Annotation to identify the test methods.
Provides Assertions for testing expected results.
Provides Test runners for running tests.
JUnit tests allow you to write code faster which increasing quality
JUnit is elegantly simple. It is less complex & takes less time.
JUnit tests can be run automatically and they check their own results
and provide immediate feedback. There's no need to manually comb
through a report of test results.
JUnit tests can be organized into test suites containing test cases and
even other test suites.
Junit shows test progress in a bar that is green if test is going fine and it
turns red when a test fails
A Unit Test Case is a part of code which ensures that the another part of code
(method) works as expected. To achieve those desired results quickly, test
framework is required .JUnit is perfect unit test framework for java
Page 53 of 59
programming language.
A formal written unit test case is characterized by a known input and by an
expected output, which is worked out before the test is executed. The known
input should test a precondition and the expected output should test a
postcondition.
There must be at least two unit test cases for each requirement: one positive
test and one negative test. If a requirement has sub-requirements, each sub-
requirement must have at least two test cases as positive and negative.
Online
You really do not need to set up your own environment to start learning
Java &JUnit programming language. Reason is very simple, we already
have setup Java Programming environment online, so that you can
compile and execute all the available examples online at the same time
when you are doing your theory work. This gives you confidence in what
you are reading and to check the result with different options. Feel free to
modify any example and execute it online.
Try following example using Try it option available at the top right
corner of the below sample code box:
For most of the examples given in this tutorial, you will find Try it option,
so just make use of it and enjoy your learning.
JUnit is a framework for Java, so the very first requirement is to have JDK
installed in your machine.
System Requirement
Page 54 of 59
OS Task Command
OS Output
Page 55 of 59
OS Output
Download latest version of JUnit jar file from http://www.junit.org. At the time
of writing this tutorial, I downloaded Junit-4.10.jar and copied it into C:\>JUnit
folder.
OS Archive name
Windows junit4.10.jar
Linux junit4.10.jar
Mac junit4.10.jar
OS Output
Page 56 of 59
Set the CLASSPATH environment variable to point to the JUNIT jar location.
Assuming, we've stored junit4.10.jar in JUNIT folder on various Operating
Systems as follows.
OS Output
Create a java class file name Test unit in C:\ > JUNIT_WORKSPACE
importorg.junit.Test;
import static org.junit.Assert.assertEquals;
public class TestJunit {
@Test
public void testAdd() {
String str= "Junit is working fine";
assertEquals("Junit is working fine",str);
}
}
Page 57 of 59
}
System.out.println(result.wasSuccessful());
}
}
Page 58 of 59
Page 59 of 59