0% found this document useful (0 votes)
22 views23 pages

SDD Ahsan

Uploaded by

Muhammad Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views23 pages

SDD Ahsan

Uploaded by

Muhammad Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

The Islamia University of Bahawalpur

Department of Computer Science

SOFTWARE DESIGN DESCRIPTION


(SDD DOCUMENT)

for

<Online Voting System>


Version 1.0

By
Muhammad Ahsan
F21BDOCS1M01086
Session Fall 2021 – 2025

Supervisor
Mr. Fahad Ali

Bachelor of Science in Computer Science

A
Table of Contents
Introduction ................................................................................................................................................................. 1
Design methodology and software process model ...................................................................................................... 1
Design Methodology: Procedural Programming ..................................................................................................... 1
Process Model: Agile Methodology ........................................................................................................................ 1
System Overview ......................................................................................................................................................... 2
Context and Design: ................................................................................................................................................. 2
Background: ............................................................................................................................................................. 2
Architectural design ................................................................................................................................................. 2
Line Box Diagram ....................................................................................................................................................... 3
Process flow/Representation........................................................................................................................................ 4
Activity Diagram ..................................................................................................................................................... 4
Design models ............................................................................................................................................................. 5
Data Flow Diagram .................................................................................................................................................. 5
Sequence Diagram ................................................................................................................................................... 6
Data design .................................................................................................................................................................. 9
Data dictionary ......................................................................................................................................................... 9
Algorithm & Implementation .................................................................................................................................... 10
Voter Registration .................................................................................................................................................. 10
Voter Login ............................................................................................................................................................ 11
Admin Login .......................................................................................................................................................... 11
Create Ballot .......................................................................................................................................................... 11
Add Candidate ....................................................................................................................................................... 12
Cast Vote................................................................................................................................................................ 12
Display Results ...................................................................................................................................................... 13
Software requirements traceability matrix ................................................................................................................ 13
Human interface design ............................................................................................................................................. 13
Screen images ........................................................................................................................................................ 15

B
Table of Figures
Figure 1: Line Box Diagram ........................................................................................................................................ 3
Figure 2: Activity Diagram.......................................................................................................................................... 4
Figure 3: Data Flow Diagram ...................................................................................................................................... 5
Figure 4: Sequence Diagram ....................................................................................................................................... 6

List of Tables
Table 1: Data Dictionary ............................................................................................................................................. 9
Table 2: Software Traceability Matrix ...................................................................................................................... 13

Table of Screen Images


Screen Image 1: Login for Admin or Voter ............................................................................................................................... 15
Screen Image 2: Voter Registration............................................................................................................................................ 15
Screen Image 3: Home Page Idea ............................................................................................................................................... 15
Screen Image 4: Ballots for Voters............................................................................................................................................. 16
Screen Image 5: Create Ballot .................................................................................................................................................... 16

C
Revision History
Name Date Reason for changes Version

D
Application Evaluation History

Comments (by committee) Action Taken


*include the ones given at scope time both in doc and
presentation

Supervised by
Mr. Fahad Ali

Signature

E
Introduction
The scope of this BS Computer Science project is to develop a secure and efficient online
voting system for localized use, enabling users to cast votes remotely through a user-friendly
web-based platform. The system includes key modules such as user registration and login,
candidate management, vote casting, and election result display. Admin functionalities, such
as managing candidates and controlling election timings, ensure fair and organized elections.
Designed with scalability and reliability in mind, the platform prioritizes security, data
integrity, and ease of use to facilitate transparent elections within the specified region.

Design methodology and software process model


Design Methodology: Procedural Programming
The online voting system is being developed using the Procedural Programming
methodology. This approach was chosen for the following reasons:

• Straightforward Implementation: Procedural programming uses a linear, step-by-step


approach, making it easy to define and implement core functionalities such as user
registration, login, vote submission, and result computation.

• Simplicity: For a BS-level project with clearly defined tasks, procedural programming
provides a logical structure that is easy to understand and implement.

• Task-Oriented Approach: Procedural programming focuses on organizing the code


into functions, such as those for handling user input, validating data, and calculating
election results. This makes it an efficient choice for a small-scale project.

