0% found this document useful (0 votes)
134 views58 pages

E-Shopping Report

This document provides a summary of an online shopping system project developed by BAPU ICSPI for their Bachelor of Technology degree. The project was developed under the guidance of Mr. Sunjay Khurana of Sun Infotech. The project aims to address problems with existing online shopping software by providing all important functions related to online shopping in one place using Java EE. The objectives of the project are to make an organization's products and services available online, facilitate new order booking, and make functions easy, smooth and efficient. System analysis was conducted including collecting current system information, hardware requirements, and current workflows to understand limitations and scope for the new system.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
134 views58 pages

E-Shopping Report

This document provides a summary of an online shopping system project developed by BAPU ICSPI for their Bachelor of Technology degree. The project was developed under the guidance of Mr. Sunjay Khurana of Sun Infotech. The project aims to address problems with existing online shopping software by providing all important functions related to online shopping in one place using Java EE. The objectives of the project are to make an organization's products and services available online, facilitate new order booking, and make functions easy, smooth and efficient. System analysis was conducted including collecting current system information, hardware requirements, and current workflows to understand limitations and scope for the new system.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 58

kCILC1 CN CNLINL SnCING

SS1LM


8y
kahu| Iosh|
CS IINAL LAk
0834S10026




D De ep pa ar rt tm me en nt t o of f C Co om mp pu ut te er r S Sc ci ie en nc ce e & & E En ng gg g. .
S Se et th h V Vi is sh ha am mb bh ha ar r N Na at th h I In ns st ti it tu ut te e O Of f E En ng gi in ne ee er ri in ng g R Re es se ea ar rc ch h A An nd d T Te ec ch hn no ol lo og gy y
, ,B Ba ar rb ba an nk ki i, , I IN ND DI IA A
2 20 01 10 011

A Project Report on ONLINE SHOPPING SYSTEM


SubmlLLed ln parLlal fulflllmenL for award of

8ache|or of 1echno|ogy
uegree
ln
Computer Sc|ence Lng|neer|ng


8y

8APuL !CSPl



under Lhe guldance of

