Sie sind auf Seite 1von 127

Table of Content

1. Introduction 1.1. 1.2. Project Description: .......................................................................1 Technology Used .............................................................................2

1.2.1. .....................................................................................................2 1.2.2. .....................................................................................................4 1.2.3. .....................................................................................................8 1.2.4. .....................................................................................................9 1.2.5. .................................................................................................. 10 2. Project life cycle 2.1. Software Development life cycle ............................................... 17

3. Requirement Analysis 3.1. 3.2. 3.3. Overview ...................................................................................... 21 Objective of requirement analysis ............................................ 22 Software requirement specification .......................................... 23

3.3.1. Introduction ........................................................................... 23 3.3.2. Product description ................................................................ 24 3.3.3. Usage scenario ....................................................................... 25 3.3.4. Data objects and description ................................................ 26

3.3.5. Design constraints ................................................................. 27 4. System Designing 4.1. Overview ...................................................................................... 28

4.1.1. Database Design .................................................................... 28 4.1.2. Human Machine Interface Design .................................... 28 4.2. Software Design specification .................................................... 30

4.2.1. Database Design .................................................................... 30 4.3. Process Model .............................................................................. 38

4.3.1. Functional Decomposition Diagram ..................................... 38 4.3.2. Data Flow Diagram ................................................................ 39 5. Coding .................................................................................................... 46 6. Snapshots 6.1. 6.2. Visitor interfaces ....................................................................... 110 Administrator interfaces .......................................................... 122

7. Testing and implementation 7.1. Testing ....................................................................................... 130

7.1.1. Testing Objectives ............................................................... 130 7.1.2. Testing Principles ................................................................ 130 7.1.3. Unit Testing .......................................................................... 131 7.1.4. Integration Testing .............................................................. 134 7.1.5. System Testing ..................................................................... 136

7.1.6. Optimization Points ............................................................ 138 8. Limitations and Future Developments ............................................. 139 8.1. Conclusion ................................................................................. 139

9. Bibliography 9.1. 9.2. Books & Authors ...................................................................... 142 Consulted Website .................................................................... 142

1 Introduction

1.1.Project Description

E-commerce is fast gaining ground as an accepted and used business paradigm. More and more business houses are implementing web sites providing functionality for performing commercial transactions over the web. It is reasonable to say that the process of shopping on the web is becoming commonplace.

The objective of this project is to develop a general purpose e-commerce store where any product (such as books, CDs, computers, mobile phones, electronic items, and home appliances) can be bought from the comfort of home through the Internet.

However, for implementation purposes, this paper will deal with an online book store. An online store is a virtual store on the Internet where customers can browse the catalog and select products of interest. The selected items may be collected in a shopping cart. At checkout time, the items in the shopping cart will be presented as an order. At that time, more information will be needed

to complete the transaction. Usually, the customer will be asked to fill or select a billing address, a shipping address, a shipping option, and payment information such as credit card number. An e- mail notification is sent to the customer as soon as the order is placed.


Technologies Used

2. PHP is a general-purpose server-side scripting language originally designed for Web development to produce dynamic Web pages. It is one of the first developed server-side scripting languages to be embedded into an HTML source document, rather than calling an external file to process data. Ultimately, the code is interpreted by a Web server with a PHP processor module which generates the resulting Web page. It also has evolved to include a command-line interface capability and can be used in standalone graphical applications. PHP can be deployed on most Web servers and also as a standalone shell on almost every operating system and platform free of charge. A competitor to Microsoft's Active Server Pages (ASP) server-side script engine[ and similar languages, PHP is installed on more than 20 million Web sites and 1 million Web servers. 3. PHP was originally created by Rasmus Lerdorf in 1995. The main implementation of PHP is now produced by The PHP Group and serves as the formal reference to the PHP language. PHP is free software released under the PHP License, which is incompatible with the GNU General Public License (GPL) due to restrictions on the usage of the term PHP. 4. While PHP originally stood for "Personal Home Page", it is now said to stand for "PHP: Hypertext Preprocessor", a recursive acronym.[8]

PHP development began in 1994 when the Danish/Greenlandic/Canadianprogrammer Rasmus Lerdorf initially created a set of Perl scripts he called "Personal Home Page Tools" to maintain his personal homepage. The scripts performed tasks such as displaying his rsum and recording his web-page traffic. Lerdorf initially announced the release of PHP on the comp.infosystems.www.authoring.cgiUsenet discussion group on June 8, 1995. He rewrote these scripts as C programming language Common Gateway Interface(CGI) binaries, extending them to add the ability to work with Web forms and to communicate with databases and called this implementation "Personal Home Page/Forms Interpreter" or PHP/FI. PHP/FI could be used to build simple, dynamicWeb applications. Lerdorf released PHP/FI as "Personal Home Page Tools (PHP Tools) version 1.0" publicly on June 8, 1995, to accelerate bug location and improve the code. This release already had the basic functionality that PHP has today. This included Perl-like variables, form handling, and the ability to embed HTML. The syntax was similar to Perl but was more limited and simpler, although less consistent. A development team began to form and, after months of work and beta testing, officially released PHP/FI 2 in November 1997. Zeev Suraski and Andi Gutmans, two Israeli developers at the Technion IIT, rewrote the parser in 1997 and formed the base of PHP 3, changing the

language's name to the recursive initialism PHP: Hypertext Preprocessor. Afterwards, public testing of PHP 3 began, and the official launch came in June 1998. Suraski and Gutmans then started a new rewrite of PHP's core, producing the Zend Engine in 1999. They also foundedZend Technologies in Ramat Gan, Israel. On May 22, 2000, PHP 4, powered by the Zend Engine 1.0, was released. As of August 2008 this branch is up to version 4.4.9. PHP 4 is no longer under development nor will any security updates be released. On July 13, 2004, PHP 5 was released, powered by the new Zend Engine II. PHP 5 included new features such as improved support for object-oriented programming, the PHP Data Objects (PDO) extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements. In 2008 PHP 5 became the only stable version under development. Late static binding had been missing from PHP and was added in version 5.3. A new major version has been under development alongside PHP 5 for several years. This version was originally planned to be released as PHP 6 as a result of its significant changes, which included plans for full Unicode support. However, Unicode support took developers much longer to implement than originally thought, and the decision was made in March 2010 to move the project to a branch, with features still under development moved to trunk.