• Ease of Debugging: Procedural programming allows for easier testing and debugging
of individual functions, ensuring that each component works as intended before
integrating them.
Process Model: Agile Methodology
Although this project will be developed independently, the Agile Methodology is still a
suitable choice for the following reasons:

• Iterative Development: Agile allows the project to be divided into smaller modules
(e.g., user registration, voting process, result computation), which can be developed,
tested, and refined one step at a time.

• Flexibility: Agile provides the flexibility to adjust and improve the system as new ideas
or minor changes arise during development.

• Incremental Progress: By focusing on completing one functionality at a time, such as


implementing the voting process first and then adding the result computation, the project
becomes easier to manage and track.

• Focus on Continuous Improvement: Even without stakeholders, Agile encourages


revisiting and refining modules based on personal review, ensuring quality and
functionality.

1
System Overview
The Online Voting System is a secure, web-based application designed to simplify the voting
process by allowing users to cast their votes remotely while ensuring privacy, accessibility,
and reliability. Key features include user authentication, vote casting, and transparent result
reporting. The system is tailored for elections, surveys, and organizational decision-making,
addressing the need for digital alternatives to traditional voting methods.
Context and Design:
• Functionality: Provides seamless user registration, login, vote submission, and result
display.
• User Experience: Features a user-friendly interface designed to minimize errors and
improve accessibility for voters.
• Technologies: Built with React.js for the frontend and Node.js for the backend, ensuring
efficient state management and smooth data flow between system components.

Background:
Traditional voting systems, such as paper-based ballots, often face problems like being time-
consuming, costly, and less accessible for many voters. With the rise of technology, there is a
growing need for an online voting system to make the process easier and more efficient. This
system allows users to vote remotely from anywhere while ensuring privacy and security. It
eliminates geographical barriers and reduces the cost and effort of manual vote counting. By
using modern technologies like React.js and Node.js, the system provides a simple, reliable,
and transparent voting experience.

Architectural design
The architectural design of the online voting system is based on a modular structure. Each
module handles a specific aspect of the system's functionality, ensuring efficient management
and scalability. This modular approach enhances maintainability and allows for easier updates
and improvements. The main modules include:

• Voter Registration:
Handles the collection and storage of voter details during the registration process.
• Voter Login:
Manages the authentication of registered voters to provide secure access to the system.
• Admin Login:
Manages the authentication of admins and grants access to administrative
functionalities.
• Ballot Creation:
Allows admins to create and manage election ballots.
• Election Timings
Enables admins to set and manage the election start and end times
• Vote Casting
Facilitates the secure process for voters to cast their votes
• Result Viewing
Displays election results to voters in a user-friendly manner.

2
Module Relationships:
• Voter Registration ↔ Voter Login: Voters must register first using the Voter
Registration module before they can log in through the Voter Login module.
• Admin Login ↔ Ballot Creation, Election Timings: Only authenticated admins can
access the Ballot Creation module to create and manage election ballots. They can also set
and manage election timings using the Election Timings module.
• Ballot Creation, Election Timings: ↔ Vote Casting: Voters use the Vote Casting
module to cast their votes based on the ballots created by admins in the Ballot Creation
module. The Vote Casting module is only available to voters during the election timings
set by admins in the Election Timings module.

• Vote Casting: ↔ Results Viewing: The votes cast by voters through the Vote Casting
module determine the results displayed in the Result Viewing module.

Line Box Diagram


Figure 1 shows the main parts of the online voting system and how they work together.
The Voter Registration Module lets new voters sign up, and the Voter Login Module handles
voter authentication. The Admin Login Module allows administrators to log in and access the
Ballot Creation Module, where they create and manage election ballots. The Election Timings
Module lets admins set the start and end times for voting. Voters use the Vote Casting Module
to cast their votes, and the Result Viewing Module displays election results. All these modules
interact with the Database, which stores and manages all the system's data. This modular
structure ensures the system is secure, scalable, and easy to manage.

Figure 1: Line Box Diagram

