Voting

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 56

1.

INTRODUCTION

“ONLINE VOTING SYSTEM” is an online voting technique. In this system


people, who have citizenship of India and whose age is above 18 years of age and any
sex can give his\her vote online without going to any physical polling station. There is
a database, which is maintained in which all the names of voters with complete
information is stored.

In “ONLINE VOTING SYSTEM” a voter can use his\her voting right online
without any difficulty. He\She has to be registered first for him/her to vote.
Registration is mainly done by the system administrator for security reasons. The
system Administrator registers the voters on a special site of the system visited by him
only by simply filling a registration form to register voter. Citizens seeking
registration are expected to contact the system administrator to submit their details.
After the validity of them being citizens of India has been confirmed by the system
administrator by comparing their details submitted with those in existing databases
such as those as the Registrar of Persons, the citizen is then registered as a voter.

India is a constitutional democracy with a parliamentary system of


government, and at the heart of the system is a commitment to hold regular, free and
fair elections. These elections determine the composition of the government, the
membership of the two houses of parliament, the state and union territory legislative
assemblies, and the Presidency and vice-presidency. Elections are conducted
according to the constitutional provisions, supplemented by laws made by Parliament.

The aim of the project is to create and manage polling and election details.
This is a system which enables all citizens to cast their vote online. Increasing the
voting percentage across the country is the major goal of this project. People have to
visit the booth to cast their vote in the present system across the country. This system
is online and hence even people who live out of their home town can also vote.
Database of all the eligible citizens and candidates are maintained by the system.

Online voting system gathers its own significance since the NRI voting Rights
bill have been passed by the parliament on Feb 11 ,2011. . The new law will allow an

1
Indian citizen residing abroad to enrol in voter’s list and exercise his franchise even if
he or she remained away from place of residence in India for more than six months
owing to employment, education or otherwise. In the present case the person should
be present within the constituency on the day of polling for exercising his right to
vote.

After registration, the voter is assigned a secret Voter ID with which he/she
can use to log into the system and enjoy services provided by the system such as
voting. If invalid/wrong details are submitted, then the citizen is not registered to vote.
In “ONLINE VOTING SYSTEM” a voter can use his\her voting right online without
any difficulty. He\She has to fill a registration form to register himself\herself. All the
entries is checked by the DATABASE which has already all information about the
voter. If all the entries are correct then a USER ID and PASSWORD is given to the
voter, by using that ID and PASSWORD he\she can use his\her vote. If conditions are
wrong then that entry will be discarded.

1.1 PROBLEM DEFINITION

The ONLINE VOTING SYSTEM-INDIA shall reduce the time spend


making long queues at the polling stations during voting. It shall also enable the voters
to vote from any part of the globe as explained since this is an online application
available on the internet. Cases of vote miscounts shall also be solved since at the
backend of this system resides a well-developed database using MYSQL that can
provide the correct data once it’s correctly queried. Since the voting process shall be
open as early as possible, the voters shall have ample time to decide when and whom
to vote for.

1.2. FEASIBILITY STUDY

A feasibility study is a high-level capsule version of the entire System


analysis and Design Process. The study begins by classifying the problem definition.
Feasibility is to determine if it’s worth doing. Once an acceptance problem definition
has been generated, the analyst develops a logical model of the system. A search for
alternatives is analysed carefully.

2
Depending on the results of the initial investigation the survey is now
expanded to a more detailed feasibility study. “FEASIBILITY STUDY” is a test of
system proposal according to its workability, impact of the organization, ability to
meet needs and effective use of the resources. It focuses on these major questions:

1. What are the user’s demonstrable needs and how does a candidate system
meet them?
2. What resources are available for given candidate system?
3. What are the likely impacts of the candidate system on the organization?
4. Whether it is worth to solve the problem?

3
2 . SYSTEM REQUIREMENTS

2.1 HARDWARE REQUIREMENTS:

Processor : Intel core i3-5005U

Mother Board : Intel 945G Express Chipset

RAM : 4 GB

Hard Disk : 500 GB

Monitor : 17”inch CRT(IBM)

Keyboard : 104 Keys

Mouse : 3 buttons

2.2 SOFTWARE REQUIREMENTS:

Operating system : Windows 8

Front End : PHP

Back End : MYSQL

Software : XAMPP

4
3. SYSTEM DESCRIPTION

3.1 PROJECT DESCRIPTION

The project consists of two modules.

Modules

• Admin
• User
Admin Module
Administrator interface consists of a login name and unique password using
which admin can login into the Online Voting System. Administrator has the main
control of the system. By logging into the page it can perform the following tasks. The
admin can add the list of candidates in the election. It includes candidates name,
address, gender, party, party symbol etc. The candidates will be added to the list only
after completing the procedures. The voters can be added to the database. The voters
have also the privilege to check the voters list from the homepage. The voter’s details
includes name, address, gender, age, constituency, image etc. The election to be
conducted is selected. To add an election the constituency should be selected and
termination date of election should be specified. The constituency that is going to
conduct election should be selected. We can view the voters list. Each constituency
will be having separate voters list. The list of candidates participating in the election
can be seen. It includes the candidates name, party name and party symbol.

User Module
User interface consists of a login name and unique password using which
he/she can login into the Online Voting System. This will be supplied by the
administrator to the user. Once the user has logged in, he has the privilege to view the
names of the candidates listed by the administrator, view the results after the
termination date of the election. This facilitates the voter to view the candidate names,
the constituency name, their symbol and their party name.