Changes in the new code include the removal of register_globals, magic quotes, and safe mode. The reason for the removals was that register_globals had opened security holes by intentionally allowing runtime data injection, and the use of magic quotes had an unpredictable nature. Instead, to escape characters, magic quotes may be replaced with the addslashes() function, or more appropriately an escape mechanism specific to the database vendor itself like mysql_real_escape_string() for MySQL. Functions that will be removed in future versions and have been deprecated in PHP 5.3 will produce a warning if used. Many high-profile open-source projects ceased to support PHP 4 in new code as of February 5, 2008, because of the GoPHP5 initiative,provided by a consortium of PHP developers promoting the transition from PHP 4 to PHP 5. As of 2011 PHP does not have native support for Unicode or multibyte strings; Unicode support is under development for a future version of PHP and will allow strings as well as class-, method-, and function-names to contain non-ASCII characters. PHP interpreters are available on both 32-bit and 64-bit operating systems, but on Microsoft Windows the only official distribution is a 32-bit implementation, requiring Windows 32-bit compatibility mode while using Internet Information Services (IIS) on a 64-bit Windows platform.

Experimental 64-bit versions of PHP 5.3.0 were briefly available for MS Windows, but have since been removed. 1 Licensing Section 1.01 Usage

PHP is a general-purpose scripting language that is especially suited to server-side web development where PHP generally runs on a web server. Any PHP code in a requested file is executed by the PHP runtime, usually to create dynamic web page content or dynamic images used on Web sites or elsewhere.[38] It can also be used for command-line scripting and clientside GUI applications. PHP can be deployed on most Web servers, many operating systems and platforms, and can be used with many relational database management systems (RDBMS). It is available free of charge, and the PHP Group provides the complete source code for users to build, customize and extend for their own use. PHP acts primarily as a filter, taking input from a file or stream containing text and/or PHP instructions and outputting another stream of data; most commonly the output will be HTML. Since PHP 4, the PHP parser compiles input to produce bytecode for processing by the Zend Engine, giving improved performance over its interpreter predecessor. Originally designed to create dynamic Web pages, PHP now focuses mainly on server-side scripting, and it is similar to other server-side scripting

languages that provide dynamic content from a Web server to a client, such as Microsoft's ASP.NET, Sun Microsystems' JavaServer Pages, and mod_perl. PHP has also attracted the development of many frameworks that provide building blocks and a design structure to promote rapid application development (RAD). Some of these include CakePHP, Symfony, CodeIgniter,Yii Framework, and Zend Framework, offering features similar to other web application frameworks. The LAMP architecture has become popular in the Web industry as a way of deploying Web applications. PHP is commonly used as the P in this bundle alongside Linux, Apache and MySQL, although the P may also refer to Python or Perl or some combination of the three. Similar packages are also available for Windows and Mac OS X, then called WAMP and MAMP, with the first letter standing for the respective operating system. As of April 2007, over 20 million Internet domains had Web services hosted on servers with PHP installed and mod_php was recorded as the most popular Apache HTTP Server module. PHP is used as the server-side programming language on 75% of all Web servers. Web content management systems written in PHP include MediaWiki, Joomla, eZ Publish, SilverStripe, WordPress, Drupal and Moodle. All Web sites created using these tools are written in PHP, including the user-facing portion of Wikipedia, Facebook, and Digg.

Section 1.02


Vulnerabilities are caused mostly by not following best practice programming rules: technical security flaws of the language itself or of its core libraries are not frequent (23 in 2008, about 1% of the total). Recognizing that programmers make mistakes, some languages include taint checking to detect automatically the lack of input validation which induces many issues. Such a feature is being developed for PHP, but its inclusion in a release has been rejected several times in the past. There are advanced protection patches such as Suhosin and HardeningPatch, especially designed for Web hosting environments. PHPIDS adds security to any PHP application to defend against intrusions. PHPIDS detects Cross-site scripting (XSS), SQL injection, header injection, Directory traversal, Remote File Execution, Local File Inclusion, and Denial of Service (DoS). Section 1.03 [edit]Syntax

Main article: PHP syntax and semantics <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>PHP Test</title>

</head> <body> <?php echo 'Hello World'; /* echo("Hello World"); works as well, although echo is not a function, but a language construct. In some cases, such as when multiple parameters are passed to echo, parameters cannot be enclosed in parentheses. */ ?> </body> </html>

Hello world program in PHP code embedded within HTML code The PHP interpreter only executes PHP code within its delimiters. Anything outside its delimiters is not processed by PHP (although non-PHP text is still subject to control structures described within PHP code). The most common delimiters are <?php to open and ?> to close PHP sections. <script language="php"> and </script> delimiters are also available, as are the shortened forms <? or <?= (which is used to echo back a string or variable) and?> as well as ASP-style short forms <% or <%= and %>. While short

delimiters are used, they make script files less portable as support for them can be disabled in the PHP configuration, and so they are discouraged. The purpose of all these delimiters is to separate PHP code from non-PHP code, including HTML. The first form of delimiters, <?php and ?>, in XHTML and other XMLdocuments, creates correctly formed XML 'processing instructions'. This means that the resulting mixture of PHP code and other markup in the server-side file is itself well-formed XML. Variables are prefixed with a dollar symbol, and a type does not need to be specified in advance. Unlike function and class names, variable names are case sensitive. Both double-quoted ("") and heredoc strings provide the ability to interpolate a variable's value into the string. PHP treatsnewlines as whitespace in the manner of a free-form language (except when inside string quotes), and statements are terminated by a semicolon. PHP has three types of comment syntax: /* */ marks block and inline comments; // as well as # are used for one-line comments. The echo statement is one of several facilities PHP provides to output text, e.g., to a Web browser. In terms of keywords and language syntax, PHP is similar to most high level languages that follow the C style syntax. if conditions, for and whileloops, and function returns are similar in syntax to languages such as C, C++, Java and Perl.