3
Process flow/Representation
In this section, I am going to explain the activity diagram to demonstrate the major processes
on my website and how they flow to achieve the intended goals. An Activity Diagram is a type
of UML diagram that represents the flow of activities or actions in a system, showcasing the
sequence and conditions for coordinating lower-level behaviors. It is used to model the
dynamic aspects of a system.
Activity Diagram
Figure 2 illustrates the step-by-step activity flow for users and admins:

Figure 2: Activity Diagram

4
Design models
The Online Voting System is designed to simplify and secure the election process for both
voters and administrators. It facilitates the entire process from voter registration, login, and
casting votes to managing election configurations and viewing results. The DFD provides a
clear flow of data between different users, processes, and the central database. The system has
been designed using a procedural approach with a multi-level Data Flow Diagram (Figure
3), extending to Level 2 for clarity and Sequence Diagram (Figure 4). The processes, data
flows, data stores, and external entities have been mapped comprehensively to ensure an
efficient and user-friendly experience.

Data Flow Diagram

Figure 3: Data Flow Diagram

5
Sequence Diagram

Figure 4: Sequence Diagram

6
Actors and Entities
• Voter (External Entity)
The voter interacts with the system to register, log in, cast their vote, and view the
results.
• Admin (External Entity)
The admin oversees the election process, manages candidates, creates and deletes
ballots, and adjusts election timings.
• Voting System Database (Data Store)
Centralized storage for voter information, login credentials, ballot data, vote records,
and election results.

Processes and Their Descriptions


• Registration Process
o Process: Registration
The voter provides personal details to register for the election.
o Sub-Process: Validate Registration

The system verifies the registration details.

o Data Flow:
▪ Input: Voter details.
▪ Output: Registration status.
▪ Data Store Interaction: The voter information is stored in the database.
• Login Process
o Process: Login
The voter enters login credentials to access their account.
o Sub-Process: Validate Registration

The system checks the credentials against the stored data.

o Data Flow:
▪ Input: Login credentials.
▪ Output: Login status.
▪ Data Store Interaction: User credentials are validated using data stored
in the database

7
• Voting Process
o Process: Cast Vote
The voter selects their preferred candidate on the ballot.
o Sub-Process: Validate Vote
The system ensures the voter is eligible to cast a vote.
o Data Flow:
▪ Input: Selected candidate.
▪ Output: Vote confirmation.
▪ Data Store Interaction: The vote is recorded in the database.
• Election Management (Admin)
o Process: Manage Candidates
The admin can manage candidates by creating or deleting ballots, as well as
adjusting election timings.
o Sub-Process: Create or Delete Ballots and Set Election Timings
The system ensures the voter is eligible to cast a vote.
o Data Flow:
▪ Input: Ballot configurations.
▪ Output: Updated ballot data.
▪ Data Store Interaction: Ballot configurations are saved to or removed
from the database.
• Results Process
o Process: Display Results
Throughout the election, voter can see the result on click and after election
ends, on click will display final results.
o Data Flow:
▪ Input: Election data from the database.
▪ Output: Election results displayed to voters.
▪ Data Store Interaction: The system dynamically retrieves and
processes the requested data without storing intermediate results.

8
Data design
The information domain of the system is transformed into structured relational data models
stored in a database. The major entities are:

• Voter: Stores details of registered voters.

• Admin: Stores information about election administrators.

• Ballots: Represents the election events, including their timing and title.

• Candidates: Stores information about candidates contesting on a specific ballot.

• Votes: Captures the votes cast by voters for specific candidates on specific ballots

Tables
• Voters Table: Stores voter information for registration and authentication.

• Admins Table: Stores admin credentials and roles for managing elections.

• Ballots Table: Contains details about election events.

• Candidates Table: Lists candidates linked to specific ballots.

• Votes Table: Records votes cast by voters, linking them to ballots and candidates.

Storage and Organization


• Database: The data will be stored in a relational database (e.g., MySQL, PostgreSQL).

• Primary Keys: Unique identifiers (voterID, adminID, ballotID, candidateID, voteID)


will be assigned to each table.

• Foreign Keys: Establish relationships between tables (e.g., ballotID links Candidates
to Ballots).
Data dictionary
Below is the list of system entities and their attributes, arranged alphabetically for clarity:
Table 1: Data Dictionary

Entity Type Description