5
This provides the voter with a list of candidate with in his/her constituency along
with selection option (radio button) to select the preferred candidate from the list. If
the voting date is before termination date, the vote goes valid else goes invalid. This
provides graphical and user friendly representation of the votes obtained by each
candidate. It includes the percentage of the votes obtained by each candidate. But the
result can be viewed only after the termination date of the election. This provides an
option for the voter to quit the session, while in the voter home page.

3.2 SOFTWARE DESCRIPTION


The whole project is created by the back end language namely MySQL. The
front end is PHP. The back end language provides the database facilities for the front
end. The back end stores the whole project to the database.

PHP:

The full form of PHP is Hypertext Preprocessor. It was abbreviated previously as


Personal Home Page. It is a programming language widely used to build web
applications or websites. It is the server-side scripting language encoded with HTML
to develop Dynamic website. Static website or Web applications. It was developed in
1994 by Rasmus Lerdorf. PHP’s syntax is analogous to C,C++,and Java. It handles
dynamic websites, dynamic content, cookie database, session, etc.

The websites such as www.yahoo.com and www.facebook.com are developed


on PHP. It can easily be integrated with HTML files and you can even write HTML
codes in PHP script. The main difference between PHP and HTML is HTML codes
are rendered on the browser directly whereas PHP codes are executed on the server.
Initially, PHP codes are executed on a server and the result is transferred to the
browser afterwards. The only data that the browser or client understands is the result
restored after running the PHP code on the server but not the actual PHP script present
in the PHP file. The PHP can also support Java script and CSS like client-side
scripting languages.

6
Specification of PHP

• PHP design is simple since libraries like C or C++ are not used. It
contains plenty of predefined functions to protect you information.
• It is an open source language so that it can be freely downloaded.
• In addition to session management features ,PHP 4.0 uses resource
allocation mechanisms and object –oriented programming.It removes
the unnecessary allocation of memory.

MySQL

MySQL tutorial provides basic and advanced concepts of MySQL. Our

MySQL tutorial is designed for beginners and professionals. MySQl is a relational


database management system used on the Structured Query Language, which is very
popular language for accessing Structured Query Language.

MySQL is currently the most popular database management system software


used for managing the relational database. It is a open source database software,
which is supported by Oracle Company. It is fast, scalable, and easy to use database
management system in comparision with Microsoft SQL Server and Oracle Database.
It is commonly used in conjunction with PHP scripts for creating powerful and
dynamic server-side or web-based enterprise applications. It is developed by,
marketed and supported by MySQL AB, a Swedish company and written in C and
C++ programming languages.

7
4. SYSTEM ANALYSIS AND DESIGN

4.1 SYSTEM ANALYSIS


System analysis is the process of gathering and interpreting facts, diagnosing
problems and using the information to recommend improvements on the system.
System analysis is a problem solving activity that requires intensive communication
between the system users and system developers.

Analysis is the focus of system developing and is the stage when system
designers have to work at two levels of definition regarding the study of situational
issues and possible solutions in terms of “what to do” and “how to do”.

System Analysis is a process by which we attribute process or goals to a human


activity, determine how well those purpose are being achieved and specify the
requirements of the various tools and techniques that are to be used within the system
if the system performances are to be achieved.

System analysis or study is an important phase of any system development


process. The system is viewed as a whole, the inputs are identified and the system is
subjected to close study to identify the problem areas. The solutions are given as a
proposal. The proposal is reviewed on user request and suitable changes are made.
This loop ends as soon as the user is satisfied with the proposal.

A detailed study of the process must be by various techniques like interviews,


questionnaires etc. The data collected by these sources must be scrutinized to arrive to
a conclusion. The conclusion is an understanding of how the system functions. This
system is called existing system.

Now the existing system is subjected to close study and problem areas are
identified. The designer now functions as a problem solver and tries to sort out
difficulties that the enterprise faces. The solutions are given as proposals.

8
4.1.1 EXISTING SYSTEM

In the present system there is no such application level system provisions in


the country to carry out the voting and procedure as a whole. Also in the present
status, there is no such application in use for automated system for voting according to
the voting structure existing in the country. All the step by step procedures are carried
out by the authorized authorities according to the jobs assigned by the ECI. The fact is
all the procedures are carried out manually, starting from the registration process to
result publishing.

The government to do this process manually wastes a lot of time and money. Thus the
present system proves itself to be an inefficient one. The existing system is not web
based. The user or person must want to go to the polling station for casting their votes.

4.1.2 PROPOSED SYSTEM

The new implemented voting protocol has two main players: The voter and
administrator sections. The voter(which can be found at home, in a working station, in
a special polling station or any other device have the function of performing the
Authentication and voting).The administrator performs the function of voter and
candidate registration, authorization and validation of voter, database and counting
and the result.

Furthermore it is assumed that a trustworthy Administrator is available. Apart


from that, the accessibility to the public in the voting procedure plays a special role,
which means that the voting result can be monitored, although casting of the votes has
to be secret as a matter of course. Accessibility to the public is necessary for all
voting stages and is performed by the electoral committee, but also by any member of
the public. ELECTION COMMISION OF INDIA can change the information any
time if required. Registration of the Voter depends upon the information filled by the
user and Voter is given a unique ID and PASSWORD. In the DATABASE
information of every voter is stored and Database shows the information of every user.

