Beruflich Dokumente
Kultur Dokumente
Content Abstract List of figures List of screens 1.1. Organisation Profile... 2.1. Current System... 2.2. Need for Automation.. 2.3. Proposed System. 2.3.1. Scope of the System. 2.3.2. Objectives. 2.3.3. Functional Overvies. 2.4. Actors.. 2.5. Use Cases 2.6. Scenarios. 2.7. UML Diagrams.. 2.8. Non functional requirements 2.8.1. User Interface.. 2.8.2. Harware Requirements.. 2.8.3. Software Requirements.. 2.8.4. Performance considerations... 2.8.5. Error Handling and Extreme Conditions. 2.8.6. Security Issues.. 3. System Analysis.. 24-33 3.1. Entity Objects.. 3.2. Boundary Objects... 24 26 12 13 13 15 20 Page No. 4-5 6 7 7 10 10 11
3.3. Control Objects... 3.4. Interaction between objects... 3.5. Object Behaviour..... 4.1. Design Goals..... 4.2. System Architecture... 4.3. Global Control Flow... 4.4. Boundary Conditions.. 5.1. Types,Visibility and Signatures..... 5.2. Exceptions.... 5.3. Associations..... 5.4. Algorithms...
31 31 32 34 34 36 36 38 41 41 42
6. Coding. 44-57 6.1. Coding Approach... 6.2. Information Handling.... 6.3. Programming Style.... 6.4. Sample Code... 6.5. Verification and Validation... 44 44 45 45 57
7. System Testing..... 58-63 7.1. Testing concepts.. 58 7.2. Tesing Activities.. 58 7.3. Test Cases... 63 8. Technical Notes.... 64-70 8.1. Introduction to AJAX... 10. CONCLUSION.... 11. BIBLIOGRAPHY.... 64 76 77 9. SCREENS..... 71-75
Existing System:
Existing system uses a normal web application, which will be suffered by numerous post backs during the order processing time. The main drawbacks in the existing systems are In the past, web applications were limited because a web page had to be reloaded (or another page loaded in its place) in order for new data to be obtained. The Web was originally designed for browsing HTML documents. As a result, the classic Web application model adopts:
Proposed system:
This project develops a web application that eliminates synchronous page level post backs that causes entire page to post back.
AJAX is the technique of making web pages more interactive by using JavaScript to pull updated information from the server and modify the page displayed in the browser on the fly. In the AJAX model: o "Partial screen update" replaces the "click, wait, and refresh" user interaction model. o Asynchronous communication replaces "synchronous request/response model."
Operating system: windows 98, MS-DOS Backend : ORACLE 10g Front end : HTML, DHTML. Language : Java1.5.0 (JDBC, SERVLETS), Java script Browser : Internet Explorer4.0 Server : Tomcat Apache 5.0.
Hardware Requirements RAM Hard disk Monitor Keyboard : 256 MB : 1.74MB : SVGA color monitor : 105 standard and mouse.
LIST OF FIGURES:
Page no.
Figure 1 Use Case Diagram1.. 15 Figure 2 Use Case Diagram2...... 16 Figure 3 Sequence Diagram.... 17 Figure 4 Collaboration Diagram..... 18 Figure 5 Class Diagram... 19 Figure 6 State Chart Diagram 32
List of Screens:
Page no.
Screen 1 Boundary object for Login Form.. 26 Screen 2 Boundary object for Use.............. 27 Screen 3 Boundary object for Chat Room.. 28 Screen 4 Boundary object for Music Chat Room .. 29 Screen 5 Boundary object for Television 30
1.INTRODUCTION
1.1 Organization Profile: About the company
Honeypot IT Consulting Private Limited is an internationally established software development company with offices USA and India. The Indian office and development centre is located in a state-of-art facility in the heart of Hyderabad; India. Honeypot IT is into software product development and enterprise consulting services. Honeypot IT service offerings cater to multiple industry domains and verticals, following full or partial SDLC, optimally customized to cater to specific client needs. Honeypot also provide human resources for the different areas of a software development life cycle.
Vision
Honeypot IT Solutions is an interactive and technology solution Provider. We help clients to plan their online strategy, budget their technology investments, integrate critical applications, and implement projects that achieve business objectives and improve performance. Since our inception we have focused on building dynamic, user-focused web sites, intranet's and extranets, supported by interactive marketing and e-communication campaigns.
Mission Values
Since its inception, Honeypot IT has been governed by its core values. They shape the culture and define the character of our company. They guide how we behave and make decisions.
Integrity
Inspiring trust by taking responsibility, acting ethically and encouraging honest and open debate.
Honeypot IT Consulting services range from customized software design and development
services to product based enterprise and web application development. Honeypot IT service offerings cater to multiple industry domains and verticals, following full or partial SDLC, optimally customized to cater to specific client needs.
Honeypot IT service offerings are based on its understanding of clients' business processes
and functional requirements. The business domain knowledge is then applied to develop software solutions by utilizing the available pool of technical skill sets and proven methodologies. Honeypot IT offer specialized services in outsourced software development, which allows our clients to focus on their core competencies, while outsourcing IT requirements to Honeypot IT. The clients benefit from Honeypot its spectrum of technology tools, quality services and low cost of development.
List of services
Application Services Product Engineering Web Designing & Development
2.REQUIREMENTS
Requirement Elicitation focuses on describing the purpose of the system. The client, the developers and the users identify the problem area and define a system that addresses the problem. Such a definition is called a system specification and serves as a contract between the client and the developers. The system specification is structured and formalized during analysis to produce an analysis model. They differ only in the language and notation they use. The system specification is written in natural language, where as the analysis model is expressed in a formal or semiformal notation. The system specification supports the communication with the client and the users and among the developers. They are the models of the system in the sense that they attempt to accurately represent the external the aspects of the system. Since the models represent the same aspects of the system, the requirement elicitation and elicitation and analysis occur concurrently and iteratively. Requirement elicitation and analysis focuses only on the user view of the system. For example the system functionality, the interaction b/t the user and the system, the errors that the system can detect and handle and the environmental conditions in which the system functions are the parts of the requirements. The system structure, the implementation technology, and other aspects are not directly visible to the user and not the parts of the requirements. Requirements documentation involves studying the current system to find out how it works and where improvements should be made. Information will be gathered from all areas. A requirement is a feature that must be included in a new system. It may include a way of capturing or processing data, producing information, controlling system activity. Requirement Elicitation focuses on describing the purpose of the system. The client, developers and the users identify the problem area and define the specification servers as 8
contract between the client and the developers. Here the focuses mainly on the users view of the system.
There may be several users using the same system at different times. They
may change the any content, and added very important orders. These situations may damage the system or make the system work improperly. There is no proper report for administrator to know these changes and act During the submission of the details, which typically changes based on the accordingly. speed of the connection and the amount of processing being done, the user sits and waits while the page refreshes. On a page-based application, they might have to click through several pages without knowing what is ahead of them.
10
many users are processing orders through intranet or internet, this system will be a bit easier to implement so that the changed pages will be refreshed thoroughly.
2.3.2 Objectives:
The objective of the project is to make effective and efficient automated system. We can analyze the awareness about various activities of the project. Success of the project lies in aspects such as How well to automate the System. How well the user feels ease with the System. How well the client -server interacts with the system
2.4 Actors:
Actors represent external entities that interact with the system. An actor can be human or an external system. During this activity, developers identify the Actors involved in this system are: Administrator:
11
Administrator is an actor who starts the service and who control the unnecessary deletions in the file system. User: User is an actor who uses the files and who may deletes the files in the client systems.
2.6 Scenarios:
A Use Case is an abstraction that describes all possible Scenarios involving the described functionality. A scenario is an instance of a use case describing a concrete set of actions. Scenarios are used as examples for illustrating common cases. Their focus is on
12
understandability. Use cases are used as examples for illustrating common cases. Their focus is on completeness. We describe a scenario using a template with three The name of the scenario enables us to refer to it ambiguously. The name of a scenario is underlined to indicate it is an instance. The participating actor instances field indicates which actor instances are involved in this scenario. Actor instances also have underlined names The flow of events of a scenario describes the sequence of events step by step.
13
14
GENERAL TOPICS
PROGRAMMING
MOVIES USER
MUSIC
TELIVISION
LOG OUT
15
GENERAL TOPICS
PROGRAMMING
MOVIES USER
MUSIC
TELIVISION
LOG OUT
16
Sequential Diagram
USER
TOPICS
SENDER
RECIVER
LEAVE ROOM
MOVIES CLEAR HISTORY MUSIC SEND MUSIC YOUR COLOR TELEVISION THAIR COLOR PINK LOG OUT RECIEVED
17
Collabration Diagram
1: GENERAL 4: PROGRAMMING 8: MOVIES 10: MUSIC 12: MUSIC 15: TELEVISION USER
TOPICS
7: LEAVE ROOM 2: TEXT BOX LOG OUT 18: 5: LEAVE ROOM 9: CLEAR HISTORY 11: SEND 14: YOUR COLOR 16: THAIR COLOR
6:
RECIVE R
SENDE R
18
Class Diagram
USER
CHAT ROOMS
19
128MB RAM 2 GB Hard disk space. Network interface card or Modem (For Remote Sources)
20
21
Robustness of system refers to the capability of system providing information when concurrent users requesting for information
22
concepts that are manipulated by the system, their properties and their relationships. The analysis object model, depicted with UML class diagrams, includes classes, attributes, and operations. The analysis object model is a visual dictionary of the main concepts visible to the user.
23
3.SYSTEM ANALYSIS
3.1 Entity Objects:
An entity represents a real time object that can be uniquely identified by a set of attributes. Entity objects represent the output or input data item through which the system can have information. That is, Entity objects represent the persistent information tracked by the system. The current process involves the following entity objects: The below structure defines the login details Structure login { Char uname[20]; Char pwd[20]; Char role[20]; } The following structure defines the company details: Structure Company { int Compid; char compname[20]; char Email[20]; int phno; char Comments[50]; } The following structure defines the customer details:
24
Structure Customer { int custid; char Customername[20]; char Email[20]; } The following structure defines the Products details: Structure Products { int Productid; char Productname[20]; int Compid; char color[20]; double Pur_price; double Sale_price; int Stock; int reorderlevel; } The following structure defines the Orders details: Structure Products { int Orderid; int Custid[20]; date Orddt; date delidt; }
25
26
This form is the starting form of our application. A user enters his username and password and the role. If the user is identified as an administrator account holder then he will be navigated to the administrators welcome page. Else if he is a limited user, he will be navigated to the users home page.
This form is the administrators welcome page. This is the main page of the administrator giving him options of generating orders, customer details, company details. Not only these, but also he is provided with a powerful feature which makes him the administrator.
27
28
29
30
31
32
Design is the first step in the development phase for any techniques and principles for the purpose of defining a device, a process or system in sufficient detail to permit its physical realization.
Once the software requirements have been realized, analyzed and specified the software design involves three technical activities design, coding, generation and testing that are required to build and verify the software. The design activities are of main importance in this phase, because in this activity, decisions ultimately affecting the success of software implementation and its ease of maintenance are made. These decisions have the final bearing upon reliability and maintainability of the system. Design is the place where quality is fostered in development. Software design is a process through which requirements are translated into a representation of software. System Design is the transform of analysis model into a system design model. Developers define the design goals of the project and decompose the system into smaller subsystems that can be realized by individual teams. Developers also select strategies for building the system, such as the hardware/software platform on which the system will run, the persistent data management strategy, the goal control flow the access control policy and the handling of boundary conditions. The result of the system design is model that includes a clear description of each of these strategies, subsystem decomposition, and a UML deployment diagram representing the hardware/software mapping of the system. The Analysis model describes the system completely form the actors point of view and serves as the basis of communication between the client and the developers. The Analysis model, however, does not contain information about the internal structure of the system, its hardware configuration or more generally, how the system should be realized. System design is the first step in this direction. During the system design activities, Developers Bridge the gap between the requirements specification, produced during requirements elicitation and analysis, and the system that is delivered to the users.
33
4.SYSTEM DESIGN
4.1 Design Goals:
The definition of goals is the first step of system design, it defines the qualities that our system should focus on many design goals can be inferred from the non function requirements or from the application domain, other will have to the elicited from the Client, it is necessary to state them explicitly such that every important design decisions can be made consistently following the same set of criteria. The following are the design goals for the current system:
a.
Reliability: The application should be reliable in keeping the data secure during computation
of the orders. b. Fault Tolerance: The application should handle all the expected faults that a user is highly
probable to commit. c. Security: It should never compromise on the security of orders and data. Once it fails to
maintain security to the orders/data, the application becomes a worthless bauble. d. Modifiability: It should be easy to be understood. The design and implementation should not
be too complex for another person to understand it. It should be feasible for modification.
Finding sub systems during system design has many similarities to finding objects during analysis. System decomposition is constantly revised whenever new issues are addressed. The initial sub system decomposition should be delivered from the functional requirements.
34
A starting point is to take the use cases and assign the participating objects that have been identified in each of them to the sub systems. As the complexity of systems increases, the specification of the system decomposition is critical. Moreover, subsystem decomposition is constantly revised whenever new issues are addressed. Subsystems are merged into alone subsystem, a complex subsystem is split into parts, and some subsystems are added to take care of new functionality. The first iterations over the subsystem decomposition can introduce drastic changes in the system design model. These are often best handled through brainstorming sessions.
35
Configure: For each persistent object, we examine in which use cases it is created or
destroyed. We determine whether data is being written in the database in a standard format according to Oracle conventions.
Exception Handling: For each type of component failure we decide how the system
should react. In general exception is an event or error that occurs during the execution of the system. Exceptions are caused by different sources.
Hardware Failure: Hardware ages and fails. For example; the failure of the data base server
etc..,
During Analysis, we describe the purpose of the system. This results in the identification of application objects that represent user concepts. During system design, we describe the system in terms of its architecture, such as its subsystem decomposition, its global
36
control flow, and its persistency management. During system design, we also define the hardware /software platform on which we build the system. This results in the selection of offthe shelf components that provide a higher level of abstraction than the hardware. During Object design developers close the gap between the application objects and the off-the-shelf components by identifying additional solution objects and refining existing objects. Object design includes: 1. Service specification 2. Component selection 3. Object model restructuring 4. Object model optimization Object design, like system design is not algorithmic. During object design, we refine the analysis and system design models, identify new objects, and close the gap between application objects and off-the-shelf components. This includes the identification of custom objects, the adjustment of off-the-shelf components, and the precise specification of each subsystem interface and class. as a result, the object design model can be partitioned into sets of components such that they can implemented by individual developers. Object design is non-linear. Although the group of activities describes above each addresses a specific object design issue, they need to occur concurrently. A specific off-the-shelf components may contain the number of types of exceptions mentioned in the specification of an operation and thus may impact the subsystem interface. The larger number of objects and developers, the high rate of change, and the concurrent number of decisions made during object design make this activity much more complex than analysis or system design is.
37
5. Object Specification:
The System design model focuses on the subsystem decomposition and global system decision such as hardware/software mapping persistent storage or access control. We identify top-level subsystems and define them in terms of the services they provide. Object design includes service specification activity. During this we specify the sub system services in terms of class interfaces, including operations, arguments, type signatures and exceptions. During this activity, we also needed missing operations and objects needed to transfer data among subsystem. The result of this activity is a complete interface for each subsystem
Specification activities during Object Design Identifying missing attributes and operations Specifying type signatures and visibility Specifying constraints Specifying exceptions
38
In this we also consider the relationship between the classes we identify and classes form the off the shelf components Finally we determine visibility of each attribute and operation.
Private: A private attribute can be accessed only by the class in which it is defined. Similarly only the class in which it is defined can invoke a private operation subclass or other classes cannot access private attributes and operations. Protect: A protected attribute or operation can be accessed by the class in which it is denied and on any descendant of the class. Public: A public attribute or operation can be accessed by any class.
Boolean Login ()
Type:
User name: This is a character variable describing the user name Pass word: This is the character variable describing the pass word Role: This is the character variable describing the role. Bool Login (): This is Boolean function describing whether the user logged in is valid or not.
39
Signature:
Char User name; Char Password; Char Role; Bool Login ();
Visibility:
Here the variables are private and the methods are public.
Add/modify details
Type:
Customer id: This is the integer variable describing the customer id. Company id: This is the integer variable describing the customer id. Product id: This is the integer variable describing the customer id. addDetails (): This is function is used for adding details of the customer, products and company. modifyDetails (): This is function is used for modifying details of the customer, products and company.
40
deleteDetails (): This is function is used for deleting details of the customer, products and company.
Signature:
int companyid; int customerid; int customerid; void addDetails(); void modifyDetails(); void deleteDetails();
Visibility:
Here the variables are private and the methods are public.
5.2 Exceptions:
In this we specify constraints that the caller needs to specify before invoking on operation or specify condition that the operation detect and treat as errors by raising an exception. In language such as java and ADA we have built in mechanism for exception handling. Other languages such as c and c++ do not support explicit handling. So the developers need to establish conventions and mechanisms for handling exceptions. These can be found systematically by examining each parameter of the operation by examining the states in which the operation may be invoked.
5.3 Associations:
Associations are UML concepts that denote collections of bi conditional limits between two or more objects. References are unidirectional and take place between two objects. 1. One_to_one association
41
The simplest association is one_to_one association. In the present ,the association between user and system is one to one. User system
2. One_to_many association: In the present system the association between administrator and the users is one to many Administrator 3. Many_to_many association: In the present system the association between users Internet is many to many User Internet users
5.4 Algorithms:
42
The steps for interaction are: 1. A client event occurs. 2. A XMLHttpRequest object is created and configured. 3. The XMLHttpRequest object makes a call. 4. The request is processed by the ValidateServlet. 5. The ValidateServlet returns an XML document containing the results. 6. The XMLHttpRequest object calls the callback () function and processes the result. 7. The HTML DOM is updated.
43
6.CODING
The goal of the coding or programming phase is to translate the design of the system produced during the design phase into code in a given programming language, which can be executed by a computer and that performs the computation specified by the design. The coding phase affects both testing and maintenance. The goal of coding is not to reduce the implementation cost but the goal should be to reduce the cost of later phases. In other words the goal is not to simplify the job of programmer. Rather the goal should be to simplify the job of the tester and maintainer.
Bottom-up Approach can best suit for developing the object-oriented systems. During system design phase of reduce the complexity. We decompose the system into an appropriate number of subsystems, for which objects can be modeled independently. These objects exhibit the way the subsystems perform their operations. Once objects have been modeled they are implemented by means of coding. Even though related to the same system as the objects are implemented of each other the Bottom-Up approach is more suitable for coding these objects. In this approach, we first do the coding of objects independently and then we integrate these modules into one system to which they belong.
HomePage.jsp
<html> <head> <script> var st; function validate1() { var usid=""; usid = document.getElementById("usid"); st=frm.s1.value; var url = "validateuser1.jsp?usid="+usid.value; if (window.XMLHttpRequest) req = new XMLHttpRequest(); else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP"); if(st=="customer") { req.open("GET", url, true); req.onreadystatechange =callback; req.send(null); } }
46
function callback() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseText; msg1.innerText=message; } } } function check() { st=frm.s1.value; } function callpage() { st=frm.s1.value; var usid = document.getElementById("usid"); var pswd = document.getElementById("pswd"); if(st=="customer") window.open("customerh.jsp?usid="+usid.value+" &pswd="+pswd.value,"_self"); else if(st=="admin" && usid.value=="admin" && pswd.value=="admin") window.open("admin.jsp","_self"); else alert("Invalid id..."); }
47
</script> </head> <body bgcolor="skyblue"> <table width="100%"> <tr bgcolor="darkblue"> <td align="center" style="color:white;font-weight:bold;font-size:25">Online Order Processing System (AJAX) </td> </tr> </table> <form name="frm"> <label style="position:absolute;left:650;top:137" id="msg1"></label> <br><br> <table style="font-weight:bold;font-family:arial" align="center"> <tr> <td align="right">Role : </td> <td> <select name="s1" onchange="check()"> <option value="">Choose Role</option> <option value="admin">Admin</option> <option value="customer">Customer</option> </select> </td> </tr> <tr> <td align="right">User Name :</td> <td> <input type="text" size="20" name="usid" id="usid" onkeyup="validate1()"></td> </tr>
48
<tr> <td align="right">Password :</td> <td> <input type="password" name="pswd" id="pswd" size="10"></td> </tr> <tr> <td colspan="2" align="center"><input type="button" value=" Submit " onclick="callpage()"> </td> </tr> </table> </form> </body> </html>
Admin.jsp:
<html> <head> <script> function validate1() { var usid = document.getElementById("usid"); var url = "validateuser.jsp?usid="+usid.value; if (window.XMLHttpRequest) req = new XMLHttpRequest(); else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP"); req.open("GET", url, true); req.onreadystatechange =callback;
49
req.send(null); } function callback() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseText; msg1.innerText=message; } } } function insertcallback() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseText; alert(message); } } } function insert1() { var usid = document.getElementById("usid"); var pswd = document.getElementById("pswd"); if(usid.value!="" && pswd.value!="") {
50
var url = "insert1.jsp?usid="+usid.value+"&pswd="+pswd.value; if (window.XMLHttpRequest) req = new XMLHttpRequest(); else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP"); req.open("GET", url, true); req.onreadystatechange = insertcallback; req.send(null); } else alert("Fill the fields..."); } </script> </head> <body link="white" alink="white" vlink="white" bgcolor="skyblue"> <table width="100%"> <tr bgcolor="darkblue"> <td align="center" style="color:white;font-weight:bold;font-size:25">Administrator</td> </tr> <tr bgcolor="darkblue" style="color:yellow;font-weight:bold" > <td align="center">[ <a href="index.jsp">home</a> ] </td> </tr> </table> <form name="frm"> <br><br> <table style="font-weight:bold;font-family:arial" align="center"> <tr bgcolor="darkblue"> <td><a href="customer.jsp" style="width:300;text-align:center">Customer</a></td>
51
</tr> <tr> <td> </td> </tr> <tr bgcolor="darkblue"> <td><a href="product.jsp" style="width:300;text-align:center">Product</a></td> </tr> <tr> <td> </td> </tr> <tr bgcolor="darkblue"> <td><a href="company.jsp" style="width:300;text-align:center">Company</a></td> </tr> <tr> <td> </td> </tr> <tr bgcolor="darkblue"> <td><a href="reports.jsp" style="width:300;text-align:center">Reports</a></td> </tr> </table> </form> </body> </html>
Validatecid.jsp:
<%@page import="java.sql.*"%> <% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("Jdbc:Odbc:orders"); PreparedStatement ps=con.prepareStatement("select * from customer where cid=?");
52
String cid=request.getParameter("cid"); ps.setString(1,cid); ResultSet rst=ps.executeQuery(); if (rst.next()) { response.setContentType("text/xml"); response.setHeader("Cache-Control", "no-cache"); response.getWriter().write("ID Exists"); } else { response.setContentType("text/xml"); response.setHeader("Cache-Control", "no-cache"); response.getWriter().write(""); } %>
Cost.jsp:
<%@page import="java.sql.*,java.util.*"%> <html> <head> <script> var uc=0,q=0; function getcomp() { var sp = document.getElementById("sp"); var url = "getprice.jsp?sp="+sp.value; if (window.XMLHttpRequest) req = new XMLHttpRequest(); else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP"); req.open("GET", url, true); req.onreadystatechange=compcallback; req.send(null); }
53
function getprice() { var sp=document.getElementById("sp"); var comp=document.getElementById("comp"); var url = "getprice1.jsp?sp="+sp.value+"&comp="+comp.value; if (window.XMLHttpRequest) req = new XMLHttpRequest(); else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP"); req.open("GET", url, true); req.onreadystatechange=pricecallback; req.send(null); } function pricecallback() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseText; frm.uc.value=message; costcal(); frm.q.focus(); frm.q.select(); } } } function compcallback() { if (req.readyState == 4) { if (req.status == 200) { frm.comp.remove(0); frm.comp.remove(1); frm.comp[0]=new Option("Company"); var message = req.responseText; var f1=message.indexOf(":"); var fitem=message.substring(0,f1); var sitem=message.substring(f1+1,message.length-1); frm.comp[1]=new Option(fitem.substring(2),fitem.substring(2));
54
if(sitem!=":") frm.comp[2]=new Option(sitem,sitem); }}} function costcal() { uc=eval(frm.uc.value); q=eval(frm.q.value); var cs=q*uc; frm.c.value=cs; } function fun() { frm.q.select(); frm.sp.focus(); } function orderadd() { var sp = document.getElementById("sp"); var uc = document.getElementById("uc"); var q = document.getElementById("q"); var c = document.getElementById("c"); var url = "processorder.jsp?sp="+sp.value+"&uc="+uc.value+"&q="+q.value+"&c="+c.value; if (window.XMLHttpRequest) req = new XMLHttpRequest(); else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP"); req.open("GET",url,true); req.onreadystatechange=ordercallback; req.send(null); } function ordercallback() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseText; alert(message); } } } </script> </head> <body onload="fun()" bgcolor="skyblue"> <table width="100%">
55
<tr bgcolor="darkblue"> <% String usid=(String)session.getAttribute("usid"); Calendar cal=Calendar.getInstance(); int dd=cal.get(Calendar.DATE); int mm=cal.get(Calendar.MONTH); int yy=cal.get(Calendar.YEAR); String dtt=dd+"/"+mm+"/"+yy; %> <td style="color:white;font-weight:bold;font-size:25">User : <%=usid %> Order Processing</td> </tr> </table> <% ResultSet rst=null; try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("Jdbc:Odbc:orders"); String sp=request.getParameter("sp"); PreparedStatement ps=con.prepareStatement("select distinct pname from product"); rst=ps.executeQuery(); }catch(Exception e) { out.write(e.toString()); } %> <br><br><br><br> <form name="frm"> <table style="font-weight:bold;font-family:arial" align="center"> <tr> <td>Select Product : </td> <td> <select name="sp" id="sp" onchange="getcomp()"> <option>Product</option> <%while(rst.next()){ String f1=rst.getString(1); %> <option value="<%=f1%>"><%=f1%></option> <%}%> </select> </td>
56
<td>Select Company : </td> <td> <select name="comp" id="comp" style="width:90" onchange="getprice()"> </select> </td> <td>Unit Cost : </td> <td><input type="text" size="10" name="uc" id="uc" readonly style="textalign:right"><td></tr> <tr> <td>Quantity : </td> <td><input type="text" size="10" name="q" id="q" onkeyup="costcal()" value="0" style="textalign:right"> <td>Cost : </td> <td><input type="text" size="10" name="c" id="c" readonly value="0" style="textalign:right"></td> </tr> <tr><td><br></td></tr> <tr> <!--<td><a href="javascript:orderadd();">Add Order</a></td>--> <td><input type=button value="Add Order" onclick="orderadd();"></td> <td colspan="8" align="right"> <a href="cost.jsp">Select More Products</a> </td> </tr> <tr><td><br></td></tr> <tr><td><br></td></tr> <tr><td><br></td></tr> <tr><td><br></td></tr> <tr> <td colspan="2" align="right">order date<input type="label" name="orddt" id="orddt" value="<%=dtt%>" ReadOnly></td> </tr> <tr><td><br></td></tr> <tr><td colspan="8" align="right"> <a href="totalorders.jsp">Process Order</a> </td> </tr> </table> </form> </body></html>
57
7.TESING
Testing is the process of finding differences between the expected behavior specified by system models and the observed behavior of the system.
can be an object, a group of objects, or one or more subsystems. abnormal component behavior. An error is a manifestation of a fault during the execution of the system.
58
A failure is a deviation between the specification of a component and its behavior. A test case is a set of inputs and expected results that exercise a component with
A failure is triggered by one or more errors. the purpose of causing failures and detecting faults.
Testing is the phase where the errors remaining from all the previous phases must be detected. Hence, testing performs a very critical role for quality assurance and for ensuring the reliability of software. Testing of designed software consists of providing the software wit a set of test outputs and observing if the software behaves as expected. If the software fails to behave as expected, then the conditions under which a failure occurs are needed for debugging and correction. The following terms are some commonly used terms associated with testing.
Error
The discrepancy term a error is used in two different ways. It to human action refers that to the between computed, observed, or measured value and is also used to refer true, specified, or results in
59
software containing a defect or fault. This definition is quite general and encompasses all the phases.
Fault
Fault is a condition that causes a system to fail in performing its required function. In other words a fault is an incorrect intermediate state that may have been entered during program execution.
Failure
Failure required is the inability to of the its system or component to perform a
function
according
failure is a
manifestation of error. But the mere presence of an error may not cause a failure. Presence of an error implies that a failure must have occurred, and the observation of a failure implies that a fault must be present in the system. However, the presence of a fault does not imply that a failure must occur.
A test case is the triplet [i, s, o], where i stands for the data input to the system, s is the output of the state of the system at which the data is input, and o is the expected system .a test suite is the set of all test cases with which a given software
product is to be tested.
product confirms to its previous phase. Verification is concerned with phase containment of
60
Validation is the process of determining whether a fully developed system confirms to its required specification. The aim is to make the final product error free.
Types of testing: 1. White box testing. 2. Black box testing. White box testing:
1. In the white box testing the designer can derive test cases that guarantee that all independent once. 2. Exercise all logical decision on their true and false sides. 3. Exercise all bounds. 4. Exercise internal data structures to ensure their validity. loops at their boundaries and within their operational paths within a module have been exercised at least
There are several methods used in the white box testing in the software design.
Statement
coverage
In this, each statement in a program is executed at least once. This is done by
Branch coverage
In this, each and every branch is tested whether the different branch conditions are true or false. It is a stronger test criterion over statement coverage testing.
Condition coverage
61
In this, each component of a condition of a composite conditional expression is given both true and false values. It is a stronger test criterion over branch coverage testing.
Path coverage:
In this testing, all the linearly independent paths in the program are executed once. A linearly independent path is defined in terms of the control flow graph of a program. The control flow graph describes how the flow of control passes through the program.
Mutation testing
In this method, the software is first tested by the above methods after the initial testing. In the mutation testing few small changes to program at a time such as, changing a conditional operator or changing the type of variable each time the program is changed, is data is called a mutated program and the change effected is called mutant. Then it is tested if it gives an error, then the mutant is said to be enhanced to kill the mutant. dead, if it is working properly then the test
62
meant for, it means that he has to exercise all functional requirements for a program. The black box testing is done after the software is developed. Black box testing attempts to find errors in the following: 1. Incorrect or missing functions. 2. Interface errors. 3. Errors in data structures or external database access. 4. Performance errors. 5. Initialization and termination errors.
Testing object oriented programs are different from testing functional oriented programs. As the test cases in black box testing are selected independently of the internal structure of the code, it does not matter whether the software is object oriented or function oriented however, if the testing is white box, then the test cases are determined based on the structure of the program. Testing classes is fundamentally different from testing functions as a function has a clearly defined input-output behavior while a class does not have an input-output behavior specification. Further a class cannot be tested directly; only an instance of class can be tested. This means that, we test a class indirectly by testing its instance. Further there is no sequential control flow with in a class like in functions. In a function, arguments, passed to the function with global data determine the path of execution within the procedure, but in an object, the state associated with object also influences the path of execution, and methods of a class can communicate each other among themselves through this state, because this state is persistent across invocation of methods. Hence, state of an object plays a major role in testing objects.
System testing:
System tests are designed to validate a fully developed system with a view to
assuring that it meets requirements. There are three kinds of system testing.
Alpha testing
63
Alpha testing refers to the system testing that its carried out by the customer with in the organization along with the developer. The alpha tests are conducted in a controlled manner.
Beta testing
Beta testing is the system testing performed by a select group customers .The developer is not present at the site and the user will inform the problems that are encountered. As a result of problems reported during the Beta test, the software developer makes the modifications and then prepares for release of the software to the customer.
Acceptance Testing
Acceptance Testing is the system testing performed by the customer to whether or not of accept the delivery of the system.
8.TECHNICAL NOTES
8.1 Introduction to AJAX:
Ajax, shorthand for Asynchronous JavaScript and XML, is a web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user makes a change. This is meant to increase the web page's interactivity, speed, and usability. 64
Prior to AJAX, any retrieval of data from the server required that the entire Web page be refreshed in the user's computer. As a result, systems were often designed with less interaction; for example, to have the user submit a form only at the end, after all fields were filled in. In contrast, AJAX systems can validate one or two items at a time "behind the scenes" without making the session cumbersome, especially over slow connections. AJAX, also known as "remote scripting," allows Web-based applications to be designed like LAN-based applications.
computers rather than just an unique server and network. taken from the server. Php
Instead of a user request being made of the server via, for example, a normal HTTP POST or GET request, such as would be made by submitting a form or clicking a hyperlink, an Ajax script makes a request of a server by using the JavaScript XMLHTTPRequest object. Although this object may be unfamiliar to many, in fact it behaves like a fairly ordinary JavaScript object. As you may well know, when using a JavaScript image object we may dynamically change the URL of the image source without using a page refresh. XMLHTTPRequest retrieves information from the server in a similarly invisible manner.
applications smaller, faster and more user friendly. AJAX is a web browser technology independent of web server software.
Defining Ajax:
66
Ajax isnt a technology. Its really several technologies, each flourishing in its own right, coming together in powerful new ways. Ajax incorporates: Standards-based presentation using XHTML and CSS; Dynamic display and interaction using the Document Object Model; Data interchange and manipulation using XML and XSLT; Asynchronous data retrieval using XMLHttpRequest and JavaScript binding
67
The traditional model for web applications (left) compared to the Ajax model (right).
This approach makes a lot of technical sense, but it doesnt make for a great user experience. While the server is doing its thing, whats the user doing? Thats right, waiting. And at every step in a task, the user waits some more. Obviously, if we were designing the Web from scratch for applications, we wouldnt make users wait around. Once an interface is loaded, why should the user interaction come to a halt every time the application needs something from the server? In fact, why should the user see the application go to the server at all?
68
true. Instead of loading a web page, at the start of the session, the browser loads an Ajax engine written in JavaScript and usually tucked away in a hidden frame. This engine is responsible for both rendering the interface the user sees and communicating with the server on the users behalf. The Ajax engine allows the users interaction with the application to happen asynchronously independent of communication with the server. So the user is never staring at a blank browser window and an hourglass icon, waiting around for the server to do something.
Every user action that normally would generate an HTTP request takes the form of a JavaScript call to the Ajax engine instead. Any response to a user action that doesnt require a trip back to the server such as simple data validation, editing data in memory, and even some navigation the engine handles on its own. If the engine needs something from the server in order to respond if its submitting data for processing, loading additional interface code, or
69
retrieving new data the engine makes those requests asynchronously, usually using XML, without stalling a users interaction with the application.
AJAX Interaction:
What makes AJAX-based clients unique is that the client contains page-specific control logic embedded as JavaScript technology. The page interacts with the JavaScript technology based on events such as the loading of a document, a mouse click, focus changes, or even a timer. AJAX interactions allow for a clear separation of presentation logic from the data. An HTML page can pull in bite-size pieces to be displayed. AJAX will require different serverside architecture to support this interaction model. Traditionally, server-side web applications have focused on generating HTML documents for every client event resulting in a call to the server. The clients would then refresh and re-render the complete HTML page for each response. Rich web applications focus on a client fetching an HTML document that acts as a template or container into which to inject content, based on client events using XML data retrieved from a server-side component. Some uses for AJAX interactions are the following: Real-time form data validation: Form data such as user IDs, serial numbers, postal codes, or even special coupon codes that require server-side validation can be validated in a form before the user submits a form. See Real-time Form Validation for details. Auto completion: A specific portion of form data such as an email address, name, or city name may be auto completed as the user types. Load on demand: Based on a client event, an HTML page can fetch more data in the background, allowing the browser to load pages more quickly. Sophisticated user interface controls and effects: Controls such as trees, menus, data tables, rich text editors, calendars, and progress bars allow for better user interaction and interaction with HTML pages, generally without requiring the user to reload the page.
Refreshing data and server push: HTML pages may poll data from a server for up-todate data such as scores, stock quotes, weather, or application-specific data. A client may use AJAX techniques to get a set of current data without reloading a full page. Polling is not the most efficient means of ensuring that data on a page is the most current. Emerging
70
techniques such as Comet are being developed to provide true server-side push over HTTP by keeping a persistent connection between the client and server. Partial submit: An HTML page can submit form data as needed without requiring a full page refresh. Mashups: An HTML page can obtain data using a server-side proxy or by including an external script to mix external data with your application's or your service's data. For example, you can mix content or data from a third-party application such as Google Maps with your own application. Page as an application: AJAX techniques can be made to create single-page applications that look and feel much like a desktop application. See the article on the use of AJAX and port lets for more on how you can use port let applications today. Though not all-inclusive, this list shows that AJAX interactions allow web applications to do much more than they have done in the past.
71
This form is the starting form of our application. A user enters his username and password and the role. If the user is identified as an administrator account holder then he will be navigated to the administrators welcome page. Else if he is a limited user, he will be navigated to the users home page.
72
This form is the administrators welcome page. This is the main page of the administrator giving him options of generating orders, customer details, company details. Not only these, but also he is provided with a powerful feature which makes him the administrator.
73
74
75
76
10.CONCLUSION
The main objective of the project is to build a nice multilevel, multiroom chat
77
11.BIBLIOGRAPHY
JSP
JAVA : Java Complete Reference by Patrick Naughton HTML : HTML Black Book by Steven Holzner UML : Unified Modeling Language by Ivar Jacobson, Rambaugh, Grady Booch. ORACLE : Oracle Press.
78