Admins Table Stores administrator details for managing ballots and
(Database) overseeing the election.
Ballots Table Contains information about individual elections.
(Database)
Candidates Table Stores details about candidates participating in specific
(Database) ballots.
Votes Table Tracks votes cast by voters for specific candidates on
(Database) specific ballots.
Voters Table Stores voter registration details and login credentials.
(Database)

9
Functions and Parameters
• registerVoter()
o Parameters: name, email, password, Nic
o Description: Registers a new voter and stores their details in the Voters table.
• validateRegistration()
o Parameters: email
o Description: Ensures no duplicate email exists in the system.
• loginVoter()
o Parameters: email, password
o Description: Authenticates a voter and grants access to the voting system.
• loginAdmin()
o Parameters: username, password
o Description: Authenticates an admin and grants access to administrative
functionalities.
• createBallot()
o Parameters: ballotID, title, startTime, endTime
o Description: Creates a new ballot and stores it in the Ballots table.
• addCandidate()
o Parameters: candidateID ,ballotID, candidateName, party
o Description: Adds a candidate to a specific ballot.
• castVote()
o Parameters: voterID, ballotID, candidateID
o Description: Records a voter’s vote in the Votes table.
• validateVote()
o Parameters: voterID, ballotID
o Description: Ensures the voter is eligible to vote and hasn’t already voted on
the same ballot.
• displayResults()
o Parameters: ballotID
o Description: Retrieves and computes the results of the specified ballot.

Algorithm & Implementation


In this section, I am going to explain the functionality of each component of the website using
a systematic approach. The following algorithms describe the major functions and methods in
pseudo-code format, focusing on how data flows between objects and is processed.
Voter Registration
Function registerVoter(voterName, email, password,Nic):
Input: voterName (String), email (String), password
(String), address (String)
Output: Registration success or failure
Begin
1. Validate email format.
2. Check if email already exists in the database.
If email exists:
Return "Error: Email already registered"
4. Generate a unique voterID.
5. Save voterName, email, password, address, and
voterID in the database.
6. Return "Registration successful"

10
End
Voter Login
Function loginVoter(email, password):
Input: email (String), password (String)
Output: Login success or failure
Begin
1. Check if the email exists in the database.
If not:
Return "Error: Email not found"
2. Retrieve the password from the database.
3. Compare the input password with the password
If passwords do not match:
Return "Error: Incorrect password"
4. Mark the user as logged in (session management).
5. Return "Login successful"
End
Admin Login
Function loginAdmin(Email, Password):
Input: adminEmail (String), adminPassword (String)
Output: Login success or failure
Begin
1. Check if Email exists in the database.
If not:
Return "Error: Admin not found"
2. Verify Password.
If incorrect:
Return "Error: Incorrect password"
3. Allow access to admin functionalities.
4. Return "Admin login successful"
End
Create Ballot
Function createBallot(ballotID, ballotTitle, startTime,
endTime):
Input:
ballotID (String): The ID of the ballot.
ballotTitle(String):The title or name of ballot.
startTime(DateTime):The start time for the ballot.
endTime(DateTime): The end time for the ballot.
Output:
Success or failure message.
Begin
Validate the input:
a. Ensure `ballotTitle` is not empty.
b. Ensure `startTime` is earlier than
`endTime`.
c. If validation fails, Return "Error: Invalid
input."
Check if a ballot with the same id already exists in the
database.
If found:
Return "Error: Ballot id already exists."
11
Save the ballot information (ballotID, ballotTitle,
startTime, endTime) to the database.
Return "Ballot created successfully."
End
Add Candidate
Function addCandidate(ballotID, candidateID,
candidateName, party):
Input: ballotID (String), candidateID(String),
candidateName (String), party (String, optional)
Output: Candidate addition success or failure
Begin
1. Check if ballotID exists in the Ballots table.
If not:
Return "Error: Ballot not found"
3. Insert candidateName, party, and ballotID into
the Candidates table.
4. Return "Candidate added successfully"
End