9
4.1.3 SYSTEM FLOW CHART

A system flow chart is a physical design tool that shows in general terms the
operations that will be performed on information in an information system. The
arrows on a system flowchart show the direction that data will flow in around the
system rather that the order in which the operations will be carried out.

System Admin User View user details View user score View user rank Select
subject Attend quiz View quiz questions View score.

Online Voting System

Admin User

view user details caste vote

view vote view user details

Candidate details
update profile

update profile

10
4.1.4 DATA FLOW DIAGRAMS

Data flow diagrams (DFD) was first developed by LARRY CONSTANTINE as


way representing system requirements in a graphical form; this lead to modular
design. A DFD describes what data flow (logical) rather than how they are processed,
so it does not depend on hardware, software, data structure or file organization. It is
also known as 'bubble chart'.

A Data Flow Diagrams is a structured analysis and design tool that can be used
for flowcharting in place of, or in association with, information-oriented and process-
oriented systems flowcharts. A DFD is a network that describes the flow of data and
the processes that change, or transform, data throughout a system. This network is
constructed by using a set of symbols that do not imply a physical implementation.
Data flow diagrams (DFD) was first developed by LARRY CONSTANTINE as way
representing system requirements in a graphical form; this lead to modular design. It
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 phase that functionality decomposes the requirement specifications down
to the lowest level of detail.

The symbols used to prepare DFD do not imply a physical implementation, a


DFD can be considered to an abstract of the logic of an information-oriented or a
process-oriented system flow-chart.

Online
Admin Voter
Voting

Level 0 DFD

11
Election Master

Level 1 DFD

4.1.5 ER DIAGRAM

An entity-relationship diagram (ERD) is a data modelling technique that


graphically illustrates an information system’s entities and the relationships between
those entities. An ERD is a conceptual and representational model of data used to
represent the entity framework infrastructure. ER diagrams are most often used to
design or debug relational databases in the fields of software engineering, education
and research. To avoid ruining the data in a production database, it is important to
plan out the changes carefully. ERD is a tool that helps. By drawing ER diagrams to

12
visualize database design ideas, you have a chance to identify the mistakes and
designs flows to make these corrections.

13
4.2 SYSTEM DESIGN
Design is the first step into the development phase for any engineered product
or system. Design is a creative process. A good design is the key to effective system.
The term “design” is defined as “the process of applying various techniques and
principles for the purpose of defining a process or a system in sufficient detail to
permit its physical realization”. It may be defined as a process of applying various
techniques and principles for the purpose of defining a device, a process or a system in
sufficient detail to permit its physical realization.

Software design sits at the technical kernel of the software engineering process
and is applied regardless of the development paradigm that is used. The system design
develops the architectural detail required to build a system or product. As in the case
of any systematic approach, this software too has undergone the best possible design
phase fine tuning all efficiency, performance and accuracy levels.

The design phase is a transition from a user oriented document to a document


to the programmers or database personnel. System design goes through two phases of
development: Logical and Physical design.

4.2.1 INPUT DESIGN

Input design is the link that ties the information system into the world of its
users. It comprises the developing specification and procedures for data preparation
and those steps are necessary to put transaction data in to a usable form for processing
can be achieved by inspecting the computer to read data from a written or printed
document or it can occur by having people keying the data directly into the system.

The input design involves determining the inputs, validating the data,
minimizing the data entry and provides a multi-user facility. Inaccurate inputs are the
most common cause of errors in data processing. Errors entered by the data entry
operators can be controlled by input design. The user-originated inputs are converted
to a computer based format in the input design. Input data are collected and organized

14
into groups of similar data. Once identified, the appropriate input media are selected
for processing.

USER REGISTRATION
First Name
Last Name
Password
Photo

Register Close

CANDIDATE REGISTRATION
First Name
Last Name
Password
Photo
Platform

Register Close

USER LOGIN
Voter id
Password

Sign in

ADMIN LOGIN
Name
Password

Sign in

15
VOTING FORM
Select One Candidate
Mohan
John
Frank
Ram

Preview Submit

4.2.2 DATABASE DESIGN

A database is an organized mechanism that has the capability of storing


information through which a user can retrieve stored information in an effective and
efficient manner. The data is the purpose of any database and must be protected.

The database design is a two level process. In the first step, user
requirements are gathered together and a database is designed which will meet these
requirements as clearly as possible. This step is called Information Level Design and it
is taken independent of any individual DBMS.

In the second step, this Information level design is transferred into a design
for the specific DBMS that will be used to implement the system in question. This
step is called Physical Level Design, concerned with the characteristics of the specific
DBMS that will be used.

A database design runs parallel with the system design. The organization of
the data in the database is aimed to achieve the following two major objectives:

▪ Data Integrity.
▪ Data independence.

16
Admin Table

Candidates Table

Positions Table

17
Votes Table

Voters Table

4.2.3 OUTPUT DESIGN

A Design Output is a drawing or specification or manufacturing instruction.


Design outputs describe all the components, parts, and pieces that go into your
medical device. Device Outputs describe all assemblies and subassemblies of your
product.

Objectives of Output Design:

The objectives of input design are:

❖ Design output to fit the user.


❖ Delivering the appropriate quantity of output.
❖ Making sure the output is where it is needed.
❖ Providing the output on time.
❖ Choosing the right output method.