Mk Sun[ay khurana (Sun Infotech)

Seth V|shambhar Nath Inst|tute Cf Lng|neer|ng kesearch And 1echno|ogy 8arbank|
201011



ACkNCWLLDGLMLN1

It is great pleasure Ior us to present this project in this Iorm. We would be undoing our job well
iI we do not thank to every who have helped us in making this project.
First and Ioremost we would like to thank my project guide Mr. Sunjay Khurana Ior his
untiring support which helped us a lot in making our project and he did prove a source oI
inspiration Ior us.
$econdly, we are no less grateIul to the other team members oI the trainee, Ior their kind
cooperation and spontaneous response.
We would also like to thank our Iamily members, particularly our parents who are supporting us
in pursuing the B.Tech. course.
Last but not least, we would like to thank our Iriends who extended their advice and suggestion
which helped us a lot in compiling my project




Date0S102011 kAnUL ICSnI
CSIINAL LAk








A8S1kAC1



This soItware is being developed with the intention oI Iixing all the problems currently aIIecting
the online shopping soItware`s in the industry. It contains all the important links to the various
tasks or categories oI topics related to ONLINE $OPPING Iunctions deIined in 'J2EE. Thus,
the soItware really helps the user to make all the important Iunctions in just one go.

The basic scope oI the creation oI this soItware was to present the innumerable study Ieatures to
the user. BeIore the advent oI online shopping the study possibilities with computer were very
time consuming and monotonous. A soItware was needed which can overcome these problems
and make the entire process very simple.
Our project report is the mirror oI our practical knowledge and its practical applicability, in
which we try to explore our utmost. The report covers various aspect oI soItware development
liIe cycle.
Our project is technically, operationally and economically Ieasible. It is executable on lower
conIigured computer having NETBEAN$ IDE .

















Introduction

Title oI the Project


O On nI Ii in ne e S Sh ho op pp pi in ng g

1.I 8rief Hisfory

E-commerce is one of the largest driving forces behind the Internet. Even in the Internet's
earliest days, many sites featured a shop where you could order products and have them
shipped to your home. With the advent of server-side techniques, such as JSP and ASP.NET,
it has been much easier and cheaper for smaller sites to after their products and services
online. Despite the large diversity in the goods these sites offer, they all have one thing in
common. To allow customers to select the products they want to order, they all feature a
product catalog and a shopping cart where products are stored during the shopping process.
At checkout time, these products are taken from the cart and usually stored in a database
so the order can be processed later.

Web Technology is very generic term. A lot of tools and methodologies are used to provide
accessibility of information like online computer purchasing on Internet. Company wants to
attract more customers from all over world; hence they want to go for a web-site displaying
the following information.
- ome Page, Products & Services, Associations
1
- Customer Registration, Shopping Cart, Order Product,

This project uses mainly web technology to provide accessibility of computer mart on
Internet, and also uses database technology as a support technology to support
transactions and data management. In this proposed project Active Server Pages will be
used as scripting language, Oracle as backend database technology for Web Clients. For
Local Clients on LAN the processing of the database and Reports generation for the
management is done basically using JSP as a front end. Code will be written in such a way
that front end will be used for form designing and validations and backend database like
MYSQL to store the information.





INTERNET
(Web Technologies)
SP
FILE
IIS + Database Server
WEB SERVER
Web Web
Web
CllenL
P11
SL8vL8

1.2 Objectives
As the company wants to attract more customers in their list, hence they want to go for a
web-site displaying the following information.
ome Page
Product & Services
Registration of Clients by assigning a user name & password so that a user can
access the product information along with rates and conditions. Before issuing him
username & password, the customer has to fill a registration form giving his all
personal details, which will be used by the company later on sending product
details and future schemes.
Product Catalog - ere the products are organized category and sub category
wise. The customer can navigate in the product catalog and view the entire
information along with the image of the product.
Order Booking - This is for the customers, who want to book the order by visiting
the Product & services page. The dispatch of the product only after the receipt of
payment from the client.
The prime objective to develop the proposed project is to make the organizations products
and services available on internet. This will also facilitate in new order booking of the buyers
and the functions of the organization easy, smooth and efficient. The other basic objectives
of the proposed project are
Should be reliable so that the user can depend on it
Should not crash on error (wrong data input)
Easy maintenance after first release
Portability (ability to run on different platforms).


System Analysis

System Analysis is the main feature of the software development. It can be said that it is
the heart of any of the system. The analysis needs an expert supervision & the person
should be minimum System Analysts with the experience of 2 to 3 years. One can use
Analysis Tools to analyze the system.
Some of the tools we have used to analyze the problem is given below.

i) Data CoIIection TooIs
We have collected the information regarding the project from Universal Book Depot,
Lucknow. This collection of information helps us to better understand the systems.


ii) Charting TooIs
The Graphical Representation of system & activities help us to understand the minor
problems & and the flow of information very easily, which can become very helpful in
analysis as well as to generate the new systems requirements. Graphical representation is
always better than normal text. We made E-R diagrams and data flow diagrams to collect all
2
the information and build relationship among the external entities. The E-R Diagram and
DFDs are available in design module.
iii) Dictionary TooIs
This tool helps us to maintain & record the data & description of system elements through
Data Items, Processes & Data Stores. This basically helps us about the information flow
among Clients, Managers and Staff members.After the use of above mentioned tools there
is a need to collect the following information about current system.
iv) Current System
First of all we have to collect the information of current manual system or computerized
system (if exists), which help us to collect the advantages & limitations of the current
system. We have to find out under which constraints we have to develop our new system.
We have to find out the limitations and scope of the project and draw a boundary between
the man and machine.
v) Hardware
Secondly we have to collect the information about hardware requirement. This information
is necessary to know about the storage space and memory available for current system as
well as for the new system.

vi) Current Working
We have to study the existing manual system and find out the scope to change the
procedure to increase the efficiency and productivity of the organization. This gives better
control on the overall system. We have to suggest new procedures to be adopted to
increase the efficiency of the project.

2.1 Identification of the Need

Goal of Analyst here is recognition of the basic problem elements as perceived user and
customer to understand software in the system context. In order to identify the need there
is a need to establish contact with management and technical staff of the customer and
software development organization.
The basic to develop the proposed project is to make the organizations products and
services available on Internet. This will also facilitate in
New order booking
Inquiry handling of the buyers
Company wants to use the power of Internet. Internet is becoming more and more popular
now days. Most of the company is running their business on Net. There should be a
companys Web-site so any person can access the information and satisfy his queries.
Problems in Current System
- User can not place the order on-line.
- User can nor see the products available online
- Inquiry about the product like features and price
The prime need to develop the project is to make the business online and the order booking
part of the company simple to provide user-friendly access of this software package on net
to all the customers. This will facilitate all the staff members of the organization so that
they can locate and reply the information concerned to them.



2.2 Feasibility Study

All projects are feasible - given unlimited resources and infinite time! Unfortunately, the
development of computer based system is more likely to be plagued by a scarcity of
resources and difficult delivery dates. It is both necessary and prudent to evaluate the
feasibility of the project at the earliest possible time. Months or years of effort, money loss
and untold professional embarrassment can be averted if we better understand the project
at its study time.The feasibility of a project is being analyzed with in some framework. The
most important factor is that if a project is feasible and desirable then it includes in the
schedule of the management so that approval can be taken from the same The assessment
of the " On Line Shopping " has the following facts.
TechnicaI FeasibiIity
Technical Analysis begins with the assessment of the technical viability of the proposed
system. We have to mention what technologies are required to accomplish system function
and performance. We have to also study how these technology issues will affect cost.This
Software is used for the maintaining the order booking & delivery along with complaint
andling part. As this Software is to be operated by the staff members of the organizations,
it should be user friendly. The existing technology seems sufficient to run the new system.
The data holding facility is also seems sufficient because we are using Oracle RDBMS and it
can handle large volume of data, hence in near future if the number of clients increases it
can handle its very easily.A web Application consists of one or more web pages that are not
static, but that can change in some way each time the page is displayed. Instead of being
stored on disk in the form of TML files, these pages are generated dynamically by
application. As a result, the generated pages are often referred to dynamic web pages. To
generate the dynamic pages we may use JSP or PP or ASP.NET Technologies of Microsoft.
OperationaI FeasibiIity
It seems that management of the company is very much interested in the new system. The
management & the users are normally the same members so there is no problem of
conflict between the management & users.
The all work is going manually, hence there is no liking with old system reflects.
The user & management both are ready to accept the new system, so they both show keen
interest in giving the facts

2.2.3 Financial and Economical


Among the most important information contained in feasibility study is cost benefit Analysis
- an assessment of the economic justification for a computer-based system Project. Cost
Benefit Analysis calculates approximate costs for project development and weighs them
against tangible and intangible benefits.

In the manual system it is difficult to keep the track of complaint received and replied and
pending complaints waiting for assignment or action.
It is analyzed that it will benefit the company in terms of time saving as well as cost. It is
also analyzed that cost of full system investigation is not much as it is not very much
complex system.


* * * * * * * * *




Software Engineering Paradigm Applied

Software Engineering is an engineering approach according to which techniques and


knowledge are systematically organized before they are applied to the development of
software. We will define Software to not only include software programs but also to the
associated documentation required to develop, operate and maintain the programs. By
defining Software in a broader sense, we wish to emphasize the necessity of considering the
generation of timely documentation as an integral part of the software development
process. We can combine this with definition of engineering to produce the following
definition.The practical application of scientific knowledge in the design and construction of
computer programs and the associated documentation required to develop, operate and
maintain them.To solve actual problems in an industry setting a software engineer or team
of engineers must incorporate a development strategy that encompasses the process,
methods and tools.
A process model for software engineering is chosen based on the nature of the project and
application, the methods and tools to be used, and the controls and deliverables that are
required.
Among the various available Software Process Models (Waterfall model, Spiral model,
Prototyping model, Fourth Generation Techniques etc) the best suited for this project is the
Water Fall Model.

Water Fall Model Techniques
The life-cycle paradigm demands a systematic, sequential approach to software
development that begins at the system level and progresses through analysis, design,
3
coding, testing and maintenance. The life-cycle paradigm encompasses the following
activities:

System Engineering and Analysis
Establishing requirements for all system elements and then allocating some subset of these
requirements to software
Software Requirement Analysis:
To understand the nature of the program to be built, the software engineer (analyst) must
understand the information domain for the software, as well as the required function,
performance, and interfacing. Requirements for both the system and the software are
documented and reviewed with the customer.


Design
Software design is actually a multi-step process that focuses on four distinct attributes of
the program: data structure, software architecture, procedural detail and interface
characterization. The design process translates requirements into a representation of the
software.

Coding
The design must be translated into a machine readable form. The coding step performs this
task.
%esting
Once code has been generated, program testing begins.
aintenance
Software will undoubtedly undergo change after it is delivered to the customer. Software
maintenance reapplies each of the preceding life-cycle steps to an existing program rather
than a new one.

Typical phases in the waterfall model are analysis and specification, design, coding, testing,
integration and maintenance

The water fall model has some disadvantages, like

1. It works only for systems designed to automate an existing manual system. For
absolutely new system determining the requirement is difficult as the user himself does
not know them in advance what is being built or finalized at each stage
2. Freezing the requirements means freezing the hardware. A large project might take few
years to complete, by the time the product is available the hardware become obsolete.
3. It assumes that requirements are frozen before the rest of the development can
proceed. In some situation it might be desirable to develop a part of the system
completely, and later enhance the system in phases. This is often done for the software
products that are developed not necessarily for a client, but for general marketing in
which case the requirements are likely to be determined largely by developer
themselves.







$ystem
engineering

Analysis


Design


Coding


Testing


Maintenance



1he WaLer lall Model


In our case we have to first freeze the requirements and then start development. ence the
best suited paradigm for our project is Water Fall Model Technique.
* * * * * * * * * *
Display
Confirmation
Finalize
Order
Proceed
to
Add
product
to cart
Visit
product
Enter
site
user
ueLalls Signe
d In?
Yes
Yes





















Software Requirements Specification

Universal Book Depot sells the books of various publishers like TechMedia, SAMS, PI etc.
Customer can navigate the protected pages of the web site by giving proper login and
password. e can visit the product or book catalog and add the product or book to the
shopping cart and when all the books are added to the cart order is finalized. The following
figure explains the purchase process.




4

Servicing division undertakes maintenance of the machines, which are given below:
Warranty
Maintenance Contract (AMC)
Now a days Internet is coming up in a big way. Web Technology is very generic term. A lot
of tools and methodologies are used to provide accessibility of information like online
computer purchasing on Internet. Company wants to attract more customers from all over
world, hence they want to go for a web-site displaying the following information.

ome Page
Products & Services
Associations
Customer Registration
This project uses mainly web technology to provide accessibility of computer mart on
Internet, and also uses database technology as a support technology to support
transactions and data management. In this proposed project Active Server Pages will be
used as scripting language, Oracle Server as backend database technology for Web Clients.
For Local Clients on LAN the processing of the database and Reports generation for the
management is done basically using Visual Basic as a front end. Code will be written in such
a way that front end will be used for form designing and validations and backend database
like Oracle to store the information.



.1 Design Constraints:
ardware Requirement:
Minimum ardware Configuration Required
SNo. Requirement Description
1. Operating
System
Microsoft Windows Server 2003/ Microsoft Windows
XP with NETBEANS
2. Software JDK1.6 and NETBEANS
3. Processor 600 Mz Pentium III -Class Processor or above
Processor P IV recommended
4. Memory 1 GB ( Windows Server - 256 MB, Windows XP -
190MB)
5. ard Disk 20 GB ( 900 MB available space required on System
Drive, 3.3 GB of available space required on
installation drive for JDK and NetBeans+Apache or
GlassFish Sever and additional 1.9 GB space required
for elp Library and 1 GB for Software along with
Database.
6. Display Super VGA (1024x768 or higher resolution display
with 256 colors

1oo|s ] Lnv|ronment Used
SNo. Requirement Description
1. Operating
System
Microsoft Windows Server 2003/ Microsoft Windows
XP with GlassFish Server/ Apache

2. Software JDK 1.6 with NetBeans

3. Front End SP, HTML

4. Back End MYSQL


.2 Proposed Modules
Division Incharge has decided to computerize these functions so as to resolve the various
problems occurring in the physical system. We suggested the computerized solution to
overcome the above mentioned problems. In the proposed software we have divided the
functions into two categories.

1. Functions to be performed by WEB Client
2. Functions to be performed by Administrator.

WEB CLIENT
Basically, all the functions in this category is to be performed on the web site. The we-site
will be created with the help of TML, FRONT PAGE and Java Script. The web pages in which
there is information interchange with the database, we have to use JSP.

We have to perform the following functions.
1. Creation of ome, About Company, Associations, Services & Products Pages
2. Registration of the Clients by assigning Login & Password
3. Order Booking of books through web-site.
The person who wants to make an inquiry regarding the products and services has to fill the
Registration Form and then his proper login name and password is created and he becomes
the authorized user to navigate few of important pages like price of the products.
The Web Client can also fill the feed back form for his queries, which will come as an E-Mail
to the company. The company can then get back to these would be customers and can send
the reply.
Administrator
The local processing is done at the Administrator Level. The activities like assignment of
complaint, call report submitted by the engineers, master file maintenance and report
generation. ere we will use JSP as front end and the information is exchanged with MY SQL
database.
1.Basic Data Stores
In Basic data Stores, we maintain the new books and valid customers along with their
address of communication and contact person. This process is mainly for Corporate or for
Local Clients.

* * * * * * * * * *








System Design
Software design is the first of three technical activities design, code, and test that is
required to built and verify software. The flow of information during this technical phase of
the software requirements, manifested by information, functional, and behavioral models
feed the design step. Using one of a number of design methods the design step produces a
data design, an architectural design, and a procedural design. The data design transforms
the information domain model created during analysis into the data structures that will be
required to implement the software. The architectural design defines the relationship
among major structural components of the programs. The procedural design transforms
structural components into a procedural description of the software. Source code is
generated and testing is conducted to integrate and validate the software.

Software design is the process through which requirements are translated into a
representation of software. From a project management point of view, software design is
conducted in two steps. Preliminary design is concerned with the transformation of
requirements into data and software architecture. Detail design focuses on refinements to
the architecture representation that lead to a detailed data structure and algorithmic
representations for software.




S

Fuctional InIormation
model model

Design Data design

ehavioral Architectural
Model design

Procedural Code
design
Other
Requirements Program
modules Test


Integrated and validated $oItware

Maintenance

Maintenance Design

Test Implemen
Implementation tation
Design


With design Without design


This diagram shows that the Software developed without design may take more time in
Implementation phase as compared to Software with Good design.
Designing of this software is done with high cohesiveness, i.e. there is a minimized
interaction between two different modules. There is no intra modular relationship between
modules. Most of the modules are self- independent. At the same time modules are loosely
coupled i.e. inter - modular relation exists. Designing part includes its Data Flow Diagrams,
Database Tables, Process logic of each and every module, Input design and Output design.
Input design includes input screens such as user login screen, order booking screen,
complaint registration screen and new user login/password entry screen. etc. and Output
design includes such as pending complaints and assigned complaints and output Reports.
.1 Data Flow Diagram
The Data Flow diagrams are as follows:





























.2 E-R Diagram













M







M

CusLomer
Logln _ld lname
Lname
Address
ClLy
SLaLe
hone no
Crder
CuanLlLy
Crder uaLe
Crder no
roducLs
lLemcode
lLemdeLall
Cpenlng rlce
8rand name

. Data Structures

Program structure is the field structure of each module. Data Structure is used to specify
the Records of the forms, primary key and the other relations among the tables are also
based on the data structure. Table are described as follows.

(1) Table Name: - Login
This table will be used to store the details of the client login and password
(2) Table Name - Items

This table is used to enter details of item selected in the basket.


(3) Table Name - Orders
A unique order number will be allocated when the shopper places their order. Each order number will
be recorded in the order_id column of a table called orders. This table will also stores details about
that shopper's name and credit card.

() Table Name - Order_info


The fourth table, named order_info,creates a record for each item purchased that links the shoppper's
unique order_id number with the product's unique item_id number and the quantity required.
A single order, with just one order_id number, can therefore, generate many orderinfo_id records
where several different items are purchased.

. Process Logic of Each Module
Product.java:
public class Product
{
/*define variables*/
String id,title;
int quantity;
double price;
//define class
public Product(String id,String title,double price)
{
this.quantity=1;
this.id=id;
this.title=title;
this.price=price;
}
/*define accessor method*/
public String getId() {return id;}
public double getPrice() {return price;}
public int getQuantity() {return quantity;}
public String getTitle() {return title;}
public double getTotal()
{ return price * (double)quantity;
}
}



ShoppingBasket.java
import myPackage.Product;
import java.util.*;
public class ShoppingBasket
{
Vector products;
public ShoppingBasket()
{products=new Vector();
}
public Enumeration getProducts(){
return products.elements();}
public void addProduct(Product product)
{

boolean flag=false;
for(Enumeration num=getProducts();num.hasMoreElements();)
{
Product item=(Product)num.nextElement();
if(item.getId().equals(product.id))
{flag=true;
item.quantity++;
break;
}

}
if(!flag) {products.addElement(product);}
}
public void deleteProduct(String str)
{

for(Enumeration num=getProducts();num.hasMoreElements();)

{
Product item=(Product)num.nextElement();
if(item.getId().equals(str))
{products.removeElement(item);
break;
}
}
}


public void emptyBasket()
{products=new Vector();

}
public int getProductNumber()
{return products.size();
}



public double getTotal()
{

Enumeration num=getProducts();
double total;
Product item;
for(total=0.0D;num.hasMoreElements();
total+=item.getTotal())
{ item=(Product)num.nextElement();

}
return(total);
}

}





Index.jsp
page contentType="text/html" pageEncoding="UTF-8"
!DOCTYPE TML PUBLIC "-//W3C//DTD TML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"
html
head
meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
titleJSP Page/title
/head
body
h1Welcome to Online Shopping!/h1
a href="= response.encodeURL("shop-products.jsp")"
img src="images\1.jpg" width="200" height="200" alt="View "/aStart
Shopping /td
/body
/html

Shop-basket.jsp

!DOCTYPE TML PUBLIC "-//W3C//DTD TML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"

page language="java" contentType="text/html"
import="myPackage.ShoppingBasket,myPackage.Product,java.util.*"

html
headtitleYour Shopping Basket/title/head body
jsp:useBean id="basket" class="myPackage.ShoppingBasket" scope="session"/



String name =request.getParameter("name");
if(name!=null)
{
if(name.equals("delete"))
{
String item_id=request.getParameter("item_id");
basket.deleteProduct(item_id);
}
}
if(basket.getProductNumber()!=0) {

table width="385" border="0" cellspacing="0"
tr
td colspan="6"h1Items in your shopping Basket:br/h1/td
/tr
tr tdRef/td tdTitle/td tdQty/td
tdPrice/td tdTotal/td td /td /tr




int rowCounter=0;
Enumeration products=basket.getProducts();
while(products.hasMoreElements())
{
Product product=(Product)products.nextElement();
rowCounter++;
String bg=(rowCounter2!=0)? "#COCOCO":"#FFFFFF";

tr bgcolor="= bg "
td=product.getId()/td
td=product.getTitle()/td
td=product.getQuantity()/td
td=product.getPrice()/td
td=product.getTotal()/td
td a href= "=response.encodeURL("shop-
basket.jsp?name=delete&item_id="+product.getId())
"Delete/a /td
/tr
}

tr td/tdtd/tdtd/td
tdbTotal/b/tdtd=basket.getTotal()/td/tr
/table br/br/

a href="=response.encodeURL("shop-products.jsp")"
img src="images\WMS.jpg" border="0"Shopping/a
a href="=response.encodeURL("shop-emptybasket.jsp")"
img src="images\emptybasket.jpg" border="0"Empty Basket/a
a href="=response.encodeURL("shop-checkout.jsp") "
img src="images\tocheckout.jpg" border="0"Check out/a

} else {out.print("Your shopping basket is empty");
br/br/
a href="= response.encodeURL("shop-products.jsp") "
img src="images\WMS.jpg" border="0"/aMore Shopping
} /body /html


Shop-checkout.jsp

!DOCTYPE TML PUBLIC "-//W3C//DTD TML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"

page language="java" contentType="text/html"
import="myPackage.ShoppingBasket,myPackage.Product,java.util.*"

html head titleCheckout/title /head body
jsp:useBean id="basket" class="myPackage.ShoppingBasket" scope="session"/

if (basket.getProductNumber()!=0) {
table width="385" border="0" cellspacing="0"
tr td colspan="5"Your order:brbr/td /tr
tr tdbRef/b/td tdbTitle/b/td
tdbQuantity/b/td tdbPrice/b/td
tdbTotal/b/td /tr

int rowCounter=0;
Enumeration products=basket.getProducts();
while(products.hasMoreElements()) {
Product product=(Product)products.nextElement();
rowCounter++;
String bg=(rowCounter 2 !=0) ? "#COCOCO":

"#FFFFFF";


tr bgcolor="= bg " td=product.getId()/td
td=product.getTitle()/td
td=product.getQuantity()/td
td=product.getPrice()/td
td=product.getTotal()/td /tr
}

tr td/tdtd/tdtd/td tdbTotal/b/td
td=basket.getTotal()/td /tr /table

b Please enter your details: /b
form method="post"
action="=response.encodeURL("shop-postorder.jsp")"

table width="385" border="1" cellspacing="0"
tr tdbFirst Name:/b/td
tdinput type="text" name="firstname" size=40/td


/tr tr tdbSurname:/b/td
tdinput type="text" name="surname" size=40/td

/tr tr tdbAddress:/b/td
tdinput type="text" name="address" size=40/td

/tr tr tdbcity:/b/td
tdinput type="text" name="city" size=40/td

/tr tr tdbpostcode:/b/td
tdinput type="text" name="postcode" size=10/td

/tr tr tdbcreditcard:/b/td
tdinput type="radio" name="card_type" value="visa"
Visa

input type="radio" name="card_type"
value="mastercard" Mastercard
input type="radio" name="card_type" value="amex"
Amex

/td

/tr tr tdbCredit Card Number:/b/td
tdinput type="text" name="card_number" size=40/td
/tr /table

input type="hidden" name="totalvalue"
value="=basket.getTotal() " br

a href="=response.encodeURL("shop-products.jsp") "
img src="images\WMS.jpg" border="0"Shopping /a

input type="submit" name="checkout"
value="press to send Your order"
/form

} else {out.print("There are no items in your shopping basket!");

} /body /html

Shop-emptybasket.jsp

page contentType="text/html" pageEncoding="UTF-8"
!DOCTYPE TML PUBLIC "-//W3C//DTD TML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"

page language="java" contentType="text/html"
import="myPackage.ShoppingBasket,myPackage.Product"

html head titleEmpty Basket/title /head
body h3Empty Shopping Basket:/h3

jsp:useBean id="basket" class="myPackage.ShoppingBasket" scope="session"/

basket.emptyBasket();

Your Shopping Basket has Been Emptied. brbr

a href="=response.encodeURL("shop-products.jsp") "
img src="images\WMS.jpg" border="0" /aShopping

/body /html

Shop-postorder.jsp

page contentType="text/html" pageEncoding="UTF-8"
!DOCTYPE TML PUBLIC "-//W3C//DTD TML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"

page language="java" contentType="text/html"
import="myPackage.ShoppingBasket,myPackage.Product,java.util.*, java.sql.*"


jsp:useBean id="basket" class="myPackage.ShoppingBasket" scope="session"/

html headtitleYour order has Been Received/title
/head body



// 1.load the MySQL JDBC driver
Class.forName("com.mysql.jdbc.Driver");


//2. open a connection to the "shop" database
java.sql.Connection
connection=java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/Shop","roo
t","root");


//3. assign SQL query and column pattern to variable

String query=
"INSERT INTO orders
(firstname,surname,address,city,postcode,card_number,card_type,totalvalue)
VALUES(?,?,?,?,?,?,?,?)";

//4. Create a Statement object to send SQL queries

java.sql.PreparedStatement Stmt=connection.prepareStatement(query);

//5. get all form attributes values from the request
//header and insert them into the Statement object
//in the defined pattern......


Stmt.setString(1,request.getParameter("firstname"));
Stmt.setString(2,request.getParameter("surname"));
Stmt.setString(3,request.getParameter("address"));
Stmt.setString(4,request.getParameter("city"));
Stmt.setString(5,request.getParameter("postcode"));
Stmt.setString(6,request.getParameter("card_number"));
Stmt.setString(7,request.getParameter("card_type"));
Stmt.setString(8,request.getParameter("totalvalue"));


//6. add the record to the MySQL "orders" table

Stmt.executeUpdate();


//7. get an order number incremented from last order
long order_id=((com.mysql.jdbc.PreparedStatement)Stmt).getLastInsertID();


//8. assign SQL query and column pattern to variable

String order_info_query="INSERT INTO order_info (order_id,item_id,quantity) VALUES
(?,?,?)";

//9. retrieve a list of basket contents from bean

Enumeration products=basket.getProducts();


//10. add a record for each different selected item
//to the MySQL "order_info" table...

while(products.hasMoreElements())
{
Product product=(Product)products.nextElement();
Stmt=connection.prepareStatement(order_info_query);

Stmt.setLong(1,order_id);
Stmt.setInt(2,Integer.parseInt(product.getId()));
Stmt.setInt(3,product.getQuantity());
Stmt.executeUpdate();
}


//11. clean up the objects

Stmt.close();
connection.close();


//12.empty the shopping basket
basket.emptyBasket();


h1Thanks for Your Order.
It will be Processed within 24 hours.br/
Please note that your order Number is No:

=order_id br
and Order value is =request.getParameter("totalvalue") br/br/
/h1
a href="
=response.encodeURL("shop-products.jsp") "
img src="images\WMS.jpg" border="0" /aMore Shopping

/body /html

Shop-products.jsp

!DOCTYPE TML PUBLIC "-//W3C//DTD TML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"
page language="java" contentType="text/html"
import="myPackage.ShoppingBasket,myPackage.Product"




page import="java.sql.*"
html
head titleWelcome to the Shop/title/head body
table width ="385" border="0" cellspacing="0"
tr td colspan="4"More books from Mike McGrath:/td
/tr tr
td colspan="4" align="right"


a href="= response.encodeURL("shop-basket.jsp")"
img src="images\1.jpg" width="150" height="150" alt="View basket Image"/aView
Basket /td
/tr tr
tdbRef/b/td tdbTitle/b/td

tdbPrice/b/td td/td /tr




Class.forName("com.mysql.jdbc.Driver");
java.sql.Connection connection=
java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/Shop","root","root");
// get records from the items table in the shop database

java.sql.Statement stmt=
connection.createStatement();
java.sql.ResultSet RS=
stmt.executeQuery("SELECT * FROM items");


//write a TML table containing each record

int rowCounter=0;

while(RS.next())
{

String item_id=RS.getString("item_id");
String title=RS.getString("title");
String description=RS.getString("description");
String price=RS.getString("price");
rowCounter++;
String bg=(rowCounter 2 !=0) ?"#COCOCO":"#FFFFFF";



tr bgcolor="= bg "
td= item_id /td
tdb= title /bbr/= description /td
tdE= price /td
td



a href="= response.encodeURL
("shop-products.jsp?title="+title+"&item_id="+item_id+"&price="+price) "
img src="images\an.gif" alt="add to basket image" Add to Basket/a/td
/tr

}RS.close();connection.close();
/table




jsp:useBean id="basket" class="myPackage.ShoppingBasket" scope="session"/

String title=request.getParameter("title");
if(title!=null)
{

String item_id = request.getParameter("item_id");
double price=
Double.parseDouble(request.getParameter("price"));
Product item =new Product(item_id,title,price);
basket.addProduct(item);
}



/body
/html


.6 Input Screens
Input Screens are designed using JSP & TML Web forms. We have used procedures and
functions to increase the reusability of code. We have created a class having functions and
procedures, which are used in many web forms of our application. Data base connection of
Input forms is done through JDBC library. There are various Input forms like Login Password
screen, screen of all the master and transaction files. The layouts of the














































Testing
In this section we have tested our system in different modes.
Basically the testing is done on different level like unit testing, integration testing, system
and acceptance testing. These different types of testing are required for different type of
faults.
We have tested in the following manner and whatever the faults we have got, fixed it
immediately.

Clients Needs Acceptance Testing



Requirements System Testing



Design Integration Testing



Code Unit Testing


Level of testing
Testing executes programs with the aim to finding errors. A good test is one which uncovers
a new error with a high degree of probability. A successful test is one which finds an error
not yet discovered.
TEST CASES
A test case is a detailed procedure that fully tests a feature or an aspect of a feature.
Whereas the test plan describes what to test, a test case describes how to perform a
particular test. You need to develop a test case for each test listed in the test plan.
Following Figure illustrates the point at which test case design occurs in the lab
development and testing process.
Designing Test Cases
A test case includes:
-
The purpose of the test.
-
Special hardware requirements, such as a modem.
-
Special software requirements, such as a tool.
-
Specific setup or configuration requirements.
-
A description of how to perform the test.
-
The expected results or success criteria for the test.

Test cases should be written by a team member who understands the function or
technology being tested, and each test case should be submitted for peer review.
Organizations take a variety of approaches to documenting test cases; these range from
developing detailed, recipe-like steps to writing general descriptions. In detailed test cases,
the steps describe exactly how to perform the test. In descriptive test cases, the tester
decides at the time of the test how to perform the test and what data to use.
Most organizations prefer detailed test cases because determining pass or fail criteria are
usually easier with this type of case. In addition, detailed test cases are reproducible and
are easier to automate than descriptive test cases. This is particularly important if you plan
to compare the results of tests over time, such as when you are optimizing configurations.
Detailed test cases are more time-consuming to develop and maintain. On the other hand,
test cases that are open to interpretation are not repeatable and can require debugging,
consuming time that would be better spent on testing.
We have prepared the test cases to test the software. Few of them are as follows:
Test case 1
Authorized user after login selects the selected books and adds to the basket and when the
user view the basket it must display all the selected books along with their price and grand
total. This test was successful.
Test Case II
Authorized user after login selects the selected books and adds to the basket and when the
user view the basket it must display all the selected books along with their price and grand
total. The user has the facility to delete the books from the basket and that book should be
removed from the basket. This test was also successful.
Unit testing:

After the source code was developed, review and verify for the correct syntax, Unit testing
is performed by the programmer; Unit testing is the dynamic method for the verification. In
the section the programmer is actually compiled and executed with the some test case and
then the result were evaluated .each and every modules is tested with some cases of
isolation and found to be correct and all the result obtained also correct.

Integration testing:

The next level of testing is integration testing .in this testing all the modules are integrated
properly and the data flow between the modules is proper.

System testing:

In the system testing the entire software is tested with the help of actual data provided by
the Organization .the reference documents for this purpose is the requirements documents.
System testing is done to ensure that the objective derived for the system are properly
achieved by the software developed, the requirements of the information useful for
manager are in the proper format and fulfilling all of their requirements.

WITE-BOX TESTING
White-box testing , sometimes called glass box testing ,is a test case design method that
use the control structure of the procedural design to derive test cases .
Using white-box testing methods, the software engineer can derive test cases that
Guarantee that all independent paths within a module have been exercised at least
once.
Exercise all logical decisions on their true and false sides.
Execute all loops at their boundaries and within their operational bounds and Exercise
internal data structures to ensure their validity.

BLACK BOX TESTING:
BLACK_BOX testing also called Behavioral testing , focuses on the functional requirements
of the software .That is black-box testing enables the software engineering to derive sets of
inputs conditions that fully exercise all functional requirements for a program .It is not an
alternative of WITE-BOX testing . Rather, a complementary approach is likely to uncover a
different class of errors than White-box methods.
BLACK BOX testing attempts to find errors in the following categories:
O Errors in data structures or external database access,
O Behavior or performance errors.
O Initialization and termination errors







Bibliography
The books, which I referred and which really helped me in building this software in time, are
as follows: -
JSP
O JAVA SERVER PAGES by Mike McGrath
O SAMS Teach yourself JSP by Jose Annunziato

MYSQL
O MYSQL by Mike McGrath
O SQL Queries by Evan Bayross
Software Engineering
O Software Engineering Beginners Approach
O An Integrated Approach to Software Engineering







8

You might also like