Cast Vote
Function castVote(voterID, ballotID, candidateID):
Input: voterID (String), ballotID (String),
candidateID (String)
Output: Vote submission success or failure
Begin
1. Check if the voterID exists in the Voters table.
If not:
Return "Error: Voter not found"
2. Check if the ballotID is active and within
voting time.
If not:
Return "Error: Ballot not active or voting
period expired"
3. Verify that the voter has not already voted for
this ballot.
If already voted:
Return "Error: Voter has already cast a
vote"
4. Record voterID, ballotID, and candidateID in
the Votes table.
5. Return "Vote cast successfully"
End

12
Display Results
Function displayResults(ballotID):
Input: ballotID (String)
Output: List of candidates with vote counts

Begin
1. Check if the ballotID exists in the Ballots
table.
If not:
Return "Error: Ballot not found"
2. Retrieve all candidates and their vote counts
for the ballot from the Votes table.
3. Sort candidates by vote count in descending
order.
4. Return the sorted list of candidates with their
respective vote counts.
End

Software requirements traceability matrix

Table 2: Software Traceability Matrix

:Req. Number Ref. Item Design Component Component Items


DFD and registerVoter()
FR-001 Figure 3 and Figure 4
Sequence Diagram validateRegistration()
DFD and
FR-002 Figure 3 and Figure 4 loginVoter()
Sequence Diagram
DFD level loginVoter()
FR-003 Figure 3
2: Display Ballots castVote()
DFD and castVote()
FR-004 Figure 3 and Figure 4
Sequence Diagram validateVote()
DFD and
FR-005 Figure 3 and Figure 4 displayResults()
Sequence Diagram
DFD and
FR-006 Figure 3 and Figure 4 loginAdmin()
Sequence Diagram
DFD and createBallot()
FR-007 Figure 3 and Figure 4
Sequence Diagram addCandidate()
DFD and
FR-008 Figure 3 and Figure 4 createBallot()
Sequence Diagram

Human interface design


The Online Voting System prioritizes ease of use, clarity, and feedback to ensure a smooth
experience for both voters and administrators. The user interface provides simple steps to
complete tasks like registration, login, voting, and viewing results, while admins have intuitive
controls to manage the election process. The feedback mechanisms guide users through each
process and help them understand the status of their actions.

13
• Voter Registration

o Functionality: Voters register by providing personal details (Name, Email,


Password, NIC).
o Actions: Enter details and click Register.
o Feedback: Confirmation message for successful registration or error message
for duplicate email.

• Voter Login
o Functionality: Voters log in using their Email and Password.
o Actions: Enter credentials and click Login.

o Feedback: Successful login redirects to the voting page; error message for
invalid credentials.

• Casting Votes
o Functionality: Voters select a candidate from the ballot.
o Actions: Choose candidate and click Vote.
o Feedback: Confirmation message "Vote cast successfully" or error if election
time has ended.

• View Election Results

o Functionality: Voters can view the results once voting ends.


o Actions: Click on Results.
o Feedback: Displays real-time results or message "Results available after
election ends."

• Admin Login

o Functionality: Admins log in with Username and Password.


o Actions: Enter credentials and click Login.
o Feedback: Successful login leads to Admin Dashboard; error message for
invalid login.

• Create Ballots
o Functionality: Admins create ballots by entering details (Title, Start/End
Time).
o Actions: Fill out form and click Create Ballot.

o Feedback: Success message "Ballot created"; error for missing details.

14
• Manage Candidates

o Functionality: Admins add/remove candidates for ballots.


o Actions: Enter candidate details and click Add Candidate.
o Feedback: Success message or error if candidate exists.

Screen images
The screen images below represent the expected user interface of the online voting system,
showcasing the main actions for both voters and admins.

Screen Image 1: Login for Admin or Voter Screen Image 2: Voter Registration

Screen Image 3: Home Page Idea

15
Screen Image 4: Ballots for Voters

zz

Screen Image 5: Create Ballot

16
Screen objects and actions
• Text Fields (Registration/Login): Users enter personal details or credentials.

• Buttons (Register/Login/Submit Vote): Trigger actions like registering, logging in, or


casting a vote.

• Ballot List: Displays available ballots for voting.

• Add Candidate/Finalize Ballot: Admin actions for adding candidates or finalizing


ballots.

17

You might also like