18
USER REGISTRATION
User_id Voters_id Password fname lname Photo

CANDIDATE REGISTRATION
Candidate_id Position_id Platform fname lname Photo

ADMIN LOGIN
id Username Password fname lname Created Photo
on

POSITIONS
Position_ id Description Max_vote priority

RESULT
Vote_id Voters_id Candidate_id Position_id

19
5. SYSTEM CODING AND IMPLEMENTATION

Systems implementation is the process of defining how the information


System should be built, ensuring that the information system is operational and used,
ensuring that the information system meets quality standard.

Methods of implementation

There are many ways of implementing a new system. The method chosen
will depend on the organization and the type of system being implemented. Methods
of implementing systems include:

• direct cutover

• parallel

• phased

• pilot

Implementation is a process of ensuring that the information system is operational. It


involves

• Constructing a new system from scratch.

• Constructing a new system from the existing one.

• Implementation allows the users to take over its operation for use and
evaluation. It involves training the users to handle the system and plan for a
smooth conversion.

Goals of System Implementation:

❖ Complete as necessary the design contained in the approved system design


document. For example, the detailed contents of new or revised documents,
computer screens, and database must be laid out and created.
❖ Write, test and document the programs and procedures required by the
approved system design document.
20
❖ Ensure by completing the preparation of user manuals and other documentation
and by training personnel, that the organization’s personnel can operate the
new system.
❖ Determine, by thoroughly testing the system with users, that the system
satisfies the users requirement.

5.1 SYSTEM CODING


Coding is a list of step-by-step instructions that get computers to do what you
want them to do. Coding makes it possible for us to create computer software, games,
apps and websites. Coders or programmers are people who write the program behind
everything we see and do on a computer. Code, in a general sense, is the language
understood by computer. Computers don’t understand natural language. As such the
human language has to be converted into a set of “words” that are understood by the
computer. The words that initiate a standard action when used in a program are called
keywords. The arrangement of keywords for successful execution of a desired
computation is called syntax. The set of keywords and syntax form a programming
language.
The term code by itself is so general that it doesn’t convey much information. It
can be useful to think of code in terms of instructions versus data. That is, computer
code uses data as input does some processing then spits out the output. In addition to
referring to the code itself, you can use the terms as a verb – to code is synonymous
with coding or programming.
In this project consists of two main modules for user and admin. They contains
several files. Each file has the specific work for the module.
The user module contains the following pages:
• home.php
• index.php
• login.php
• logout.php
• ballot submit.php
• preview.php
21
home.php :
It displays the user’s home page.
index.php :
This page displays the registration for new user. The user must enter his/her user
name and password. These details should be stored in Registration table in the
database.
login.php :
It is the login page for registered user. The registered users can using the user
name and password to login this page.
ballot submit.php :
This page displays the ballot menu. Once the login is successfully finished, the
user can choose the candidate and then click submit.
Logout.php :
After casting the vote the user must logout using the logout button. The admin
module contains the following pages:
• ballot.php
• candidates.php
• positions.php
• voters.php
• votes.php
• login.php
voters.php:
This displays the registered users details. The data will be read from the
Registration table in the database. The user name, password and will be displayed.
votes.php:
This displays the users votes. The data will be read from the voter table in the
database. It displays the overall vote and particular score.
ballot.php:
This displays the position for each candidate. The data will be read from the
vote table in the database. The position will be displayed.

22
candidate.php :
This displays the candidate list. The data will be read from the candidate table
in the database.

5.2 SYSTEM TESTING


System Testing is the process of executing software in a controlled manner.
Software testing is often used in association with the terms verification and validation.
Validation is the checking or testing of items, includes software, for conformance and
consistency with an associated specification. Software testing is just one kind of
verification, which also uses techniques such as reviews, analysis, inspections, and
walkthroughs. Validation is the process of checking that what has been specified is
what the user actually wanted.
Testing is a set of activity that can be planned in advanced and conducted
systematically. Testing begins at the module level and work towards the integration of
entire computers based system. Nothing is complete without testing, as it vital success
of the system testing objectives, there are several rules that can serve as testing
objectives.
Testing is a process of executing a program with the intend of finding an
error. A good test case is one that has high possibility of finding an undiscovered
error. A successful test is one that uncovers an undiscovered error. System testing is
performed on the entire system in the context of either functional requirement
specifications (FRS) or system requirement specification (SRS), or both.
System testing tests not only the design, but also the behaviour and even the
believed expectations of the customer. It is also intended to test up to beyond the
bounds defined in the software or hardware requirements specification.
There are three ways to test a program:
• For correctness
• For implementation efficiency
• For computational complexity

23
UNIT TESTING
Unit testing focuses verification effort on the smallest unit of software design –
the software component or module. Using the component level design description as a
guide, important control paths are tested to uncover errors within the boundary of the
module. The relative complexity of tests and uncovered scope established for unit
testing. The unit testing is white-box oriented, and step can be conducted in parallel
for multiple components. The modular interface is tested to ensure that information
properly flows into and out of the program unit under test. The local data structure is
examined to ensure that data stored temporarily maintains its integrity during all steps
in an algorithm’s execution. Boundary conditions are tested to ensure that all
statements in a module have been executed at least once. Finally, all error handling
paths are tested.
Tests of data flow across a module interface are required before any other test
is initiated. If data do not enter and exit properly, all other tests are moot. Selective
testing of execution paths is an essential task during the unit test. Good design dictates
that error conditions be anticipated and error handling paths set up to reroute or
cleanly terminate processing when an error does occur. Boundary testing is the last
task of unit testing step. Software often fails at its boundaries.
Unit testing was done in Sell-Soft System by treating each module as separate
entity and testing each one of them with a wide spectrum of test inputs. Some flaws in
the internal logic of the modules were found and were rectified.

