Software Engineering Document
Software Engineering Document
Project Report On
Railway Reservation System
GROUP MEMBERS:
FUNCTIONAL REQUIREMENTS.
NON-FUNCTIONAL REQUIREMENTS.
ER DIAGRAM.
ACTIVITY DIAGRAM.
SEQUENCE DIAGRAM.
CLASS DIAGRAM.
DEPLOYMENT DIAGRAM.
SAMPLE CODE.
TESTING:
This system is basically concerned with the reservation and cancellation of railway
tickets to the passengers. The need of this system arose because as is the known
fact that India has the largest railway network in the whole of the world and to
handle it manually is quite a tough job. The long distance road network is very
poorly developed in most parts of India. Bulk of long distance traffic is carried by
the Indian Railway as a result Indian railways. Therefore forms a backbone of
public transport in India. The efficiency of the railway will increase result of
computerization due to dramatic reduction in communication time among
geographically dispersed offices. For the reservation of the ticket a person go to
ticket counter of the railway reservation office and expend its valuable time in
standing queue. Now to save that time we have a facility of Online Reservation
now we can book cancel or search other train information just by click on
computer.
Analysis
a.REQUIREMENT ANALYSIS:
Requirements are a feature of a system or description of something that is
capable of doing in order to fulfill the system s purpose. It provides the ’
appropriate mechanism for understanding what the customer wants, analyzing
the needs, assessing feasibility, negotiating a solution, specifying the solution
unambiguously, validating the specification and managing the requirements as
they are translated into an operational system. Requirement Analysis is a task
done under software engineering and software design. While requirements
engineering specifies software s operational characteristics i.e. function, data ’
behavior, indicates software s interface constraints, requirements analysis let the
’ software engineer (called analysis) to refine the software allocation and
construct models of data, functional and behavioral domains. Moreover,
requirements analysis provides software developer with a representation of data,
function and behavior that can be converted to data, architectural, interface and
component- level designs. At last, we can say that the requirement specification
makes available, the developer and the customer, a means to assess quality, once
the software has been built.
The analyst starts with the studies of system specification and the software
project plan. It is then important to understand the software in a system context.
Also, the review of the software scope, used to generate planning estimate, is
necessary. Next, communication for analysis must be established, so as to ensure
problem recognition. The reason behind is to recognize the basic problem
elements perceived by customer.
The next major area of effort for analysis is problem evaluation and
solution synthesis. The engineer (or analyst) must define all data objects that are
extremely observable. He must evaluate the content and flow of information.
Also, he must define and describe all software functions, understand software
behavior in the context of the system affected events, establish the
characteristics of system interface, and uncover additional design constraints.
After evaluating the current problems and desired information (i.e., input and
output), the engineer and analyst synthesizing one or more solutions. Initially, the
data objects, processing functions and the system behavior are defined in detail.
Once establishing this information, the analyst then considers basic architectures
for implementation. Thus the process of evaluation and synthesis proceeds until
both analyst and the customer are sure that software can be adequately specified
for subsequent development steps.
During the evaluation and synthesis activity, the analyst creates the system model
so as to better understand data and control flow, functional
processing,operational behavior and the information content. The model provides
a base forsoftware design and the creation of specifications for the software.
b.REQUIREMENT SPECIFICATIONS:
A Software Requirements Specification (SRS) is a complete
description of the behavior of the system to be developed. It includes a set
of use case that describes all the interactions that the users will have with
the software. Use cases are also known as Functional Requirements. Non-
Functional Requirements are requirements which impose constraints on
the design or implementation (such as performance requirements, quality
standards, or design constraints).
FUNCTIONAL REQUIREMENTS:
In software engineering, a functional requirement defines a function of a
software-system or component. A function is described as a set of inputs,
the behavior and outputs. Functional requirements may be calculations,
technical details, data manipulation and processing and other specific
functionality that show how a use case to be fulfilled.
Typically, a requirements analyst generates functional requirements after
building use cases. However, this may have exceptions since software
development is an iterative process and sometime certain requirements are
conceived prior to the definition of the use case. Both artifacts (use cases
documents and requirements documents) complement each other in a
bidirectional process.
A typical functional requirement will contain a unique name and number, a
brief summary, and a rationale. This information is used to help the reader
understand why the requirement is needed, and to track the requirement
through the development of the system.
1 - TRAIN DETAILS:
Customers may view the train timing at a date their name and number of
tickets.
2– RESERVATION:
After checking the number of seats available the customers reserve the
tickets.
3 – BILLING:
After reserving the required amount of tickets, the customer paid the
amount.
4 – CANCELLATION:
If the customers want to cancel the ticket, then half of the amount paid by
the customer will
be refunded to him.
5 – PERFORMANCE REQUIREMENTS:
It is available during all 2
6 – SOFTWARE SYSTEM ATTRIBUTES:
NON-FUNCTIONAL REQUIREMENTS:
In systems engineering and requirements engineering, non-functional
requirements are requirements which specify criteria that can be used to
judge the operation of system, rather than specific behaviors. Non-
functional requirements are often called qualities of a system. Other terms
for non-functional requirements are "constraints", "quality attributes",
"quality goals" and "quality of service requirements .́ Qualities, i.e. non-
functional requirements can be divided into 2 main categories:
a. Execution qualities, such as security and usability, are observable
at runtime.
b. Evolution qualities, such as extensibility and scalability, embody in
the static structure of the software system.
{
printf(" \n Press any key to continue:");
getch();
system("cls");
login();
int menu_choice,choice_return;
start:
system("cls");
printf("\n=================================\n");
printf(" TRAIN RESERVATION SYSTEM");
printf("\n=================================");
printf("\n1>> Reserve A Ticket");
printf("\n------------------------");
printf("\n2>> View All Available Trains");
printf("\n------------------------");
printf("\n3>> Cancel Reservation");
printf("\n------------------------");
printf("\n4>> Exit");
printf("\n------------------------");
printf("\n\n-->");
scanf("%d",&menu_choice);
switch(menu_choice)
{
case 1:
reservation()//Fucntion still not added
break;
case 2:
viewdetails();
printf("\n\nPress any key to go to Main Menu..");
getch();
break;
case 3:
cancel();
//function not added. code has been removed due to some errors
break;
case 4:
return(0);
default:
printf("\nInvalid choice");
}
goto start;
return(0);
}
void viewdetails(void)
{
system("cls");
printf("-----------------------------------------------------------
------------------");
printf("\nTr.No\tName\t\t\tDestinations\t\tCharges\t\tTime\n");
printf("-----------------------------------------------------------
------------------");
printf("\n1001\tRed Lines Express\tBoston to
Manhattan\tRs.5000\t\t9am");
printf("\n1002\tRed Lines Express\tManhattan To
Boston\tRs.5000\t\t12pm");
printf("\n1003\tLA City Express\t\tBoston To
L.A\t\tRs.4500\t\t8am");
printf("\n1004\tLA City Express\t\tL.A To
Boston\t\tRs.4500\t\t11am");
printf("\n1005\tIron City Express\tBoston To
Chicago\tRs.4000\t\t7am");
printf("\n1006\tIron City Express\tChicago To
Boston\tRs.4000\t\t9.30am");
printf("\n1007\tKeystone Express\tBoston To
Washington\tRs.3500\t\t1pm");
printf("\n1008\tKeystone Express\tWashington To
Boston\tRs.3500\t\t4pm");
printf("\n1009\tMeteor Express\t\tBoston To
Miami\t\tRs.6000\t\t3.35pm");
printf("\n1009\tMeteor Express\t\tMiami To
Boston\t\tRs.6000\t\t4.15pm");
}
void reservation(void)
{
char confirm;
int i=0;
float charges;
pd passdetails;
FILE *fp;
fp=fopen("seats_reserved.txt","a");
system("cls");
charges=charge(passdetails.train_num,passdetails.num_of_seats);
printticket(passdetails.name,passdetails.num_of_seats,passdetails.t
rain_num,charges);
}
else
{
printf("\nInvalid train Number! Enter again--> ");
goto start1;
}
fprintf(fp,"%s\t\t%d\t\t%d\t\t%.2f\n",&passdetails.name,passdetails
.num_of_seats,passdetails.train_num,charges);
printf("==================");
printf("\n Reservation Done\n");
printf("==================");
printf("\nPress any key to go back to Main menu");
}
else
{
if(confirm=='n'){
printf("\nReservation Not Done!\nPress any key to go
back to Main menu!");
}
else
{
printf("\nInvalid choice entered! Enter again----->
");
goto start;
}
}
fclose(fp);
getch();
}
float charge(int train_num,int num_of_seats)
{
if (train_num==1001)
{
return(5000.0*num_of_seats);
}
if (train_num==1002)
{
return(5000.0*num_of_seats);
}
if (train_num==1003)
{
return(4500.0*num_of_seats);
}
if (train_num==1004)
{
return(4500.0*num_of_seats);
}
if (train_num==1005)
{
return(4000.0*num_of_seats);
}
if (train_num==1006)
{
return(4000.0*num_of_seats);
}
if (train_num==1007)
{
return(3500.0*num_of_seats);
}
if (train_num==1008)
{
return(3500.0*num_of_seats);
}
if (train_num==1009)
{
return(6000.0*num_of_seats);
}
if (train_num==1010)
{
return(6000.0*num_of_seats);
}
}
void printticket(char name[],int num_of_seats,int train_num,float charges)
{
system("cls");
printf("-------------------\n");
printf("\tTICKET\n");
printf("-------------------\n\n");
printf("Name:\t\t\t%s",name);
printf("\nNumber Of Seats:\t%d",num_of_seats);
printf("\nTrain Number:\t\t%d",train_num);
specifictrain(train_num);
printf("\nCharges:\t\t%.2f",charges);
}
void specifictrain(int train_num)
{
if (train_num==1001)
{
printf("\nTrain:\t\t\tRed Lines Express");
printf("\nDestination:\t\tBoston to Manhattan");
printf("\nDeparture:\t\t9am ");
}
if (train_num==1002)
{
printf("\nTrain:\t\t\tRed Lines Express");
printf("\nDestination:\t\tManhattan to Boston");
printf("\nDeparture:\t\t12pm");
}
if (train_num==1003)
{
printf("\nTrain:\t\t\tLA City Express");
printf("\nDestination:\t\tBoston to L.A");
printf("\nDeparture:\t\t8am");
}
if (train_num==1004)
{
printf("\nTrain:\t\t\tLA City Express");
printf("\nDestination:\t\tL.A to Boston");
printf("\nDeparture:\t\t11am ");
}
if (train_num==1005)
{
printf("\nTrain:\t\t\tIron City Express");
printf("\nDestination:\t\tBoston to Chicago");
printf("\nDeparture:\t\t7am");
}
if (train_num==1006)
{
printf("\ntrain:\t\t\tIron City Express");
printf("\nDestination:\t\tChicago to Boston");
printf("\nDeparture:\t\t9.30am ");
}
if (train_num==1007)
{
printf("\ntrain:\t\t\tKeystone Express");
printf("\nDestination:\t\tBoston to Washington");
printf("\nDeparture:\t\t1pm ");
}
if (train_num==1008)
{
printf("\ntrain:\t\t\tKeystone Express");
printf("\n Destination:\t\tWashington to Boston");
printf("\nDeparture:\t\t4pm ");
}
if (train_num==1009)
{
printf("\ntrain:\t\t\tMeteor Express");
printf("\nDestination:\t\tBoston to Miami");
printf("\nDeparture:\t\t3.35pm ");
}
if (train_num==1010)
{
printf("\ntrain:\t\t\tMeteor Express");
printf("\nDestination:\t\tMiami to Boston");
printf("\nDeparture:\t\t1.15 ");
}
}
void login()
{
int a=0,i=0;
char uname[10],c=' ';
char pword[10],code[10];
char user[10]="user";
char pass[10]="pass";
do
{
getch();
}
system("cls");
}
void cancel(void) /* Sorry this function does not work. Coding is not
completed. Codes have been removed due to some errors */
{
system("cls");
int trainnum;
printf("-----------------------\n");
printf("Enter the train number: \n");
printf("-----------------------\n");
fflush(stdin);
scanf("%i",&trainnum);
printf("\n\nCancelled");
getch();
}
Testing
Software Testing is an empirical investigationconducted to
providestakeholders with information about the quality of the product
orservice under test,with respect to thecontext in which it is intendedto
operate. Software Testing also provides an objective,independentview of
the software to allow the business to appreciate andunderstand the risks at
implementation of the software. Testtechniques include, but are not limited
to, theprocess of executing aprogram or application with the intent of
finding software bugs . It canalso be stated as the process of validating and
verifying that asoftwareprogram/application/product meets the
businessandtechnical requirements that guided itsdesign and development,
so thatit works as expected and can be implemented with
thesamecharacteristics.
Software Testing, depending on the testing method employed, can
beimplemented at any time in the development process, however the
mosttest effort is employed after the requirements have been defined
andcoding process has been completed.
Black box testing:
Block box testing treats the software as a “black box” without
anyknowledge of internal implementation. Black box testing
methodsinclude: equivalence partitioning , boundary value analysis , all-
pairstesting , fuzz testing , model-based testing , traceability matrix
,exploratory testing and specification-based testing.
Specification-based testing:
Specification-based testing aims to test the functionality of
softwareaccording to the applicable requirements. Thus, the tester inputs
datainto, and only sees the output from, the test object. This level of
testingusually requires thorough test cases to be provided to the tester,
whothen can simply verify that for a given input, the output value
(orbehavior), either ”is” or “is not” the same as the expected value
specifiedin the test case.
Specification-based testing is necessary, but it isinsufficient to guard
against certain risks.
Advantages and disadvantages:
The black box tester has no “bonds” with the code, and a tester’sperception
is very simple: a code must have bugs. Using the principle,“Ask and you
shall receive,” black box testers find bugs whereprogrammers don’t. But, on
the other hand, black box testing has beensaid to be ”like a walk in a dark
labyrinth without a flashlight,”because the tester doesn’t know how the
software being tested wasactually constructed. That’s why there are
situations when (1) a blackbox tester writes many test cases to check
something that can be testedby only one test case, and/or (2) some parts
of the back end are nottested at all.
Therefore, black box testing has the advantage of “an unaffiliatedopinion,”
on the one hand, and the disadvantage of “blind exploring,” onthe other.
White box testing:
White box testing,by contrast to black box testing, is when the testerhas
access to the internal data structures and algorithms (and the codethat
implement these)
Types of white box testing :-
The following types of white box testing exist:
api testing - Testing of the application using Public and
Private APIs.
code coverage - creating tests to satisfy some criteria of code
coverage. For example, the test designer can create tests to
cause all statements in the program to be executed at least
once.
fault injection methods.
mutation testing methods.
static testing - White box testing includes all static testing.