Experiments
Experiments
Experiment no.2
Title Make a Use case diagram for railway reservation system/ ATM
Objective It will provide students graphical overview of the functionality provided by the system.
Theory Use case diagram is a platform that can provide a common understanding for the end-users,
developers and the domain experts. It is used to capture the basic functionality i.e. use cases, and the
users of those available functionality, i.e. actors, from a given problem statement.
In this experiment, we will learn how use cases and actors can be captured and how different use
cases are related in a system.
Graphical Representation
An actor is represented by a stick figure and name of the actor is written below it. A use case is
depicted by an ellipse and name of the use case is written inside it. The subject is shown by drawing a
rectangle. Label for the system could be put inside it. Use cases are drawn inside the rectangle, and
actors are drawn outside the rectangle, as below:
Association between Actors and Use Cases
A use case is triggered by an actor. Actors and use cases are connected through binary associations
indicating that the two communicates through message passing.
An actor must be associated with at least one use case. Similarly, a given use case must be associated
with at least one actor. Associations among the actors are usually not shown. However, one can depict
the class hierarchy among actors.
Generalization relationship is depicted by a solid arrow from the specialized (derived) use case to the
more generalized (base) use case.
Identifying Actors
Given a problem statement, the actors could be identified by asking the following questions :
Who gets most of the benefits from the system? (The answer would lead to the identification
of the primary actor)
Who keeps the system working? (This will help to identify a list of potential users)
What other software / hardware does the system interact with?
Any interface (interaction) between the concerned system and any other system?
Sample Use case diagrams for the chosen project is captured using above mentioned basics
Output
Experiment No:3
Theory
Introduction
Developing databases is a very important task to develop a system. Before going to form exact
database tables and establishing relationships between them, we conceptually or logically can model
our database using ER diagrams.
In this experiment we will learn how to find the entities, its attributes and how the relationships
between the entities can be established for a system.
Attributes of Entity
Attributes are the characteristics describing any entity belonging to an entity set. Any entity in a set
can be described by zero or more attributes.
For example, any student has got a name, age, an address. At any given time a student can study only
at one school. In the school he would have a roll number, and of course a grade in which he studies.
These data are the attributes of the entity set Student.
Keys
One or more attribute(s) of an entity set can be used to define the following keys:
Super key: One or more attributes, which when taken together, helps to uniquely identify an
entity in an entity set. For example, a school can have any number of students. However, if we
know grade and roll number, then we can uniquely identify a student in that school.
Candidate key: It is a minimal subset of a super key. In other words, a super key might
contain extraneous attributes, which do not help in identifying an object uniquely. When such
attributes are removed, the key formed so is called a candidate key.
Primary key: A database might have more than one candidate key. Any candidate key chosen
for a particular implementation of the database is called a primary key.
Prime attribute: Any attribute taking part in a super key
Weak Entity
An entity set is said to be weak if it is dependent upon another entity set. A weak entity can't be
uniquely identified only by it's attributes. In other words, it doesn't have a super key.
For example, consider a company that allows employees to have travel allowance for their immediate
family. So, here we have two entity sets: employee and family, related by "Can claim for". However,
family doesn't have a super key. Existence of a family is entirely dependent on the concerned
employee. So, it is meaningful only with reference to employee.
Mapping Cardinalities
One of the main tasks of ER modeling is to associate different entity sets. Let's consider two entity
sets E1 and E2 associated by a relationship set R. Based on the number of entities in E1 and E2 are
associated with, we can have the following four type of mappings:
One to one: An entity in E1 is related to at most a single entity in E2, and vice versa
One to many: An entity in E1 could be related to zero or more entities in E2. Any entity in
E2 could be related to at most a single entity in E1.
Many to one: Zero or more number of entities in E1 could be associated to a single entity in
E2. However, an entity in E2 could be related to at most one entity in E1.
Many to many: Any number of entities could be related to any number of entities in E2,
including zero, and vice versa.
ER Diagram
From a given problem statement we identify the possible entity sets, their attributes, and relationships
among different entity sets. Once we have these information, we represent them pictorially, called an
entity-relationship (ER) diagram.
Relationship with
weak entity set
Importance of ER modeling
Figure - 01 shows the different steps involved in implementation of a (relational) database.
Given a problem statement, the first step is to identify the entities, attributes and relationships. We
represent them using an ER diagram. Using this ER diagram, table structures are created, along with
required constraints. Finally, these tables are normalized in order to remove redundancy and maintain
data integrity. Thus, to have data stored efficiently, the ER diagram is to be drawn as much detailed
and accurate as possible.
Sample
Output
REQUIREMENTS:
Hardware Interfaces
Pentium(R) 4 CPU 2.26 GHz, 128 MB RAM
Screen resolution of at least 800 x 600 required for proper and complete viewing of screens. Higher
resolution would not be a problem.
CD ROM Driver
Software Interfaces
Any window-based operating system (Windows 95/98/2000/XP/NT)
WordPad or Microsoft Word
THEORY
Data flow diagrams illustrate how data is processed by a system in terms of inputs and outputs.
Datastore Notations
Dataflow
Dataflows are pipelines through which packets of information flow. Label the arrows with the name of the data
that moves through it.
External Entity
External entities are objects outside the system, with which the system communicates. External entities are
sources and destinations of the system's inputs and outputs.
DFD levels
The first level DFD shows the main processes within the system. Each of these processes can be broken into
further processes until you reach pseudocode.
An example first-level data flow diagram
Conclusion: The dataflow diagram was made successfully by following the steps described above.
Experiment 1
➔ Software
Software is a set of instructions and its documentation that tells a computer what
to do or how to perform a task. Software includes all different software programs
on a computer, such as applications and the operating system.
Examples : Adobe Photoshop, MacOS, Google Chrome, etc.
➔ Program
A computer program is a list of instructions that tell a computer what to do.
Everything a computer does is done by using a computer program. A computer
program is written in a programming language. Programs stored in the memory of
a computer enable the computer to perform tasks in sequence or even
intermittently.
Example:
import random
print(‘Random Dice
Roll: ’) N =
random.randint(1, 6)
print(N)
➔ Software Engineering
Software engineering is an engineering branch associated with the
development of software products using well-defined scientific principles,
methods and procedures Objectives of Software Engineering :
➢ Maintainability
➢ Correctness
➢ Reusability
➢ Testability
➢ Reliability
➢ Portability
➔ V-Model
The V-model is an SDLC model where execution of processes happens in a
sequential manner in a V-shape. It is also known as the Verification and
Validation model.
The V-Model is an extension of the waterfall model and is based on the
association of a testing phase for each corresponding development stage. This
means that for every single phase in the development cycle, there is a directly
associated testing phase. This
is a highly-disciplined model and the next phase starts only after completion of
the previous phase.
➔ Software Testing
Software testing is the process of verifying a system with the purpose of
identifying any errors, gaps or missing requirements versus the actual
requirement. Software testing is broadly categorised into two types - functional
testing and non-functional testing.
The process of software testing aims not only at finding faults in the existing
software but also finding measures to improve the software in terms of efficiency,
accuracy and usability.
➔ Quality Control
It is a Software Engineering process used to ensure quality in a product or a
service. It does not deal with the processes used to create a product; rather it
examines the quality of the "end products" and the final outcome. The main aim
of Quality control is to check whether the products meet the specifications and
requirements of the customer. If an issue or problem is identified, it needs to be
fixed before delivery to the customer. QC also evaluates people on their quality
level skill sets and imparts training and certifications.
➔ Why should we test?
The testing is important since it discovers defects/bugs before the delivery to the
client, which guarantees the quality of the software. It makes the software more
reliable and easy to use. Thoroughly tested software ensures reliable and high-
performance software operation. Without proper testing, we could potentially
release software which could malfunction and cause serious injuries.
If software testing is not done, it can lead to major software failures like Year
2000 problem, Patriot Missile Error, etc.
Black box testing is a type of testing in which the tester only focuses on the
inputs and the expected outputs, without knowing how the application works
internally and how
these inputs are processed. Tester treats the Application Under Test (AUT) as a
black box.
Techniques included in black-box testing :
➢ Regression Testing
➢ Functional Testing
➔ Limitations of testing
Limitations to software testing depend upon many factors:
➢ Money - Software testing requires a considerable amount of money in order
to upkeep a product.
➢ Time constraint - Testing is a huge part of the software development
process and requires a considerable amount of time to assure the quality of a
product.
➢ Number of Resources - This is related to time constraint. More testers
and human resources are needed to meet a deadline.
➢ Dedicated Staging Environment - It is a tough job to maintain a
stage environment or QA environment as close as possible to the
Production environment.
➢ How much to automate? - You cannot automate 100% business process. So
a thorough evaluation is needed on that part.
➢ False Positives and False Negatives - This is in respect to automation
testing. False positive is a case where in spite of a bug the automation script
yields a positive result. A false negative is vice-versa.
Aim:
A. To determine the nature of roots of a quadratic equation, its input is triple of +ve integers
(say x,y,z) and values may be from interval [1,100]. The program output may have one of
the following:-
a. Not a quadratic equation
b. Real roots
c. Imaginary roots
d. Equal roots
Design the boundary value test cases.
Algorithm:
1. Take 3 inputs corresponding to coefficients of the quadratic equation.
2. Check whether the inputs lie in a given domain.
3. If coefficients are not representative of a quadratic equation, STOP.
4. Else check the value of discriminant of given equation.
5. If the discriminant is greater than 0, roots are real and different.
6. Else if discriminant is equal to 0, roots are real and equal.
7. Else if discriminant is less than 0, roots are imaginary/complex.
8. Print total test cases = 4n+1, n: number of inputs.
Code:
#include <iostream>
#include <math.h>
using namespace
std;
c) { if (a==0) {
cout << "not a quadratic\
n"; return 0;
}
int d = b*b - 4*a*c;
double sqrt_val = sqrt(abs(d));
cout << a << "\t" << b << "\t" << c << "\
t"; if(d < 0) {
cout << "Imaginary Roots\t\t";
cout << -(double)b / (2*a) << "+i"<<sqrt_val << ",
"; cout << -(double)b/(2*a) << "-i"<<sqrt_val <<
endl;
} else if(d == 0) {
cout << "real and equal\t\t";
cout << - (double) b / (2*a) << endl;
} else
{ cout << "Real and Distinct\t";
cout << (double) (-b + sqrt_val)/(2*a);
cout << ", " << (double) (-b - sqrt_val)/(2*a) << endl;
}
return 0;
}
int main() {
int min, max;
for(int i=0;i<5;i++) {
if(values[i] !=
nominal)
bva(nominal, values[i], nominal);
}
for(int i=0;i<5;i++) {
if(values[i] !=
nominal)
bva(nominal, nominal, values[i]);
}
return 0;
}
Output
a 1 2 50 99 100
b 1 2 50 99 100
c 1 2 50 99 100
Test cases
3 50 50 50 Imaginary
4 99 50 50 Imaginary
5 100 50 50 Imaginary
6 50 1 50 Imaginary
7 50 2 50 Imaginary
8 50 50 50 Imaginary
9 50 99 50 Imaginary
13 50 50 50 Imaginary
14 50 50 99 Imaginary
15 50 50 100 Imaginary
Test cases 3, 8 and 13 are redundant. Hence, total number of test cases are 15 - 2 = 13 = 4*n + 1 [n=3].
Experiment 7
Aim:
To determine the type of triangle. Its input is triple of +ve integers (say x,y,z) and the
values may be from interval[1,100].The program output may be one of the following
[Scalene, Isosceles, Equilateral, Not a Triangle]. Perform BVA.
Algorithm:
1. Take 3 inputs corresponding to three sides of the triangle.
2. Check whether the inputs lie in a given domain.
3. If sides are not representative of a triangle, STOP.
4. Else check the relation between given sides.
5. If all sides are equal, the triangle is equilateral.
6. Else if 2 sides are equal the triangle is isosceles.
7. Else if no sides are equal, the triangle is scalene.
8. Print total test cases = 4n+1, n: number of inputs.
Code:
#include <iostream>
#include <math.h>
using namespace
std;
int main() {
int min, max;
for(int i=0;i<5;i++) {
if(values[i] != nominal)
bva(nominal, values[i], nominal);
}
for(int i=0;i<5;i++) {
if(values[i] != nominal)
bva(nominal, nominal, values[i]);
}
return 0;
}
Output
a 1 2 50 99 100
b 1 2 50 99 100
c 1 2 50 99 100
Test cases
1 1 50 50 Isosceles
2 2 50 50 Isosceles
3 50 50 50 Equilateral
4 99 50 50 Isosceles
5 100 50 50 Not a triangle
6 50 1 50 Isosceles
7 50 2 50 Isosceles
8 50 50 50 Equilateral
9 50 99 50 Isosceles
11 50 50 1 Isosceles
12 50 50 2 Isosceles
13 50 50 50 Equilateral
14 50 50 99 Isosceles
15 50 50 100 Isosceles
Test cases 3, 8 and 13 are redundant. Hence, total number of test cases are 15 - 2 = 13 = 4*n + 1 [n=3].
Experiment 8
Aim:
A. WAP in C/C++ to find the area of a circle, Triangle, Square and Rectangle and perform
equivalence class testing.
Algorithm:
1. Display Menu with choices for Circle, Triangle, Square, Rectangle
2. Take user input
3. If choice=1, take radius as input and calculate area of circle
4. Else if choice=2, take height and base of triangle as input and calculate area of triangle.
5. Else if choice=3, take side of square as input and calculate area of square.
6. Else if choice=4, take height and width of rectangle as input and calculate area of
rectangle.
7. Else if choice=5, STOP.
8. Else, display wrong choice
Code:
#include<iostream>
using namespace
std;
void menu()
{
cout << endl << "1. Area of circle" <<
endl; cout << "2. Area of triangle" <<
endl;
cout << "3. Area of square" << endl;
cout << "4. area of rectangle" <<
endl; cout << "5. Exit" << endl;
}
}
}
int main()
{
int choice;
do {
menu();
cin >> choice;
result(choice);
} while (choice != 5);
return 0;
}
Output
Equivalence Class Testing:
➔ Case 1: Circle
◆ Input Domain
I1 r: r<=0
I2 r: r>100
◆ Output Domain
O1 Circle if 1<=r<=100
◆ Test Cases
r Expected Output
0 Invalid input
5 50.24
➔ Case 2: Triangle
◆ Input Domain
I1 h: h<=0
I2 h: h>100
I5 b: b > 100
I6 b: 1<=b<=100
◆ Output Domain
◆ Test Cases
h b Expected Output
0 8 Invalid Input
2 3 3
2 0 Invalid input
3 2 3
➔ Case 3: Square
◆ Input Domain
I1 s: s<=0
I2 s: s>100
◆ Output Domain
Output Class Domain
O1 Square if 1<=r<=100
◆ Test Cases
s Expected Output
0 Invalid input
5 25
➔ Case 4: Rectangle
◆ Input Domain
I1 h: h<=0
I2 h: h>100
I4 b: b<=0
I5 b: b > 100
I6 b: 1<=b<=100
◆ Output Domain
h b Expected Output
0 8 Invalid Input
2 3 6
2 0 Invalid input
3 2 6
Introduction: Take the guess work out of the software delivery lifecycle. Provide your QA and
development teams with the power to collaborate, track project progress, and report on
requirements, test cases, and defects.
QA Complete allows you to take a strategic approach to testing by prioritizing key test functions,
accounting for risk, planning for coverage, and controlling test execution. Employing effective
test case management helps you ensure you’re running the right tests, and thus avoid releasing an
application that is not customer-ready.
Key Features:
Test Case Management:
The ability to organize, plan, and analyze your testing efforts across the lifecycle is critical to
your success or failure whether you use manual or automated test cases today. As projects cope
with fewer development resources, higher quality expectations, and shorter development
timelines, any serious development effort needs better test case management. QA Complete
delivers.
● Manage manual test cases and link them back to the original requirements, thereby
ensuring a requirement has been met. Evaluate the test run history of those automated
tests right from QA Complete.
● Employ re-usable manual test libraries to quickly create new test scenarios.
● Graphically report automated test runs with plug-ins for many leading automated testing
tools, including Test Complete and HP Quick Test Pro (QTP).
● Organize your test library any way you like: by component, functional area, release, or
Agile sprint.
● Add, print, edit, or email test cases with a single click.
Test Automation Tool Integrations:
QA Complete supports many automated testing tools, including Automated QA Test Complete
and HP Quick Test Pro. Integration with test automation tools allows you review the run history
of any automated test on any machine, so if you have a test lab with multiple machines running
automated tests, you can compare machine run history. Since you can co-ordinate both manual
and automated tests, you have better test information to make release decisions.
By integrating automated testing into QA Complete, you can:
● Launch the tests from within your automated tool and automatically report the run
information to QA Complete for analysis of runs over time.
● Trend results using graphical dashboards and schedule tests to run unattended.
Bi-Directional Traceability:
The goal of traceability is to ensure “adequate” test coverage for each software requirement. It is
important to maintain traceability both forwards and backwards, from requirement to test case
and from test case to requirement. This ensures that design specifications are appropriately
verified and that requirements are appropriately validated, ultimately reducing software defects
and – this is the ultimate goal, after all – improving code quality.
● Link together requirements, test cases, and reported defects.
● Drag and drop functionality to link test cases or defects to a requirement.
● With one click, see a traceability report showing all linkages to a particular requirement.
Requirements Management:
QA Complete helps you manage requirements regardless of your team’s development
methodology. It lets you define requirements for each release and track the release for which
each requirement is scheduled. Govern workflow and state transitions. Using workflow, you can
force design reviews, approvals, or test reviews.
● Easily set rules for status transitions.
● Automatically assign tasks to team members based on requirement status; receive email
alerts when requirements change.
● Attach documents to any requirement (such as detail designs, specifications, and
prototypes), and track versions of those documents.
● Add notes to the requirement, allowing the team to discuss requirement changes and
other important issues.
● View an audit history of any requirement, showing who made a change, the date and time
of the change, and the before-and-after values.
● Rely on an extensive set of standard and ad-hoc dashboards and reports (requirements
missing test cases, etc.)
Defect and Issue Tracking:
QA Complete allows you to track status and resolution progress of defects and issues for each
release. Instead of spending your time entering data, the software automatically generates a
defect identifier on failed test cases. Integration with Atlassian JIRA, Bugzilla, and other web-
based defect tracking tools allow you to blend QA Complete features with the defect tracking
tools your organization already uses.
● Coordinate QA and development teams to coordinate activities as bugs are found. QA
Complete has a full featured defect tracking component.
● If your team already owns a bug tracking system (like JIRA, Bugzilla, Microsoft TFS,
etc.), you can create defects inside of QA Complete and have those automatically
synchronized with your bug tracking system.
● Source code integration lets you associate source code with fixed defects. By doing this,
you can quickly discover which code modules are the most buggys, allowing your team
to put effort into raising the quality of that code.
● Defect reports and dashboards show defects by severity, priority, or other criteria.