INTEGRATION TESTING
Integration testing is systematic technique for constructing the program
structure while at the same time conducting tests to uncover errors associated with
interfacing. The objective is to take unit tested components and build a program
structure that has been dictated by design. The entire program is tested as whole.
Correction is difficult because isolation of causes is complicated by vast expanse of
entire program. Once these errors are corrected, new ones appear and the process
continues in a seemingly endless loop.

24
After unit testing in Sell-Soft System all the modules were integrated to test
for any inconsistencies in the interfaces. Moreover differences in program structures
were removed and a unique program structure was evolved.

FUNCTIONAL TESTING
Functional testing is a type of software testing whereby the system is tested
against the functional requirements/specifications. Functions are tested by feeding
them input and examining the output. Functional testing ensures that the requirements
are properly satisfied by the application. During functional testing Black Box testing
technique is used in which the internal logic of the system being tested is not known
to the tester. Functional testing is normally performed during the levels of System
testing and Acceptance testing.
Typically, functional testing involves the following steps:
• Identify functions that the software is expected to perform.
• Create input data based on the function’s specifications.
• Determine the output based on the function’s specifications.
• Execute the test case.
• Compare the actual and expected outputs.

ACCEPTANCE TESTING
Testing generally involves running a suite of tests on the completed system.
Each individual test, known as a case, exercises a particular operating condition of the
user's environment or feature of the system, and will result in a pass or fail, or
outcome. There is generally no degree of success or failure. The test environment is
usually designed to be identical, or as close as possible, to the anticipated user's
environment, including extremes of such. These test cases must each be accompanied
by test case input data or a formal description of the operational activities (or both) to
be performed—intended to thoroughly exercise the specific case—and a formal
description of the expected results.

25
REGRESSION TESTING
It is used to authenticate a code change in the software does not impact the
existing functionality of the product. It is making sure that the software works fine
with new functionality, bug fixes or any change in the existing feature. To ensure new
changes have not produced any bugs.
In this project, all the functionalities have been working properly and fixes all
possible bugs. The new changes in this project have not produced any Bugs on the
existing features.

VALIDATION TESTING
This is the final step in testing. In this the entire system was tested as a whole
with all forms, code, modules and class modules. This form of testing is popularly
known as Black Box testing or System testing. Black Box testing method focuses on
the functional requirements of the software. That is, Black Box testing enables the
software engineer to derive sets of input conditions that will fully exercise all
functional requirements for a program.
Black Box testing attempts to find errors in the following categories; incorrect
or missing functions, interface errors, errors in data structures or external data access,
performance errors and initialization errors and termination errors.

UI (USER INTERFACE) TESTING


The user interface testing is also known as GUI (Graphical User Interface)
testing. It refers to testing the functions of an application that are visible to user. GUI
testing is testing the systems graphical user interface of the application under controls
like menus, buttons, icons, toolbar, menu bar, dialog boxes and windows. The first
interaction between a user and software takes place to a GUI.
In this project all the user interfaces like text boxes, icons, menu bar are
working properly. The text box will be able to allow the user to enter the text.

26
BLACK BOX TESTING
Black Box Testing is also known as behavioral, opaque-box, closed-box
specification based or eye-to-eye testing. It is a software testing method that analyzes
the functionality of a software/application without knowing much about the internal
structure/design of the item that is being tested and compares the input value with the
output value.
The main focus of Black Box Testing is on the functionality of the system as a
whole. The term ‘Behavioral Testing’ is also used for Black Box. A majority of the
application are tested using the Black Box method. We need to cover the majority of
test cases so that most of the bugs will get discovered by the Black-Box method.
Black Box testing method focuses on the functional requirements of the software.
That is, Black Box testing enables the software engineer to derive sets of input
conditions that will fully exercise all functional requirements for a program. Black Box
testing attempts to find errors in the following categories; incorrect or missing
functions, interface errors, errors in data structures or external data access,
performance errors and initialization errors and termination errors.

WHITE BOXTESTING

White Box Testing is a testing in which in which the software tester has
knowledge of the inner workings, structure and language of the software, or at least
its purpose. It is purpose. It is used to test areas that cannot be reached from a black
box level. White Box Testing is a testing technique which evaluates the code and the
internal structure of a program. White Box Testing involves looking at the structure
of the code. When you know the internal structure of a product, tests can be
conducted to ensure that the internal operations performed according to the
specification and all internal components have been adequately exercised.

27
6. CONCLUSION

This project has come as a platform to propose an online voting system that
will place our democracy on a path of success. In a nutshell, this research seeks to
increase the efficiency of voting process and the image of the Electoral Commissions
in charge of elections. This Online Voting System is simple and indigenous. It has an
authentication feature that will manage the Voter’s information by which voter can
login and use his/her voting rights. There is a database in which all the names of
voters with complete information is stored and it provides the tools for maintaining
voter’s vote to every candidate and also computes the total number of votes of every
candidate. Online voting offers speed and convenience to the voter and considerable
ease to election administrators as they can get election results out more quickly than
conventional methods of manual voting since vote counting is just a matter of
querying the database.
The success factors include:
• Faster electoral process.
• A better platform for the disabled as well as the outright elimination of
multiple voting.
• Finally, the integrated system would avail the electorates the opportunity of
casting their votes using the most convenient means.
• The adoption of this system is likely to increase the level of participation in
the polity because of the ease of voting and its tendency.