(a) Data types PHP stores whole numbers in a platform-dependent range, either a 64-bit or 32-bit signed integer equivalent to the C-language long type. Unsigned integers are converted to signed values in certain situations; this behavior is different from other programming languages. Integer variables can be assigned using decimal (positive and negative), octal, and hexadecimal notations. Floating point numbers are also stored in a platform-specific range. They can be specified using floating point notation, or two forms of scientific notation. PHP has a native Boolean type that is similar to the native Boolean types in Java and C++. Using the Boolean type conversion rules, non-zero values are interpreted as true and zero as false, as in Perland C++. The null data type represents a variable that has no value. The only value in the null data type is NULL. Variables of the "resource" type represent references to resources from external sources. These are typically created by functions from a particular extension, and can only be processed by functions from the same extension; examples include file, image, and database resources. Arrays can contain elements of any type that PHP can handle, including resources, objects, and even other arrays. Order is preserved in lists of values and in hashes with both keys and values, and the two can be intermingled. PHP also supports strings, which can be used with single quotes, double quotes, nowdoc or heredoc syntax.

The Standard PHP Library (SPL) attempts to solve standard problems and implements efficient data access interfaces and classes. Functions PHP has hundreds of base functions and thousands more via extensions. These functions are well documented on the PHP site; however, the built-in library has a wide variety of naming conventions and inconsistencies. PHP currently has no functions for thread programming, although it does support multiprocess programming on POSIX systems. Additional functions can be defined by a developer: function myFunction() { //declares a function, this is named myFunction return 'John Doe'; //returns the value 'John Doe' }

echo 'My name is ' . myFunction() . '!'; //outputs the text and the return variable of the //myFunction, the function is also called //the result of the output will be 'My name is John Doe!' (i) [edit]PHP 5.2 and earlier Functions are not first-class functions and can only be referenced by their name, directly or dynamically by a variable containing the name of the function. User-defined functions can be created at any time without

being prototyped. Functions can be defined inside code blocks, permitting a run-time decision as to whether or not a function should be defined. Function calls must use parentheses, with the exception of zero argument class constructor functions called with the PHP new operator, where parentheses are optional. PHP supports quasi-anonymous functions through the create_function() function, although they are not true anonymous functions because anonymous functions are nameless, but functions can only be referenced by name, or indirectly through a variable $function_name();, in PHP. PHP 5.3 and newer PHP gained support for closures. True anonymous functions are supported using the following syntax: function getAdder($x) { return function($y) use ($x) { return $x + $y; }; }

$adder = getAdder(8); echo $adder(2); // prints "10"

Here, the getAdder() function creates a closure using the parameter $x (the keyword use imports a variable from the lexical context), which takes an additional argument $y and returns it to the caller. Such a function is a first class object, meaning that it can be stored in a variable, passed as a parameter to other functions, etc. For more details see Lambda functions and closures RFC. The goto flow control statement is used as follows: function lock() { $file = fopen('file.txt', 'r+'); retry: if (!flock($file, LOCK_EX & LOCK_NB)) { goto retry; } fwrite($file, 'Success!'); fclose($file); return 0; } When flock() is called, PHP opens a file and tries to lock it. The target label retry: defines the point to which execution should return ifflock() is unsuccessful and goto retry; is called. The goto statement is restricted and requires that the target label be in the same file and context.

The goto statement has been supported since PHP 5.3. (b) Objects Basic object-oriented programming functionality was added in PHP 3 and improved in PHP 4. Object handling was completely rewritten for PHP 5, expanding the feature set and enhancing performance. In previous versions of PHP, objects were handled like value types. The drawback of this method was that the whole object was copied when a variable was assigned or passed as a parameter to a method. In the new approach, objects are referenced by handle, and not by value. PHP 5 introduced private and protected member variables and methods, along with abstract classes and final classes as well as abstract methods and final methods. It also introduced a standard way of declaring constructors anddestructors, similar to that of other object-oriented languages such as C++, and a standard exception handling model. Furthermore, PHP 5 addedinterfaces and allowed for multiple interfaces to be implemented. There are special interfaces that allow objects to interact with the runtime system.Objects implementing ArrayAccess can be used with array syntax and objects implementing Iterator or IteratorAggregate can be used with theforeach language construct. There is no virtual table feature in the engine, so static variables are bound with a name instead of a reference at compile time.[73]

If the developer creates a copy of an object using the reserved word clone, the Zend engine will check if a __clone() method has been defined or not. If not, it will call a default __clone() which will copy the object's properties. If a __clone() method is defined, then it will be responsible for setting the necessary properties in the created object. For convenience, the engine will supply a function that imports the properties of the source object, so that the programmer can start with a by-value replica of the source object and only override properties that need to be changed.[74] Basic example of object-oriented programming as described above: class Person { public $firstName; public $lastName;

public function __construct($firstName, $lastName = '') { //Optional parameter $this->firstName = $firstName; $this->lastName = $lastName; }

public function greet() { return "Hello, my name is " . $this->firstName . " " . $this->lastName . ".";

public static function staticGreet($firstName, $lastName) { return "Hello, my name is " . $firstName . " " . $lastName . "."; } }

$he = new Person('John', 'Smith'); $she = new Person('Sally', 'Davis'); $other = new Person('Joe');

echo $he->greet(); // prints "Hello, my name is John Smith." echo '<br />'; echo $she->greet(); // prints "Hello, my name is Sally Davis." echo '<br />'; echo $other->greet(); // prints "Hello, my name is Joe ." echo '<br />'; echo Person::staticGreet('Jane', 'Doe'); // prints "Hello, my name is Jane Doe." (i) Visibility of properties and methods The visibility of PHP properties and methods refers to visibility in PHP. It is defined using the keywords public, private, and protected. The default is

public, if only var is used; var is a synonym for public. Items declared public can be accessed everywhere. protected limits access to inherited classes (and to the class that defines the item). private limits visibility only to the class that defines the item. Objects of the same type have access to each other's private and protected members even though they are not the same instance. PHP's member visibility features have sometimes been described as "highly useful." However, they have also sometimes been described as "at best irrelevant and at worst positively harmful." Section 1.04 Speed optimization

Main article: PHP accelerator PHP source code is compiled on-the-fly to an internal format that can be executed by the PHP engine. In order to speed up execution time and not have to compile the PHP source code every time the Web page is accessed, PHP scripts can also be deployed in executable format using a PHP compiler. Code optimizers aim to enhance the performance of the compiled code by reducing its size, merging redundant instructions and making other changes that can reduce the execution time. With PHP, there are often opportunities for code optimization. An example of a code optimizer is the eAccelerator PHP extension.

Another approach for reducing compilation overhead for PHP servers is using an opcode cache. Opcode caches work by caching the compiled form of a PHP script (opcodes) in shared memory to avoid the overhead of parsing and compiling the code every time the script runs. An opcode cache, APC, is planned to be built into an upcoming release of PHP (but not 5.4 as previously planned ). Opcode caching and code optimization can be combined for best efficiency, as the modifications do not depend on each other (they happen in distinct stages of the compilation). Section 1.05 Compilers

The PHP language was originally implemented as an interpreter. Several compilers have been developed which decouple the PHP language from the interpreter. Advantages of compilation include better execution speed, static analysis, and improved interoperability with code written in other languages. PHP compilers of note include Phalanger, which compiles PHP into CIL byte-code, and HipHop, developed at Facebook and now available as open source, which transforms the PHP Script into C++, then compiles it, reducing server load up to 50%. Section 1.06 Resources

PHP includes free and open source libraries with the core build. PHP is a fundamentally Internet-aware system with modules built in for

accessingFTP servers, many database servers, embedded SQL libraries such as embedded PostgreSQL, MySql and SQLLite, LDAP servers, and others. Many functions familiar to C programmers such as those in the stdio family are available in the standard PHP build. PHP allows developers to write extensions in C to add functionality to the PHP language. These can then be compiled into PHP or loaded dynamically at runtime. Extensions have been written to add support for the Windows API, process management on Unix-like operating systems, multibyte strings (Unicode), URL, and several popular compression formats. Some more unusual features include integration with Internet Relay Chat, dynamic generation of images and Adobe Flash content, and even speech synthesis. The PHP Extension Community Library (PECL) project is a repository for extensions to the PHP language.

2 Project Life Cycle

2.1 Software Development Life Cycle: Software development organization follows some process when developing a software product. A key component of any software development process is the life cycle model on which the process is based. The particular life cycle model can significantly affect overall life cycle costs associated with a software product. Life cycle of the software starts from concept exploration and at the retirement of the software.

Feasibility Study

Requirement A n a l y s i s

D e s i g n i n g

C o d i n g

System Testing

Implementation and Maintenance

Software Development Life Cycle

PHASES OF SYSTEM DEVELOPMENT LIFE CYCLE: The system development life cycle is classically thought of as the set of activities that analysts, designers and users carry out to develop and implement an information system. The system development life cycle consists of the following activities:

Preliminary investigation. Requirement Analysis. System Designing. Coding. System Testing. Implementation and Maintenance.

Preliminary Investigation: An important outcome of the preliminary investigation is the determination that system is feasible or not. In the conduct of feasibility study, there are three major distinct and interrelated areas were taken into consideration. They are as follows: 1. Technical Feasibility :

The System of operation which was functioning earlier was totally manual, with no kind of automation or computerization. All the departments were maintaining separate registers for keeping various records. Due to expansion of schools more workspace and it appears a tedious task to maintain with specifying equipment and software that will successfully support the tasks required. As a result the computerized system is technically feasible as it is efficient, less time consuming, can produce outputs faster, can input large amount of data in limited time scale and easier to use in operation


Operational Feasibility : -

The ultimate users i.e. the people who are supposed to use the system are trained for a period of one month so as to get familiar with the new

system and its operation. They are taught about the new skills and the new technology and how the technology will be useful to them in their functioning. Operational feasibility is concerned with human,

organizational and political aspects. General impression of these factors is gained from the corporate appraisal. 3. Economical Feasibility :

The computerized system is economically feasible in the sense the cost of the hardware and software and the cost to training of personnel of the company to operate the system and the installation cost is less than the cost of maintaining the registers. This may not be a big sum in the long run of the school business. Also the time taken for the entire process of formulation, checking, studying and installation of the project has been equal to one working month of the school. As a result, there has been no hesitation on pert of the management in adopting the new system.

Requirements analysis:Analysis of requirements includes studying the existing system and collecting data. During analysis, data are collected on the available files, decision points and transaction handled by the present system. Once the

structured analysis is completed, the analyst has affirmed understanding of what is to be done.

System Designing: The design of an information system produces the details that clearly describe how a system will meet the requirements identified during system analysis. System analysts begin the design process by identifying reports and other outputs system will produce. The system design also describes the data to be input, calculated or stored. Coding: This is the phase in which computer based system is constructed from the specifications prepared in the design phase. Equipment is acquired and installed during the development phase. All necessary procedure, manuals software specifications, and other documentation are

completed. The staff is trained.

System Testing:During system testing, the system is used experimentally to ensure that the software does not fail. In other words we can say that it will run according to its specifications and in the way users expect. Special test data are input for processing, and the result examined.

Implementation, Evaluation and Maintenance:Implementation is the process of having systems personnel check out and put new equipments into use, train users, install the new application and construct any files of data needed to use it. Evaluation of the system is performed to identify its strength and weaknesses. Maintenance is necessary to eliminate errors in the working system during its working life and to tune the system to any variations in its working environment. The importance of maintenance is to continue to bring the new system to standards.

3 Requirement Analysis

3.1 Overview: Analysis is a Fact Finding Technique where studies like Users need, System Requirement Specifications, Feasibility Analysis and Cost-Benefit Analysis

Client / User Needs

Problem Analysis

Requirement Analysis

Validation Validated SRS

are carried out. This is the most important step in a software project where we get a general idea about the needs of the customers or end users by having man to man conversation with them and about the various conditions and restrictions that have to be taken care of while developing the software application. The purpose of this phase is to identify, analyze and document the exact requirements for the system. The developer, customer, a marketing organization, or any combination of the three may perform such study. It is extremely important that the developers of the system study the existing system thoroughly otherwise it is impossible to satisfy the needs of the user. The requirements at this stage are in end-user terms.

During the Requirement Analysis Phase, the development team analyzes the requirements to be fulfilled by the Online Shoping Cart website and identifies the probable approach for meeting these requirements. To identify the requirements needed by the website, we decided to study the existing Shopping Cart process like Searching Book, Adding to Cart, money transfer. In this phase we have also collect necessary information regarding the details to be stored Registered customer. 3.2 Objective of Requirement Analysis: Requirement analysis was conducted with the following objectives in mind: Identification of need Information Gathering Evaluate the system concept of feasibility

1. Identification of Need: The success of the system depends largely on how accurately a problem is defined, thoroughly investigated, and properly carried out through the choice of solution. Users need identification and analysis is concerned with what the user needs rather then what he/she wants. Until the problem has been identified, defined, and evaluated the analyst shouldn't think about solutions and whether the problem is worth solving or not. 2. Information Gathering: A key part of system development is gathering information. The analyst must know what information to get, where to find it, how to collect it, and how to make use of it. The proper use of tools for gathering information is the key to successful analysis. 3. Feasibility Study: Feasibility study is carried out to test if the proposed system is feasible in terms of economy, technology, resource availability etc. As such, given unlimited resources and infinite time, all projects are feasible. Unfortunately, such results and time are not possible in real life situations. Hence it is both necessary and prudent to evaluate the feasibility of the project at the earliest possible time in order to avoid unnecessary wastage of time, effort and professional embarrassment over an ill conceived system. 3.3 Software Requirements Specification (SRS):

3.3.1 Introduction:

A. Purpose: This document completely describes what the Shopping Cart should do without describing how the software will do it. The basic goal of the requirement phase is to produce the SRS, which describing the complete external behavior of the purposed software.

B. Scope: This document is the only one that describes the requirements of the system. It is meant for use by the developer and will be the basis for validating the final delivered system. Any changes made to the requirements in the future will have to go through a formal changes approval process. The developer is responsible for asking for clarifications, where necessary, and will not make any alteration without the permission of the client.

C. Developers responsibility: The developer is responsible for: (a) Developing the system. (b) Installing the software on the clients hardware. (c) Conducting any user training that might be needed for using the system.

(d) Maintaining the system for a period of one year after installation.

3.3.2 Product description: This section provides an overview of the software. This section describes the goal and objective of the software. This section also briefly describes the general requirements of the software. This section is very important for the verification of the software after the completion whether the objective and requirements of the software will met or not. A. Goals and objective: The main purpose of Online shopping Cart is to provide the Shopping related services on the Internet. This software also helps to automate the process of ordering the books in home using internet . The goals of Online Shopping Cart are:

To automate the time consuming process to go to book store and purchases books .

To advertise the new books available in Internet. To manage the records of customers, Books Details, Stock Details. To provide a searchable database of all customers and accounts. To minimize the amount of paper work required in the daily services. To provide a secure interface for the banking transactions. To provide an interface so that user can take advantage of anytime, anywhere Shopping.

B. General requirements: During the Requirement Analysis Phase, the development team analyzes the requirements to be fulfilled by the Online Shopping website and identifies the probable approach for meeting these requirements. To identify the requirements needed by the website, we decided to study the existing Shoping process like Searching Books , money transfer. In this phase we have also collect necessary information regarding the details to be stored by the database for opening an account. Finally, it was identified that the Shopping Website should:

Enable the visitors to fill Registration form. Provide details of the various Books available in Stores. Provide the information about the rate of the available books. Be secure enough against the malicious security attack, identity verification of the registered user and authorization. Be able to handle various run time exceptions and errors. It should provide proper interfaces to manage and view details. The web pages should be user friendly and well design to attract visitors.

3.3.3 Usage Scenario:

This section provides a usage scenario for the software. It organized information collected during requirements elicitation into use-cases.

A. User Profiles: There will be three levels of users: Administrator level (Employee) User level (Account Holder)

B. Use-cases:

Administrator level:

This level of users will be able to insert new Books, new Category and Price information,. They will also be able to generate

User Level:

This level of users will be able to Search the books, Order the books etc. They can view their records.

3.3.4 Data Objects and description:

During the requirement analysis phase, the development team examines existing Shopping Cart . After examining all process and feasibility we decided to consider following points while designing database: It should store information of the Registered user details. It should store information of the Books details. It should store information of the various accounts. It should store information of the various category of the books.

Design constraints: A. Hardware Requirement: I. Server (Windows 2000 Server (NT))

Microsoft 2000 Server is based on NT Technology biased to run server side scripts in ASP technology. Disk Space Web Server II. Client 3 GB. Microsoft IIS (6.0)

Disk Space Processor Processor Speed Memory B. Software Requirement: Operating System Technologies Client Side Scripting Language Markup Language

1GB. Pentium III 1.13Ghz 256 MB

: : : :

Windows 2000 / NT / XP PHP HTML. HTML

4 System Designing



System design is a solution, a HOW TO APPROACH to the creation of a new system. This important phase is composed of several steps. It provides the understanding and procedural details to implement the system. Design goes through a logical and physical stage of the progress. Logical design reviews the present physical system, prepares input/output specifications, makes audit security and control specifications, detailed implementation plans, and prepares the logical design walkthrough. The physical design makes out the details of the physical system, plans the system implementation and specifies any new hardware and software products.

4.1.1 DATABASE DESIGN: The collection of data is usually referred to as the database. The database contains the information about one particular enterprise. Database system of data involves both the definitions of structures for the storage of information, processing and mechanism for the manipulation of information. In addition, the database system provides for the safety of information stored in the database despite system crashes or attempts of unauthorized access.

4.1.2 HUMAN-MACHINE INTERFACE DESIGN: The design of the human machine interface in one of the most important aspects of system design. A good interface design should take into account the following factors: -

User characteristics: It includes consideration of the kinds of the users who will use the equipment, their diverse backgrounds and skills, the user expectations as well as their physical characteristics. The users who posses high degree of skill often prefer more powerful functions which usually means greater complexity, unskilled operations, on the other hand, would simple functions which are easier to learn and use. Task Characteristics: The nature of the users tasks differ and therefore the needs for specific-kinds of service from the system. For example unstructured tasks usually requires a more flexible mode of interaction to meet the varying needs of users as opposed to structured tasks, which are more predictable and repetitive. The sequence and frequency with which certain tasks are performed will also affect the optimal design of the user interface. Functional Characteristics: It refers to the various functions required to perform the tasks and the ease with which these functions can be learnt made use of by the users while ascertaining the functional characteristics, the support facilities required to perform the functions, also need to be taken into account. These include facilities like training, on line help, documentation, expert system etc. the

other aspect of functional characteristics of a system its performance criteria like response time, fault tolerance etc. INPUT DESIGN: The most common cause of errors in data processing is inaccurate input data. Errors entered by data entry operators can be controlled by the input design. Input design is the process of converting user-oriented inputs to computer based formats. The goal of input design to make data entry easy logical and free from errors.

OUTPUT DESIGN: Computers are the most important source of information to the user. Inputs are fed into computers to acquire the required outputs. The computers can provide valuable informations in the form of well-documented outputs for various values. The major form of output is a hardcopy (reports) from the printer. Reports are around the output requirements of the user. 4.2 Software Design Specification:

This section provides an overview of the entire design document. This document describes all data, architectural, interface and component-level design for the software.

4.2.1 Database Design: A. Tables description: Table 1: Table Definition: Table Name : Category_Details:


Store information about book category. : : CategoryID

Primary Key Foreign Key

Columns Definition: S. NAME NO. 1 2 CategoryId TYPE Number 5 No No DATA SIZE NULLS? VALUE DEFAULT

CategoryName VARCHAR2 25

Table Description: S. NO. NAME DESCRIPTION A system generated number auto posted to this 1 BRANCH_NO table column. 2 NAME Name of the Category.

Table 2: Table Definition: Table Name Purpose : : Book_Details

Stores details about books such as book title, author etc.

Primary Key Foreign Key

: :



Columns Definition: DATA S.NO. NAME TYPE 1 2 3 4 5 6 7 8 9 BookId CategoryId Title Author Publisher Edition Price Quantity Description Number Number 5 5 No No No No No No No No Yes SIZE NULLS? VALUE DEFAULT

VARCHAR2 50 VARCHAR2 30 VARCHAR2 30 VARCHAR2 5 Number Number Varchar2 7,2 3 100

Table description: S.NO. NAME DESCRIPTION A system generated number auto posted to this table 1 BookId column.

2 3 4 5 6 7 8 9

CategoryID Title Author Publisher Edition Price Quantity Description

Reference to Category_Details Title of the Book. Author Name of the book. Store the Book Publisher. Store the edition of the Book. Contain the Price Information. Contain the quantity available in store. Details of the book information

Table 3: Table Definition: Table Name Purpose user. : : ODER_DETAILS

Stores information about the order placed by the end

Primary Key Foreign Key




Table Description: S.NO. 1 NAME ORDERID DESCRIPTION A system generated number auto posted to this table column. 2 3 BOOKID Reference to Book_Details table.

QUANTITY Store the order quantity.

Table 4: Table Definition: Table Name Purpose : TEMP_DETAILS

:This table will holds the details about the book that have been searched by the end user.

Primary Key Foreign Key

: :

Columns Definitions:

DATA S.NO. NAME TYPE 1 2 3 4 5 BookId CategoryId Title Author Publisher Number Number 5 5 No No No No No SIZE NULLS?



6 7 8 9

Edition Price Quantity Description

VARCHAR2 5 Number Number Varchar2 7,2 3 100

No No No Yes

Table description: S.NO. 1 2 3 4 5 6 7 8 9 NAME BookId CategoryID Title Author Publisher Edition Price Quantity Description DESCRIPTION Store the book id of book details table. Store the category id of book details table. Title of the Book. Author Name of the book. Store the Book Publisher. Store the edition of the Book. Contain the Price Information. Contain the quantity available in store. Details of the book information

Table 5: Table Definition: Table Name Purpose : : USER_Profile

Store the information about all the registered user. : : UserName

Primary Key Foreign Key



8 9 10 11 12



No No No No No

Table Description: S. NAME NO. 1 2 3 4 5 6 7 8 9 USERNAME PASSWORD FIRSTNAME Store the user name Store information of user password Store the first name of the user DESCRIPTION

MIDDLENAME Store the middle name of the user. LASTNAME ADDRESS1 ADDRESS2 CITY STATE Store the information of the user last name. Store the information of the user address. Optional User city User state

10 11 12


State pin code User email address User phone number

Table 6: Table Definition: Table Name Purpose : : USER_AUTH

Stores the username and password of various end users. : :

Primary Key Foreign Key



Table description: S. NAME NO. DESCRIPTION

1 2


Store the user name of the end users. Stores the password of the user.

4.2. Process Model

A Process Model tells us about how the data is processed and how the data flows from one table to another to gather the required information. This model consists of the Functional Decomposition Diagram and Data Flow Diagram.

4.2.1. Functional Decomposition Diagram

A decomposition diagram shows a top-down functional decomposition of a system and exposes the system's structure. The objective of the Functional Decomposition is to break down a system step by step, beginning with the main function of a system and continuing with the interim levels down to the level of elementary functions. The diagram is the starting point for more detailed process diagrams, such as data flow diagrams (DFD). Figure 2 shows the Functional Decomposition Diagram for this project.

Functional Decomposition Diagram

4.2.2 Data Flow Diagram (DFD) Data Flow Diagrams show the flow of data from external entities into the system, and from one process to another within the system. There are four symbols for drawing a DFD:


Rectangles representing external entities, which are sources or

destinations of data. 2. Ellipses representing processes, which take data as input, validate and

process it and output it. 3. . Arrows representing the data flows, which can either, be electronic

data or physical items. 4. Open-ended rectangles or a Disk symbol representing data stores, including electronic stores such as databases or XML files and physical stores such as filing cabinets or stacks of paper.

Data Flow Diagrams for the current system. Each process within the system is first shown as a Context Level DFD and later as a Detailed DFD. The Context Level DFD provides a conceptual view of the process and its surrounding input,output and data stores. The Detailed DFD provides a more detailed and comprehensive view of the interaction among the sub-processes within the system.

Customer-Browse Context DFD

Customer - ShoppingCart Context DFD

Customer - Shopping Cart Detailed DFD

Customer-Authentication Context DFD

Customer-Authentication-PurchaseHistory DFD

Customer-Authentication-UserProfile DFD

Authenticated User-Purchase Context DFD

Authenticated User-Purchase DFD

5 Coding

User Interface

Admin Interface

End of Output


Software testing is a critical element of software quality assurance and represents the ultimate review of specification, design and code generation. The increasing visibility of software as a system element and the attendant costs associated with a software failure are motivating forces for well planned through testing.

Once source code has been generated, software must be tested to uncover as many errors as possible before delivery to customer. The goal is to design a series of test cases that have a high likelihood of finding errors but how? That where software testing techniques enter the pictures.

7.1.1 Testing Objectives

Testing is a process of executing a program with the intent of finding an error. A good test case is one that has a high probability of finding an as-yetundiscovered error.

A successful test is that uncovers an as-yet- undiscovered error.

7.1.2 Testing Principle

All tests should be traceable to customer requirement. Tests should be planned long before testing begins. The Pareto principle applies to software testing. Exhaustive testing is not possible. To be most effective, an independent third party should conduct testing.

"Software testing involves executing an implementation of the software with test data and examining the outputs of the software and its operational behavior to check that it is performing as required. Testing is a dynamic technique of verification and validation because it works with an executable representation of the system "

7.1.3 Unit Testing

Unit testing focuses verification effort on the smallest unit of software design-the software component or module. Using the component level design description as a guide, important control paths are tested to uncover errors within the boundary of the module. The relative complexity of tests and uncovered errors is limited by the constrained scope established for unit testing. The unit test is white-box oriented and the step can be conducted in parallel for multiple components.

Login Module:


Test Case


Expected Behavior ID cannot be Password NULL Can't be Perform login NULL processing All text fields are displayed and are properly aligned

Observed behavior Warning msg Warning be "ID can't msg NULL" Call proxy "password Inbox frame Little can't be alignment Null" problem

Test Result Success Success Success

No Descriptio 1 Can ID field Null ID n be Null? 2 Can password Null pass3 be Null? Login button is working or Is Login 4. not? Frame displaying properly? word Button pressed Invoke Login Frame


Server side Login Module

Sr. No 1

Test Case Description Is Database Connection



Observed behavior No error during No error found connection was during data found fetching done Matching

Test Result Success

Behavior Connection Connection object is Login ID+ created establishes Able to

Is able to retrieve establishing? Login ID and


Pass-Word fetch data Login Id +Passfrom Proper Database matching

passwordmatch Is able to from database & Login ID


Password word Client- Server Login Module combined Testing

Sr. No 1

Test Case Description Client Server Connection Server

Input Connecti on cmd Login cmd

Expected Behavior Connection established Proper Message Displayed to User

Observed behavior Connection is established All type of

Test Result Success

2 response handled properly or not? messages are displayed in proper format to user


Login cmd is received Communicatio by server n between 3 client and server send to client Server What if User 4 Id doesn't exist Login cmd+ UserlD should report Error msg: non "Login ID Success cmd response is Login and is taking place. Communication Success

existence of doesn't exist" UserlD

What if wrong password is entered?

Login cmd+ UserID+ Password

User should Error be prompt msg:


for reentry of "Invalid password Password "

Add Record Module:

Sr. Test Case No Description 1. Is Database Connection Addition of establishing? Books. Addition of 3 Books if already exits




Test Result Success Success

Behavior behavior Connection Connection No error during object is establishes connection was Book Addition Addition created found Name/Auth Completed. completed Book or/Stock/Ed Addition Name/Auth should not ition or/Stock/Ed complete ition Addition is not

Success completed, because record already exists.

Search Record Module:

Sr. Test Case No Description 1. Is Database Connection On search Criteria establishing? of

Input Connection




Behavior behavior Result Connection No error during Success

object is establishes connection was Book Result created found found. Success Result Name/Author/ found.

Title/Publisher/Ed Stock/Edition ition should come in list box

7.1.4 Integration Testing Integration testing is a systematic technique for constructing the program structure while at the same time conducting tests to uncover errors associated with interfacing. The objective is to take unit tested components and build a program structure that has been dictated by design.

Incremental integration is the antithesis of the big bang approach. The program is constructed and tested in small increments, where errors are easier to isolate and correct, interfaces are more likely to be tested completely, and a systematic test approach may be applied.

Register Module, Login Module and Logout Module is Integrated

Sr Test Case Input No Description Login ID Is new User 1 created?

Expected Behavior User should be

Observed behavior

Test Result

User named +personal created and personal ID is informatio information should created. n be stored in Database Success

Is Database 2 Connection establishing? Is able to match Login 3 ID &

Connectio Connection n object is establishes created Login Id Proper +Passmatching word

No error Success during connection was found Matching Success done

Password Does status of No change user changes 4 to 'Logout status? cmd change. status Logout Status should in Success

Add Record Module, Delete Record Module, Update Record Module, Search Record Module is Integrated

Sr Test Case Input No Description

Expected Behavior BookName/ Records should

Observed behavior

Test Result

Is new Record Author 1 Added in Name/Editio displayed on database? n etc Is existing 2 Record deleted Author from Is existing database? Record 3 updated into database? the view page be added and

Record is added and displayed on Success the view page.

BookName/ Records should Record is Success be deleted and deleted and not Name/Editio Records should displayed on the should not be BookName/ Record is n etc displayed on be updated and view page. Author updated and the view page should be Success Name/Editio displayed on the displayed on the n etc view page. view page BookName/ Records should Records found

On search

Criteria names Author 4 should be correct. Name/Editio the view page n etc the view page. be displayed on and displayed on Success

7.1.5 System Testing System testing is actually a series of different tests whose primary purpose is to fully exercise the computer-based system. Although each test has a different purpose, all work to verify that system elements have been properly integrated and perform allocated functions.

Functional Requirements

Sr. No

Test Case Input Description

Expected Observed Behavior behavior User should User is Registered Personal

Test Result

Can New User 1 Register? User Info of

Be registered only If desired Id Success on DTIS server does Not collide with Existing Ids User is login only

Can User 2 Login?

Loginld + password

User should When Login Id & Success Be login password is valid

BookName/ User should Can User Add Author 3 Records Name/Editi Add records on etc BookName/ User should Deleted records Can User 4. Delete Records Name/Editi delete records displayed on etc BookName/ User should Can User 5 Update Records Name/Editi update on etc records will be displayed Author be able to Updated records Success Author be able to will not be Success be able to be displayed Added records will Success

BookName/ User should Can User 6. Search Records Name/Editi search on etc. Can User Read information 7. available on the link site. Read information be displayed. Click the records User should be able to Information will Success will be displayed. Author be able to Result of search Success

Can User Logout

Click On Logout

User should be able to Logout

Logout Message Success


The software will work efficiently and speedily when the following conditions will be satisfied:

The server should be of high configuration. The client machine has larger RAM. Adequate free space on the clients hard disk. The user waits until he gets the home page properly. No access to the database for writing, deleting or updating by any other except the authority.

Salient Features of the System

The software is completely menu driven. The data entry screens are completely user friendly. All editing features and navigation from one field to another, one web page to another, etc is possible.

Exit from any web page is possible. Validation checks have been incorporated in each web page at the appropriate fields. Database has been secured by means of password protection. Authorization is necessary for all the internal users of the site.

8. Limitations and Future Development

There are some limitations for the current system to which solutions can be provided as a future development: 1. The system is not configured for multi- users at this time. The concept of transaction can be used to achieve this. 2. The Website is not accessible to everyone. It can be deployed on a web server so that everybody who is connected to the Internet can use it. 3. Credit Card validation is not done. Third party proprietary software can be used for validation check.

As for other future developments, the following can be done:

1. The Administrator of the web site can be given more functionalities, like looking at a specific customers profile, the books that have to be reordered, etc. 2. Multiple Shopping carts can be allowed.

8.1. Conclusion

The Internet has become a major resource in modern business, thus electronic shopping has gained significance not only from the entrepreneurs but also from the customers point of view. For the entrepreneur, electronic shopping generates new business opportunities and for the customer, it makes comparative shopping possible. As per a survey, most consumers of online stores are impulsive and usually make a decision to stay on a site within the first few seconds. Website design is like a shop interior. If the shop looks poor or like hundreds of other shops the customer is most likely to skip to the other site. Hence we have designed the project to provide the user with easy navigation, retrieval of data and necessary feedback as much as possible.

In this project, the user is provided with an e-commerce web site that can be used to buy books online. To implement this as a web application we used JSP as the Technology. JSP has several advantages such as enhanced performance, scalability, built- in security and simplicity. To build any web application using JSP we need a Programming language such as Java and JSP so on. was the language used to build this application. For the client browser to connect to the JSP engine we used Tomcat web server.

JSP uses JDBC to interact with the database as it provides in-memory caching that eliminates the need to contact the database server frequently and it can easily deploy and maintain an JSP application. Oracle was used as back-end database since it is one of the most popular commercial databases, and it provides fast data access, easy installation and simplicity. A good shopping cart design must be accompanied with user-friendly shopping cart application logic. It should be convenient for the customer to view the contents of their cart and to be able to remove or add items to their cart. The shopping cart application described in this project provides a number of features that are designed to make the customer more comfortable.

This project helps in understanding the creation of an interactive web page and the technologies used to implement it. The design of the project which includes Data Model and Process Model illustrates how the database is built with different tables, how the data is accessed and processed from the tables. The building of the project has given

me a precise knowledge about how JSP is used to develop a website, how it connects to the database to access the data and how the data and web pages are modified to provide the user with a shopping cart application.


91 References

9.1.1 Books & Authors

Naughton Schildt, Complete Reference Java 2, Third Edition, TMG. Ivor Horton, Beginning Java 2, Wrox Publications. Professional Java Server Programming J2EE 1.3 Edition, APress. Software Engineering, Pressman.

9.1.2 Consulted Websites