Crime Rate Prediction Based On K-Means-3
Crime Rate Prediction Based On K-Means-3
1.ABSTRACT
Crime rate is increasing now-a-days in many countries. In today's world with such higher
crime rate and brutal crime happening, there must be some protection against this crime. Here we
introduced a system by which crime rate can be reduced. Crime data must feed into the system.
We introduced data mining algorithm to predict crime. K-means algorithm plays an important
role in analyzing and predicting crimes. K-means algorithm will cluster co-offenders,
collaboration and dissolution of organized crime groups, identifying various relevant crime
patterns, hidden links, link prediction and statistical analysis of crime data. This system will
prevent crime occurring in society. Crime data is analyzed which is stored in the database. Data
mining algorithm will extract information and patterns from database. System will group crime.
Clustering will be done based on places where crime occurred, gang who involved in crime and
the timing crime took place. This will help to predict crime which will occur in future. Admin
will enter crime details into the system which is required for prediction. Admin can view
criminal historical data. Crime incident prediction depends mainly on the historical crime record
and various geospatial and demographic information.
2.INTRODUCTION
In present scenario criminals are becoming technologically sophisticated in committing
crime and one challenge faced by intelligence and law enforcement agencies is difficulty in
analysing large volume of data involved in crime and terrorist activities therefore agencies need
to know technique to catch criminal and remain ahead in the eternalrace between the criminals
and the law enforcement. Crooks are irritation for the general public in alledges of world for
quite a while now and measuresare required to destroy crimes from our reality. Ourmain goal is
to offer crime counteractive action application to keep open safe. Current policing techniques
work towards finding the culprits, essentially after the crime has happened. Be that as itmay,
with the assistance of innovative headway, wecan utilize notable crime data to perceive crime
examples and utilize these examples to anticipatecrimes already.We are utilizing clustering
calculations toanticipate crime-prone areas. There are manyclustering calculations to aggregate
the importantdata into wanted groups. The vast volumes of crimedatasets just as the multifaceted
nature of connections between these kinds of data have made criminology afitting field for
applying data mining systems.Criminology is a region that centers the logicalinvestigation of
crime and criminal conduct and law
3.SYSTEM ANALYSIS
EXISTING SYSTEM
Crime rates are rapidly changing and improved analysis finds hidden patterns of crime, if
any, without any explicit prior knowledge of these patterns. The main objectives of crime
analysis include: 1. Extraction of crime patterns by analysis of available crime and criminal data
2. Prediction of crime based on spatial distribution of existing data and anticipation of crime rate
using different data mining techniques 3. Detection of crime
Disadvantages
Users who don’t have internet connection can’t access the system.
Admin must enter correct records otherwise system will provide wrong information
PROPOSED SYSTEM
After literature review there is need to used an open source data mining tool which can be
implemented easily and analysis can be done easily. So here crime analysis is done on crime
dataset by applying k means clustering algorithm using rapid miner tool and that result to be
stored on web servers and shows the brief ideas about the analysis.
4.SYSTEM SPECIFICATION
Hardware Requirements
Software Requirements
5.MODULES
This module helps the owner to register those details and also include login details. This
module helps the owner to upload his file with encryption using RSA algorithm. This ensures the
files to be protected from unauthorized user.
This module includes the user registration login details. This module is used to help the
client to search the file using the multiple key words concept and get the accurate result list
based on the user query. The user is going to select the required file and register the user details
and get activation code in mail email before enter the activation code. After user can download
the Zip file and extract that file.
Encryption Module
This module is used to help the server to encrypt the document using RSA Algorithm and
to convert the encrypted document to the Zip file with activation code and then activation code
send to the user for download.
Multi-keyword Module
This module is used to help the user to get the accurate result based on the multiple
keyword concepts. The users can enter the multiple words query, the server is going to split that
query into a single word after search that word file in our database. Finally, display the matched
word list from the database and the user gets the file from that list.
6.ARCHITECTURAL DESIGN
Admin Login
Registration
Registration
Key Generate
Accept Request
Admin
Manager
File Upload
Report View
File Request
Data Base
7.IMPLEMENTATION ISSUES
The .NET Framework can be hosted by unmanaged components that load the common language
runtime into their processes and initiate the execution of managed code, thereby creating a
software environment that can exploit both managed and unmanaged features. The .NET
Framework not only provides several runtime hosts, but also supports the development of third-
party runtime hosts.
For example, ASP.NET hosts the runtime to provide a scalable, server-side environment
for managed code. ASP.NET works directly with the runtime to enable Web Forms applications
and XML Web services, both of which are discussed later in this topic.
Internet Explorer is an example of an unmanaged application that hosts the runtime (in
the form of a MIME type extension). Using Internet Explorer to host the runtime enables you to
embed managed components or Windows Forms controls in HTML documents. Hosting the
runtime in this way makes managed mobile code (similar to Microsoft® ActiveX® controls)
possible, but with significant improvements that only managed code can offer, such as semi-
trusted execution and secure isolated file storage.
The following illustration shows the relationship of the common language runtime and
the class library to your applications and to the overall system. The illustration also shows how
managed code operates within a larger architecture.
The common language runtime manages memory, thread execution, code execution, code
safety verification, compilation, and other system services. These features are intrinsic to the
managed code that runs on the common language runtime.
With regards to security, managed components are awarded varying degrees of trust, depending
on a number of factors that include their origin (such as the Internet, enterprise network, or local
computer). This means that a managed component might or might not be able to perform file-
access operations, registry-access operations, or other sensitive functions, even if it is being used
in the same active application.
The runtime enforces code access security. For example, users can trust that an
executable embedded in a Web page can play an animation on screen or sing a song, but cannot
access their personal data, file system, or network. The security features of the runtime thus
enable legitimate Internet-deployed software to be exceptionally featuring rich.
The runtime also enforces code robustness by implementing a strict type- and code-
verification infrastructure called the common type system (CTS). The CTS ensures that all
managed code is self-describing. The various Microsoft and third-party language compilers
generate managed code that conforms to the CTS. This means that managed code can consume
other managed types and instances, while strictly enforcing type fidelity and type safety.
In addition, the managed environment of the runtime eliminates many common software
issues. For example, the runtime automatically handles object layout and manages references to
objects, releasing them when they are no longer being used. This automatic memory
management resolves the two most common application errors, memory leaks and invalid
memory references.
The runtime also accelerates developer productivity. For example, programmers can
write applications in their development language of choice, yet take full advantage of the
runtime, the class library, and components written in other languages by other developers. Any
compiler vendor who chooses to target the runtime can do so. Language compilers that target the
.NET Framework make the features of the .NET Framework available to existing code written in
that language, greatly easing the migration process for existing applications.
While the runtime is designed for the software of the future, it also supports software of
today and yesterday. Interoperability between managed and unmanaged code enables developers
to continue to use necessary COM components and DLLs.
language of the system on which it is executing. Meanwhile, the memory manager removes the
possibilities of fragmented memory and increases memory locality-of-reference to further
increase performance.
The .NET Framework class library is a collection of reusable types that tightly integrate
with the common language runtime. The class library is Object Oriented, providing types from
which your own managed code can derive functionality. This not only makes the .NET
Framework types easy to use, but also reduces the time associated with learning new features of
the .NET Framework. In addition, third-party components can integrate seamlessly with classes
in the .NET Framework.
For example, the .NET Framework collection classes implement a set of interfaces that
you can use to develop your own collection classes. Your collection classes will blend
seamlessly with the classes in the .NET Framework.
As you would expect from an object-oriented class library, the .NET Framework types
enable you to accomplish a range of common programming tasks, including tasks such as string
management, data collection, database connectivity, and file access. In addition to these common
tasks, the class library includes types that support a variety of specialized development scenarios.
For example, you can use the .NET Framework to develop the following types of applications
and services:
Console applications.
Scripted or hosted applications.
Windows GUI applications (Windows Forms).
10
ASP.NET applications.
XML Web services.
Windows services.
For example, the Windows Forms classes are a comprehensive set of reusable types that
vastly simplify Windows GUI development. If you write an ASP.NET Web Form application,
you can use the Web Forms classes.
Another kind of client application is the traditional ActiveX control (now replaced by the
managed Windows Forms control) deployed over the Internet as a Web page. This application is
much like other client applications: it is executed natively, has access to local resources, and
includes graphical elements.
In the past, developers created such applications using C/C++ in conjunction with the
Microsoft Foundation Classes (MFC) or with a rapid application development (RAD)
environment such as Microsoft® Visual Basic®. The .NET Framework incorporates aspects of
these existing products into a single, consistent development environment that drastically
simplifies the development of client applications.
The Windows Forms classes contained in the .NET Framework are designed to be used
for GUI development. You can easily create command windows, buttons, menus, toolbars, and
other screen elements with the flexibility necessary to accommodate shifting business needs.
11
For example, the .NET Framework provides simple properties to adjust visual attributes
associated with forms. In some cases the underlying operating system does not support changing
these attributes directly, and in these cases the .NET Framework automatically recreates the
forms. This is one of many ways in which the .NET Framework integrates the developer
interface, making coding simpler and more consistent.
Unlike ActiveX controls, Windows Forms controls have semi-trusted access to a user's
computer. This means that binary or natively executing code can access some of the resources on
the user's system (such as GUI elements and limited file access) without being able to access or
compromise other resources. Because of code access security, many applications that once
needed to be installed on a user's system can now be safely deployed through the Web. Your
applications can implement the features of a local application while being deployed like a Web
page.
ASP.NET
ASP.NET is part of the whole. NET framework, built on top of the Common Language
Runtime (also known as the CLR) - a rich and flexible architecture, designed not just to cater for
the needs of developers today, but to allow for the long future we have ahead of us. What you
might not realize is that, unlike previous updates of ASP, ASP.NET is very much more than just
an upgrade of existing technology – it is the gateway to a whole new era of web development.
ASP.NET has been designed to try and maintain syntax and run-time compatibility with
existing ASP pages wherever possible. The motivation behind this is to allow existing ASP
12
Pages to be initially migrated ASP.NET by simply renaming the file to have an extension
of .aspx. For the most part this goal has been achieved, although there are typically some basic
code changes that have to be made, since VBScript is no longer supported, and the VB language
itself has changed.
Remove the dependency on script engines, enabling pages to be type safe and compiled.
Reduce the amount of code required to develop web applications.
Make ASP.NET well factored, allowing customers to add in their own custom functional-
ity, and extend/ replace built-in ASP.NET functionality.
Make ASP.NET a logical evolution of ASP, where existing ASP investment and therefore
code can be reused with little, if any, change.
Realize that bugs are a fact of life, as ASP.NET should be as fault tolerant as possible.
Benefits of ASP.NET
The .NET Framework includes a new data access technology named ADO.NET, an
evolutionary improvement to ADO. Though the new data access technology is evolutionary, the
classes that make up ADO.NET bear little resemblance to the ADO objects with which you
might be familiar. Some fairly significant changes must be made to existing ADO applications to
convert them to ADO.NET. The changes don't have to be made immediately to existing ADO
applications to run under ASP.NET, however.
ADO will function under ASP.NET. However, the work necessary to convert ADO
applications to ADO.NET is worthwhile. For disconnected applications, ADO.NET should offer
performance advantages over ADO disconnected record sets. ADO requires that transmitting and
receiving components be COM objects. ADO.NET transmits data in a standard XML-format file
so that COM marshaling or data type conversions are not required.
ActiveX
ActiveX application, called controls, are downloaded and executed by the Web browser,
like Java applets. Unlike Java applets, controls can be installed permanently when they are
downloaded; eliminating the need to download them again. ActiveX’s main advantage is that it
can do just about anything.
Several enterprising programmers have already used ActiveX to bring exciting new
capabilities to Web page, such as “the Web page that turns off your computer” and “the Web
page that formats disk drive”.
Fortunately, ActiveX includes a signature feature that identifies the source of the control
and prevents controls from being modified. While this won’t prevent a control from damaging
system, we can specify which sources of controls we trust.
ActiveX is proprietary.
14
ADO.NET
ADO.NET provides consistent access to data sources such as Microsoft SQL Server, as
well as data sources exposed via OLE DB and XML. Data-sharing consumer applications can
use ADO.NET to connect to these data sources and retrieve, manipulate, and update data.
ADO.NET cleanly factors data access from data manipulation into discrete components
that can be used separately or in tandem. ADO.NET includes .NET data providers for connecting
to a database, executing commands, and retrieving results. Those results are either processed
directly, or placed in an ADO.NET Dataset object in order to be exposed to the user in an ad-hoc
manner, combined with data from multiple sources, or remote between tiers. The ADO.NET
Dataset object can also be used independently of a .NET data provider to manage data local to
the application or sourced from XML.
Why ADO.NET?
As application development has evolved, new applications have become loosely coupled
based on the Web application model. More and more of today's applications use XML to encode
data to be passed over network connections. Web applications use HTTP as the fabric for
communication between tiers, and therefore must explicitly handle maintaining state between
requests. This new model is very different from the connected, tightly coupled style of
programming that characterized the client/server era, where a connection was held open for the
duration of the program's lifetime and no special handling of state was required.
In designing tools and technologies to meet the needs of today's developer, Microsoft
recognized that an entirely new programming model for data access was needed, one that is built
upon the .NET Framework. Building on the .NET Framework ensured that the data access
technology would be uniform—components would share a common type system, design
patterns, and naming conventions.
15
ADO.NET was designed to meet the needs of this new programming model:
disconnected data architecture, tight integration with XML, common data representation with the
ability to combine data from multiple and varied data sources, and optimized facilities for
interacting with a database, all native to the .NET Framework.
ADO.NET coexists with ADO. While most new .NET applications will be written using
ADO.NET, ADO remains available to the .NET programmer through .NET COM
interoperability services.
XML Support
XML and data access are intimately tied—XML is all about encoding data, and data
access is increasingly becoming all about XML. The .NET Framework does not just support
Web standards—it is built entirely on top of them.
16
confidently run today’s increasingly complex business applications. SQL Server 2005 allows
companies to gain greater insight from their business information and achieve faster results for a
competitive advantage.
The next major enhancement in SQL Server 2005 is the integration of a .NET compliant
language such as C#, ASP.NET or VB.NET to build objects (stored procedures, triggers,
functions, etc.). This enables you to execute .NET code in the DBMS to take advantage of
the .NET functionality. It is expected to replace extended stored procedures in the SQL Server
2000 environment as well as expand the traditional relational engine capabilities.
3. Service Broker
The Service Broker handles messaging between a sender and receiver in a loosely
coupled manner. A message is sent, processed and responded to, completing the transaction. This
greatly expands the capabilities of data-driven applications to meet workflow or custom business
needs.
4. Data encryption
SQL Server 2000 had no documented or publicly supported functions to encrypt data in a
table natively. Organizations had to rely on third-party products to address this need. SQL Server
2005 has native capabilities to support encryption of data stored in user-defined databases.
17
5. SMTP mail
Sending mail directly from SQL Server 2000 is possible, but challenging. With SQL
Server 2005, Microsoft incorporates SMTP mail to improve the native mail capabilities. Say
"see-ya" to Outlook on SQL Server!
6. HTTP endpoints
You can easily create HTTP endpoints via a simple T-SQL statement exposing an object
that can be accessed over the Internet. This allows a simple object to be called across the Internet
for the needed data.
MARS allow a persistent database connection from a single client to have more than one
active request per connection. This should be a major performance improvement, allowing
developers to give users new capabilities when working with SQL Server. For example, it allows
multiple searches, or a search and data entry. The bottom line is that one client connection can
have multiple active processes simultaneously.
If all else fails, stop the SQL Server service or push the power button. That mentality is
finished with the dedicated administrator connection. This functionality will allow a DBA to
make a single diagnostic connection to SQL Server even if the server is having an issue.
SSIS has replaced DTS (Data Transformation Services) as the primary ETL (Extraction,
Transformation and Loading) tool and ships with SQL Server free of charge. This tool,
completely rewritten since SQL Server 2000, now has a great deal of flexibility to address
complex data movement.
18
It's not expected to be released with SQL Server 2005 at the RTM in November, but I think this
feature has great potential. Database mirroring is an extension of the native high-availability
capabilities. So, stay tuned for more details….
Internet was originally established to meet the research needs of the U.S Defence
Industry. But it has grown into a huge global network serving universities, academic researches,
commercial interest and Government agencies, both in the U.S and Overseas. The Internet uses
TCP/IP protocols and many of the Internet hosts run the Unix Operating System.
HTML
HTML (Hyper Text Mark up Language) is the language that is used to prepare
documents for online publications. HTML documents are also called Web documents, and each
HTML document is known as Web page.
A page is what is seen in the browser at any time. Each Web site, whether on the Internet
or Intranet, is composed of multiple pages. And it is possible to switch among them by following
hyperlinks. The collection of HTML pages makes up the World Wide Web.
A web pages is basically a text file that contains the text to be displayed and references of
elements such as images, sounds and of course hyperlinks to other documents. HTML pages can
19
be created using simple text editor such as Notepad or a WYSIWYG application such as
Microsoft FrontPage.
In either case the result is a plain text file that computers can easily exchange. The
browser displays this text file on the client computer.
A web server is a program connected to the world wide web(www) that furnishes
resources from the web browser.
Microsoft IIS is a web server integrated with Windows.NET server that makes it easy to
publish information and bring business application to the web.
Because of its tight integration with windows NT server, IIS guarantees the network
administrator and application developer the same security, Networking and administrator
functionality as windows NT server. Above and beyond its use of familiar Windows NT server
Tools and functionality, IIS also has built-in capabilities to help administer secure
websites, and to develop server-intensive web application.
FEATURES OF IIS
IIS provides integrated security and access to a wide range of content, work seamlessly
with COM components, and has a graphical interface-the Microsoft Management Console
(MMC) –that you can use to create and manage your ASP application.
On the internet, most sites allow anybody to connect to the site. The exceptions are
commercialists where you pay a one time, monthly fee to access the site. Sites that are restrict
the access called secured site. Secured site use either integrated security or login, password
security. IIS support both of these methods.
20
All web servers can deliver HTML files, but they differ widely in how they treat other
types of content. Most servers let you add and modify Multi-purpose Internet Mail Extensions
(MMIE) types, but integrate directly into the windows registry. That means IIS natively
understands how to treat most common windows file format, such as text (TXT) files,
application initialization (INI) files, executable (EXE) files and many others
You can control many parts of IIS using COM>IIS exposes many of the server’s
configuration settings via the IIS Admin objects. These objects are accessible from ASP and
other languages. That means you can adjust server configuration and create virtual directories
and webs programmatically. IIS 4 and higher store settings and web information in a spoil
database called the Metaphase. You
IIS is a core product, which means that it is designed to work closely with many other
products, including all products in the Windows NT Server 4.0 Option pack. The following
figure shows the relationship between IIS and other products installed as part of the Windows
NT Server 4.0 Option pack.
ACCESS PRIVIEGES
IIS provides several new access levels. The following values can set the type of access
allowed to specific directories:
Read
21
Write
Script
Execute
Log Access
Directory Browsing.
IIS WEBSITE ADMINISTRATION
Administering websites can be time consuming and costly, especially for people who
manage large internet Service Provider (ISP) Installations. To save time and money Sip’s support
only large company web siesta the expense of personal websites. But is there a cost-effective
way to support both? The answer is yes; if you can automate administrative tasks and let users
administer their own sites from remote computers. This solution reduces the amount of time and
money it takes to manually administer a large installation, without reducing the number of web
sites supported.
With these technologies working together behind the scenes, the person can administers
sites from the command line of central computer and can group frequently used commands in
batch files.Then all user need to do is run batch files to add new accounts, change permissions,
add a virtual server to a site and many other tasks.
22
1) Problem/Requirement Analysis:
The process is order and more nebulous of the two, deals with understanding the
problem, the goal and constraints.
2) Requirement Specification:
Here, the focus is on specifying what has been found giving analysis such as
representation, specification languages and tools, and checking the specifications are
addressed during this activity.
The Requirement phase terminates with the production of the validate SRS
document. Producing the SRS document is the basic goal of this phase.
Role of SRS
23
specified. It forms the basis of software development. A good SRS should satisfy all
the parties involved in the system.
Product Perspective
The web pages (ASP) are present to provide the user interface on customer side
Communication between customer and server is provided through HTTP/HTTPS
protocols.
The Client Software is to provide the user interface on system user client side and for this
TCP/IP protocols are used.
24
On the Server Side web server is for EJB and database server is for storing the informa-
tion.
Software Interface
Developer Side:
Client Side:
Server side:
25
Hardware Interface
Developer side:
Client Side:
Server Side:
Communication Interface
Constraints
26
9.SYSTEM DESIGN
Systems design is the process or art of defining the architecture, components, modules,
interfaces, and data for a system to satisfy specified requirements. One could see it as the applic-
ation of systems theory to product development. There is some overlap and synergy with the dis -
ciplines of systems analysis, systems architecture and systems engineering.
UML stands for Unified Modeling Language. It is a third generation method for
specifying, visualizing and documenting the artifacts of an object oriented system under
development. Object modeling is the process by which the logical objects in the real world
(problem space) are represented (mapped) by the actual objects in the program (logical or a mini
world). This visual representation of the objects, their relationships and their structures is for the
ease of understanding. This is a step while developing any product after analysis.
The goal from this is to produce a model of the entities involved in the project which
later need to be built. The representations of the entities that are to be used in the product being
developed need to be designed.
Software design is a process that gradually changes as various new, better and more
complete methods with a broader understanding of the whole problem in general come into
existence.
27
Use case diagram consists of use cases and actors and shows the interaction between them.
The key points are:
The main purpose is to show the interaction between the use cases and the actor.
The use cases are the functions that are to be performed in the module.
Class Diagram
Class Diagram consists of the classes and the objects and the interaction between them. It
mainly deals with the interaction between classes in the system, their behavior and properties of
the system. Apart from classes this also provides inheritance relationships in the project. Class
diagrams consist of basically two parts: first one is the member variables and class variables and
the second part consists of the total number of methods available in the class.
, A data flow diagram is graphical tool used to describe and analyze movement of data
through a system. These are the central tool and the basis from which the other components are
developed. The transformation of data from input to output through processed, may be described
logically and independently of physical components associated with the system. These are
known as the logical data flow diagrams. The physical data flow diagrams show the actual
implements and movement of data between people, departments and workstations. A full
description of a system actually consists of a set of data flow diagrams. Using two familiar
notations Yourdon, Gane and Sarson notation develops the data flow diagrams. Each component
in a DFD is labeled with a descriptive name. Process is further identified with a number that will
28
be used for identification purpose. The development of DFD’S is done in several levels. Each
process in lower level diagrams can be broken down into a more detailed DFD in the next level.
The top-level diagram is often called a “context diagram”.
Context Diagram
It contains a single process, but it plays a very important role in studying the
current system. The context diagram defines the system that will be studied in the sense that it
determines the boundaries. Anything that is not inside the process identified in the context
diagram will not be part of the system study. It represents the entire software element as a single
bubble with input and output data indicated by incoming and outgoing arrows respectively.
A DFD is also known as a “bubble chart” has the purpose of clarifying system
requirements and identifying major transformations that will become programs in system design.
So it is the starting point of the design to the lowest level of detail. A DFD consists of a series of
bubbles joined by data flows in the system.
DFD SYMBOLS
Data Flow
Data Store
Constructing a DFD
1. Process should be named and numbered for an easy interface. Each name should be rep-
resentative of the process.
2. The direction of flow is from top to bottom and from left to right. Data traditionally flow
from source to the destination although they may flow back to the source. One way to in -
dicate this is to draw long flow line back to a source. An alternative way is to repeat the
source symbol as a destination. Since it is used more than once in the DFD it is marked
with a short diagonal.
3. When a process is exploded into lower level details, they are numbered.
4. The names of data stores and destinations are written in capital letters. Process and
dataflow names have the first letter of each work capitalized.
A DFD typically shows the minimum contents of data store. Each data store
should contain all the data elements that flow in and out.
30
Questionnaires should contain all the data elements that flow in and out.
Missing interfaces redundancies and like is then accounted for often through interviews.
1. Physical DFD
Structured analysis states that the current system should be first understand
correctly. The physical DFD is the model of the current system and is used to ensure that the
current system has been clearly understood. Physical DFDs shows actual devices, departments,
and people etc., involved in the current system
2. Logical DFD
Logical DFDs are the model of the proposed system. They clearly should show the
requirements on which the new system should be built. Later during design activity this is taken
as the basis for drawing the system’s structure charts.
31
Process
2. No process can have only inputs. If an object has only inputs than it must be a sink.
Data Store
1. Data cannot move directly from one data store to another data store, a process must move
data.
2. Data cannot move directly from an outside source to a data store, a process, which re-
trieves, must move data from the source and place the data into data store.
Level 0
LOGIN
Login
Each
User Access for Website
with His Specific
Details
32
Activity Diagram
Activity diagrams provide a way to model the workflow of a business process. You can
also use activity diagrams to model code-specific information such as a class operation. Activity
diagrams are very similar to a flowchart because you can model a workflow from activity to
activity.
You can use the following tools on the activity diagram toolbox to model activity diagrams:
Activities
Decisions
End state
Object
Object Flow
Start states
States
Swim lanes
Synchronizations
Transmissions
33
10.DATABASE DESIGN
NORMALIZATION
Normalization
Normalization is built around the concept of normal forms. A relation is said to be
in a particular normal form if it satisfies a certain specified set of constraints on the kind of
functional dependencies that could be associated with the relation. The normal forms are used to
ensure that various types of anomalies and inconsistencies are not introduced into the database.
A relation R is in first normal form if and only if all underlying domains contained
atomic values only.
34
35
11.TESTING
Testing is a process, which reveals errors in the program. It is the major quality measure
employed during software development. During testing, the program is executed with a set of
conditions known as test cases and the output is evaluated to determine whether the program is
performing as expected.
In order to make sure that the system does not have errors, the different levels of testing
strategies that are applied at differing phases of software development are:
Levels of Testing
TYPES OF TESTING
36
Unit Testing
Unit Testing is done on individual modules as they are completed and become executable. It is
confined only to the designer's requirements.
In this strategy some test cases are generated as input conditions that fully execute all
functional requirements for the program. This testing has been uses to find errors in the
following categories:
In this the test cases are generated on the logic of each module by drawing flow
graphs of that module and logical decisions are tested on all the cases.
It has been uses to generate the test cases in the following cases:
Integrating Testing
37
Integration testing ensures that software and subsystems work together as a whole. It tests
the interface of all the modules to make sure that the modules behave properly when integrated
together.
System Testing
Involves in-house testing of the entire system before delivery to the user. Its aim is to
satisfy the user the system meets all requirements of the client's specifications.
Acceptance Testing
It is a pre-delivery testing in which entire system is tested at client's site on real world data
to find errors.
Validation
The system has been tested and implemented successfully and thus ensured that all the
requirements as listed in the software requirements specification are completely fulfilled. In case
of erroneous input corresponding error messages are displayed.
Compilation Test
It was a good idea to do our stress testing early on, because it gave us time to fix some
of the unexpected deadlocks and stability problems that only occurred when components were
exposed to very high transaction volumes.
Execution Test
This program was successfully loaded and executed. Because of good programming there
was no execution error.
Output Test
The successful output screens are placed in the output screens section above.
38
12.SOURCE CODE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MobileLocationAlert
{
public partial class TaskLocation : System.Web.UI.Page
{
MobileLocationEntities db = new MobileLocationEntities();
protected void Page_Load(object sender, EventArgs e)
{
39
TextBox1.Text = "";
TextBox2.Text = "";
DropDownList1.SelectedIndex = -1;
}
}
else
{
var result = db.InsertLocation(TextBox1.Text, TextBox2.Text,
Convert.ToInt32(UserID), false, false, DropDownList1.SelectedItem.Text);
if (result != null)
{
Page.ClientScript.RegisterStartupScript(GetType(), "", "alert('Product Delivery
Pending');", true);
TextBox1.Text = "";
TextBox2.Text = "";
DropDownList1.SelectedIndex = -1;
}
}
}
}
<!DOCTYPE html>
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
<title><%: Page.Title %> - My ASP.NET Application</title>
40
<asp:PlaceHolder runat="server">
<%: Scripts.Render("~/bundles/modernizr") %>
</asp:PlaceHolder>
<webopt:BundleReference runat="server" Path="~/Content/css" />
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
<asp:ContentPlaceHolder runat="server" ID="HeadContent" />
<style type="text/css">
.auto-style1 {
color: #0033CC;
}
</style>
</head>
<body>
<form runat="server">
<asp:ScriptManager runat="server">
<Scripts>
<%--Framework Scripts--%>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="jquery.ui.combined" />
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web"
Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web"
Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web"
Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Assembly="System.Web"
Path="~/Scripts/WebForms/GridView.js" />
41
</Scripts>
</asp:ScriptManager>
<header>
<div class="content-wrapper">
<div class="float-left">
<p class="site-title">
<a runat="server" href="~/" class="auto-style1">Mobile Location Alert Using Web
Based</a>
</p>
</div>
<div class="float-right">
<section id="login">
<asp:LoginView runat="server" ViewStateMode="Disabled" Visible="false">
<AnonymousTemplate>
<ul>
<li><a id="registerLink" runat="server"
href="~/Account/Register.aspx">Register</a></li>
<li><a id="loginLink" runat="server" href="~/Account/Login.aspx">Log
in</a></li>
42
</ul>
</AnonymousTemplate>
<LoggedInTemplate>
<p>
Hello, <a runat="server" class="username" href="~/Account/Manage.aspx"
title="Manage your account">
<asp:LoginName runat="server" CssClass="username" /></a>!
<asp:LoginStatus runat="server" LogoutAction="Redirect"
LogoutText="Log off" LogoutPageUrl="~/" />
</p>
</LoggedInTemplate>
</asp:LoginView>
</section>
<nav>
<ul id="menu">
<li><a id="A1" runat="server" href="TaskLocation.aspx">Task
Location</a></li>
<li><a id="A2" runat="server" href="UserDetails.aspx">View User
Details</a></li>
<li><a id="A3" runat="server" href="TaskDetails.aspx">Location
Status</a></li>
<li><a id="A4" runat="server" href="UserLogin.aspx">Logout</a></li>
</ul>
</nav>
</div>
</div>
</header>
<div id="body">
<asp:ContentPlaceHolder runat="server" ID="FeaturedContent" />
<section class="content-wrapper main-content clear-fix">
43
namespace MobileLocationAlert
{
public partial class TaskDetails : System.Web.UI.Page
{
MobileLocationEntities db = new MobileLocationEntities();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetLocation();
44
}
}
public void GetLocation()
{
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MobileLocationAlert
{
public partial class Track : System.Web.UI.Page
{
45
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
return dt;
}
}
}
}
}
}
46
</SeparatorTemplate>
</asp:Repeater>
];
</script>
47
<script type="text/javascript">
window.onload = function () {
var mapOptions = {
center: new google.maps.LatLng(markers[0].lat, markers[0].lng),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var infoWindow = new google.maps.InfoWindow();
var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions);
for (i = 0; i < markers.length; i++) {
var data = markers[i]
var myLatlng = new google.maps.LatLng(data.lat, data.lng);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: data.title
});
(function (marker, data) {
google.maps.event.addListener(marker, "click", function (e) {
infoWindow.setContent(data.description);
infoWindow.open(map, marker);
});
})(marker, data);
}
}
</script>
<div id="dvMap" style="width: 500px; height: 500px">
</div>
</form>
48
</body>
</html>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<div>
<div>
<center>
<table class="auto-style2">
<tr>
<td class="auto-style3" colspan="3"><strong>Registration</strong></td>
</tr>
<tr>
<td>FirstName</td>
<td>
<asp:TextBox ID="txtFirstName" runat="server" Width="201px"></asp:TextBox>
</td>
<td> </td>
</tr>
<tr>
<td>LastName</td>
<td>
49
50
51
</div>
</asp:Content>
<asp:Content ID="Content1" runat="server" contentplaceholderid="HeadContent">
<style type="text/css">
.auto-style2 {
width: 53%;
height: 515px;
}
.auto-style3 {
font-size: x-large;
text-align: center;
}
</style>
</asp:Content>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MobileLocationAlert
{
public partial class _Default : Page
{
MobileLocationEntities db = new MobileLocationEntities();
protected void Page_Load(object sender, EventArgs e)
52
throw;
}
}
}
53
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
width: 367px;
height: 338px;
margin-left: 504px;
background-color: #EFEFF2;
}
.auto-style2 {
height: 182px;
}
.auto-style3 {
font-weight: 700;
}
</style>
</head>
<body class="auto-style1">
<p>
<br />
</p>
<p>
<strong>
FIND LATITUDE AND LONGITUDE</strong><br />
54
</p>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?
sensor=false"></script>
<script>
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
document.getElementById("Label1").value = "Geolocation is not supported by this
browser.";
}
}
function showPosition(position) {
document.getElementById("TextBox1").value = position.coords.latitude
document.getElementById("TextBox2").value = position.coords.longitude;
}
</script>
<%--<button onclick="getLocation()">Try It</button>--%>
<form id="form1" runat="server">
<div class="auto-style2">
Latitude <asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
<br />
<br />
Longitude
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
55
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Get Current Location"
OnClientClick="getLocation();return false;" CssClass="auto-style3" />
<br />
<br />
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
</div>
</form>
</body>
</html>
56
namespace MobileLocationAlert
{
public partial class TaskDetails : System.Web.UI.Page
{
MobileLocationEntities db = new MobileLocationEntities();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetLocation();
}
}
public void GetLocation()
57
58
13.SCREENSHOT
59
60
61
62
63
64
65