28
7. FUTURE ENHANCEMENT

An integrated voting system that incorporates an Electronic Voting Machine


(EVM), Internet Voting (i-Voting) and Mobile Voting (m-Voting) is proposed for
enhanced participatory democracy. The use of Biometrics (Finger print/cornea
detection), CAPTCHA and immediate password change could also be incorporated
into the system in future to enhance the security strength though there is a problem of
it decreasing the scope of the platform because these systems need some electronic
components to implement. So, it will avoid the users’ privilege to cast the votes at
their fingertips. But it can guarantee that fake voting will be impossible. SMS Update:
In future SMS query could also be added.
This will enable the sending of registration details or result updates to mobile
phones or hand-held devices. Well, the future of this project lies in the hand of our
users. Although we also have a part to play.
The Online Voting System (OVS) platform can be made more secure by using the
following methods
▪ Password Changing
▪ Fingerprinting
▪ Cornea Detection
The password used by the user to vote is provided by the administrator. In the
future the user can be given the privilege of changing the password. So it helps to
increase the security of the system. The other two methods that can be used are cornea
detection and fingerprinting. But here the problem is that it decreases the scope of the
platform because these systems need some electronic components to implement. So it
will avoid the user’s privilege to cast the votes at their fingertips. But it can guarantee
that fake voting will be impossible.
This is through enhancing the features of this system by introducing concepts
and functionalities which are trending with other systems. However, maintenance is
the most important thing that determines the future of a software. By constant
maintenance, debugging and providing security checks we hope the system should be
able to survive those future challenges.
29
8. SOURCE CODE

Login

<?php

session_start();

include 'includes/conn.php';

if(isset($_POST['login'])){

$username = $_POST['username'];

$password = $_POST['password'];

$sql = "SELECT * FROM admin WHERE username = '$username'";

$query = $conn->query($sql);

if($query->num_rows < 1){

$_SESSION['error'] = 'Cannot find account with the username';

else{

$row = $query->fetch_assoc();

if(password_verify($password, $row['password'])){

$_SESSION['admin'] = $row['id'];

else{

$_SESSION['error'] = 'Incorrect password';

30
else{

$_SESSION['error'] = 'Input admin credentials first';

header('location: index.php');

?>

ballot

<?php

session_start();

include 'includes/conn.php';

if(isset($_POST['login'])){

$username = $_POST['username'];

$password = $_POST['password'];

$sql = "SELECT * FROM admin WHERE username = '$username'";

$query = $conn->query($sql);

if($query->num_rows < 1){

$_SESSION['error'] = 'Cannot find account with the username';

else{

$row = $query->fetch_assoc();

if(password_verify($password, $row['password'])){

$_SESSION['admin'] = $row['id'];

else{

31
$_SESSION['error'] = 'Incorrect password';

else{

$_SESSION['error'] = 'Input admin credentials first';

header('location: index.php');

?>

Candidates

<?php

include 'includes/session.php';

if(isset($_POST['add'])){

$firstname = $_POST['firstname'];

$lastname = $_POST['lastname'];

$position = $_POST['position'];

$platform = $_POST['platform'];

$filename = $_FILES['photo']['name'];

if(!empty($filename)){

move_uploaded_file($_FILES['photo']['tmp_name'], '../images/'.$filename);

$sql = "INSERT INTO candidates (position_id, firstname, lastname, photo, platform)


VALUES ('$position', '$firstname', '$lastname', '$filename', '$platform')";

32
if($conn->query($sql)){

$_SESSION['success'] = 'Candidate added successfully';

else{

$_SESSION['error'] = $conn->error;

else{

$_SESSION['error'] = 'Fill up add form first';

header('location: candidates.php');

?>

Logout

<?php

session_start();

session_destroy();

header('location: index.php');

?>

Submit ballot

<?php

include 'includes/session.php';

include 'includes/slugify.php';

if(isset($_POST['vote'])){

33
if(count($_POST) == 1){

$_SESSION['error'][] = 'Please vote atleast one candidate';

else{

$_SESSION['post'] = $_POST;

$sql = "SELECT * FROM positions";

$query = $conn->query($sql);

$error = false;

$sql_array = array();

while($row = $query->fetch_assoc()){

$position = slugify($row['description']);

$pos_id = $row['id'];

if(isset($_POST[$position])){

if($row['max_vote'] > 1){

if(count($_POST[$position]) > $row['max_vote']){

$error = true;

$_SESSION['error'][] = 'You can only choose '.$row['max_vote'].' candidates for


'.$row['description'];

else{

foreach($_POST[$position] as $key => $values){

$sql_array[] = "INSERT INTO votes (voters_id, candidate_id, position_id) VALUES


('".$voter['id']."', '$values', '$pos_id')";}

34
else{

$_SESSION['error'][] = 'Select candidates to vote first';

header('location: home.php');

?>

Voter

<?php include 'includes/session.php'; ?>

<?php include 'includes/header.php'; ?>

<body class="hold-transition skin-blue sidebar-mini">

<div class="wrapper">

<?php include 'includes/navbar.php'; ?>

<?php include 'includes/menubar.php'; ?>

<!-- Content Wrapper. Contains page content -->

<div class="content-wrapper">

<!-- Content Header (Page header) -->

<section class="content-header">

<h1>

Voters List

</h1>

<ol class="breadcrumb">

<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>

<li class="active">Voters</li>

</ol>

35
</section>

<!-- Main content -->

<section class="content">

<?php

if(isset($_SESSION['error'])){

echo "

<div class='alert alert-danger alert-dismissible'>

<button type='button' class='close' data-dismiss='alert' aria-


hidden='true'>&times;</button>

<h4><i class='icon fa fa-warning'></i> Error!</h4>

".$_SESSION['error']."

</div>

";

unset($_SESSION['error']);

if(isset($_SESSION['success'])){

echo "

<div class='alert alert-success alert-dismissible'>

<button type='button' class='close' data-dismiss='alert' aria-


hidden='true'>&times;</button>

<h4><i class='icon fa fa-check'></i> Success!</h4>

".$_SESSION['success']."

</div>

36
";

unset($_SESSION['success']);

?>

<div class="row">

<div class="col-xs-12">

<div class="box">

<div class="box-header with-border">

<a href="#addnew" data-toggle="modal" class="btn btn-primary btn-sm btn-flat"><i


class="fa fa-plus"></i> New</a>

</div>

<div class="box-body">

<table id="example1" class="table table-bordered">

<thead>

<th>Lastname</th>

<th>Firstname</th>

<th>Photo</th>

<th>Voters ID</th>

<th>Tools</th>

</thead>

<tbody>

<?php

$sql = "SELECT * FROM voters";

37
$query = $conn->query($sql);

while($row = $query->fetch_assoc()){

$image = (!empty($row['photo'])) ? '../images/'.$row['photo'] : '../images/profile.jpg';

echo "

<tr>

<td>".$row['lastname']."</td>

<td>".$row['firstname']."</td>

<td>

<img src='".$image."' width='30px' height='30px'>

<a href='#edit_photo' data-toggle='modal' class='pull-right photo' data-


id='".$row['id']."'><span class='fa fa-edit'></span></a>

</td>

<td>".$row['voters_id']."</td>

<td>

<button class='btn btn-success btn-sm edit btn-flat' data-id='".$row['id']."'><i class='fa


fa-edit'></i> Edit</button>

<button class='btn btn-danger btn-sm delete btn-flat' data-id='".$row['id']."'><i


class='fa fa-trash'></i> Delete</button>

</td>

</tr>

";

?>

</tbody>

38
</table>

</div>

</div>

</div>

</div>

</section>

</div>

<?php include 'includes/footer.php'; ?>

<?php include 'includes/voters_modal.php'; ?>

</div>

<?php include 'includes/scripts.php'; ?>

<script>

$(function(){

$(document).on('click', '.edit', function(e){

e.preventDefault();

$('#edit').modal('show');

var id = $(this).data('id');

getRow(id);

});

$(document).on('click', '.delete', function(e){

e.preventDefault();

$('#delete').modal('show');

var id = $(this).data('id');

39
getRow(id);

});

$(document).on('click', '.photo', function(e){

e.preventDefault();

var id = $(this).data('id');

getRow(id);

});

});

function getRow(id){

$.ajax({

type: 'POST',

url: 'voters_row.php',

data: {id:id},

dataType: 'json',

success: function(response){

$('.id').val(response.id);

$('#edit_firstname').val(response.firstname);

$('#edit_lastname').val(response.lastname);

$('#edit_password').val(response.password);

$('.fullname').html(response.firstname+' '+response.lastname);

});

40
</script>

</body>

</html>

Home

<?php include 'includes/session.php'; ?>

<?php include 'includes/header.php'; ?>

<body class="hold-transition skin-blue layout-top-nav">

<div class="wrapper">

<?php include 'includes/navbar.php'; ?>

<div class="content-wrapper">

<div class="container">

<!-- Main content -->

<section class="content">

<?php

$parse = parse_ini_file('admin/config.ini', FALSE, INI_SCANNER_RAW);

$title = $parse['election_title'];

?>

<h1 class="page-header text-center title"><b><?php echo strtoupper($title);


?></b></h1>

<div class="row">

<div class="col-sm-10 col-sm-offset-1">

<?php

if(isset($_SESSION['error'])){

41
?>

<div class="alert alert-danger alert-dismissible">

<button type="button" class="close" data-dismiss="alert" aria-


hidden="true">&times;</button>

<ul>

<?php

foreach($_SESSION['error'] as $error){

echo "

<li>".$error."</li>

";

?>

</ul>

</div>

<?php

unset($_SESSION['error']);

if(isset($_SESSION['success'])){

echo "

<div class='alert alert-success alert-dismissible'>

<button type='button' class='close' data-dismiss='alert' aria-


hidden='true'>&times;</button>

<h4><i class='icon fa fa-check'></i> Success!</h4>

42
".$_SESSION['success']."

</div>

";

unset($_SESSION['success']);

?>

<div class="alert alert-danger alert-dismissible" id="alert" style="display:none;">

<button type="button" class="close" data-dismiss="alert" aria-


hidden="true">&times;</button>

<span class="message"></span>

</div>

<?php

$sql = "SELECT * FROM votes WHERE voters_id = '".$voter['id']."'";

$vquery = $conn->query($sql);

if($vquery->num_rows > 0){

?>

<div class="text-center">

<h3>You have already voted for this election.</h3>

<a href="#view" data-toggle="modal" class="btn btn-flat btn-primary btn-lg">View


Ballot</a>

</div>

<?php

43
else{

?>

<!-- Voting Ballot -->

<form method="POST" id="ballotForm" action="submit_ballot.php">

<?php

include 'includes/slugify.php';

$candidate = '';

$sql = "SELECT * FROM positions ORDER BY priority ASC";

$query = $conn->query($sql);

while($row = $query->fetch_assoc()){

$sql = "SELECT * FROM candidates WHERE position_id='".$row['id']."'";

$cquery = $conn->query($sql);

while($crow = $cquery->fetch_assoc()){

$slug = slugify($row['description']);

$checked = '';

if(isset($_SESSION['post'][$slug])){

$value = $_SESSION['post'][$slug];

if(is_array($value)){

foreach($value as $val){

if($val == $crow['id']){

$checked = 'checked';

44
}

else{

if($value == $crow['id']){

$checked = 'checked';

$input = ($row['max_vote'] > 1) ? '<input type="checkbox" class="flat-red '.$slug.'"


name="'.$slug."[]".'" value="'.$crow['id'].'" '.$checked.'>' : '<input type="radio"
class="flat-red '.$slug.'" name="'.slugify($row['description']).'" value="'.$crow['id'].'"
'.$checked.'>';

$image = (!empty($crow['photo'])) ? 'images/'.$crow['photo'] : 'images/profile.jpg';

$candidate .= '

<li>

'.$input.'<button type="button" class="btn btn-primary btn-sm btn-flat clist platform"


data-platform="'.$crow['platform'].'"data-fullname="'.$crow['firstname'].'
'.$crow['lastname'].'"><i class="fa fa-search"></i> Platform</button><img
src="'.$image.'" height="100px" width="100px" class="clist"><span class="cname
clist">'.$crow['firstname'].' '.$crow['lastname'].'</span>

</li>';

$instruct = ($row['max_vote'] > 1) ? 'You may select up to '.$row['max_vote'].'


candidates' : 'Select only one candidate';

echo '

<div class="row">

45
<div class="col-xs-12">

<div class="box box-solid" id="'.$row['id'].'">

<div class="box-header with-border">

<h3 class="box-title"><b>'.$row['description'].'</b></h3>

</div>

<div class="box-body">

<p>'.$instruct.'

<span class="pull-right">

<button type="button" class="btn btn-success btn-sm btn-flat reset" data-


desc="'.slugify($row['description']).'"><i class="fa fa-refresh"></i> Reset</button>

</span>

</p>

<div id="candidate_list">

<ul>

'.$candidate.'

</ul>

</div>

</div>

</div>

</div>

</div>';

$candidate = '';

46
?>

<div class="text-center">

<button type="button" class="btn btn-success btn-flat" id="preview"><i class="fa fa-


file-text"></i> Preview</button>

<button type="submit" class="btn btn-primary btn-flat" name="vote"><i class="fa fa-


check-square-o"></i> Submit</button>

</div>

</form>

<!-- End Voting Ballot -->

<?php

?>

</div>

</div>

</section>

</div>

</div>

<?php include 'includes/footer.php'; ?>

<?php include 'includes/ballot_modal.php'; ?>

</div>

<?php include 'includes/scripts.php'; ?>

<script>

$(function(){

47
$('.content').iCheck({

checkboxClass: 'icheckbox_flat-green',

radioClass: 'iradio_flat-green'

});

$(document).on('click', '.reset', function(e){

e.preventDefault();

var desc = $(this).data('desc');

$('.'+desc).iCheck('uncheck');

});

$(document).on('click', '.platform', function(e){

e.preventDefault();

$('#platform').modal('show');

var platform = $(this).data('platform');

var fullname = $(this).data('fullname');

$('.candidate').html(fullname);

$('#plat_view').html(platform);

});

$('#preview').click(function(e){

e.preventDefault();

var form = $('#ballotForm').serialize();

if(form == ''){

$('.message').html('You must vote atleast one candidate');

$('#alert').show();

48
}

else{

$.ajax({

type: 'POST',

url: 'preview.php',

data: form,

dataType: 'json',

success: function(response){

if(response.error){

var errmsg = '';

var messages = response.message;

for (i in messages) {

errmsg += messages[i];

$('.message').html(errmsg);

$('#alert').show();

else{

$('#preview_modal').modal('show');

$('#preview_body').html(response.list);

});

49
}

});

});

</script>

</body>

</html>

50
OUTPUT SCREEN

SCREENSHOTS

HOME

BALLOT POSITION

51
CANDIDATES LIST

POSITIONS

52
VOTERS LIST

ADD CANDIDATE

53
VOTING

VOTES

54
LOGIN

55
9. BIBILIOGRAPHY

❖ Pankaj Jalote. An Integrated Approach to Software Engineering, Third


Edition, Narosa Publications. A case study approach whereby a project is
Developed through the course of the book, illustrating different activities
of Software development.

❖ www.mysql.com

❖ www.w3schools.com

❖ www.google.com

❖ www.wikipaedia.com

❖ www.eci.nic.in

56

You might also like