Professional Documents
Culture Documents
BDMS 1
BDMS 1
BACHELOR OF SCIENCE
IN
COMPUTER SCIENCE
1
Government College University Faisalabad.
ACKNOWLEDGEMENTS
All the praise to Allah, who has blessed us with the courage and knowledge to achieve our
goal. We can never thank Him enough for His countless blessings upon me. Salam to
Prophet Mohammad (S.A.W), who is and will always be a source of guidance and knowledge
for humanity.
For us, a milestone of this nature would never have been possible to achieve without the
support of galaxy of some truly loving and kind people in my life. No words can fully
describe my feelings of respect and gratitude for my affectionate parents, whose love. Their
concern, love and support can never be paid back.
We owe a lot of sincere gratitude to my respected supervisor Mr. Saadullah, whose true
guidance, positive criticism and sincere encouragement made me to get to my destination.
He became a source of inspiration for me and kept me moving in the right direction towards
my goal.
Mohsin Raza
Maryam Murtaza
Amna Naseer
2
Government College University Faisalabad.
DEDICATION
Dedicated to
Beloved Parents,
Respected Teachers
&
Lovely Friends.
3
Government College University Faisalabad.
Contents
ACKNOWLEDGEMENTS ......................................................................................................... 2
DEDICATION............................................................................................................................... 3
CHAPTER 1....................................................................................................................................... 9
1.1 INTRODUCTION ........................................................................................................... 10
1.2 Background ...................................................................................................................... 10
1.3 Purpose ............................................................................................................................ 11
1.4 Scope ............................................................................................................................... 11
1.5 Objective .......................................................................................................................... 12
1.6 Intended Audience and Reading Suggestion ................................................................... 13
1.7 Document Convention ..................................................................................................... 13
CHAPTER 2..................................................................................................................................... 14
2.1 OVERALL DESCRIPTION ......................................................................................................... 15
2.1.1 Product Perspective ...................................................................................................... 15
2.1.2 Product Features ........................................................................................................... 15
2.1.3 Design and Implementation Constraints..................................................................... 15
2.1.4 Assumption and Dependencies ..................................................................................... 15
2.2 SYSTEM FEATURES ................................................................................................................. 15
2.2.1 System Features 1 ......................................................................................................... 16
2.2.2 System Features 2 ......................................................................................................... 17
2.3 EXTERNAL INTERFACE REQUIREMENT ................................................................................. 17
2.3.1 User Interfaces .............................................................................................................. 17
2.3.2 Hardware Interfaces ...................................................................................................... 17
2.3.3 Software Interfaces ....................................................................................................... 17
2.3.4 Communication Interface ............................................................................................. 17
2.4 OTHER NONFUNCTIONAL REQUIREMENT ............................................................................. 18
2.4.1 Performance Requirements........................................................................................... 18
2.4.2 Safety Requirements ..................................................................................................... 18
2.4.3 Security requirements ................................................................................................... 18
CHAPTER 3..................................................................................................................................... 19
3.1 IDENTIFYING ACTORS AND USE CASES USING TEXTUAL ANALYSIS ..................................... 20
3.2 FORMING USE CAS DIAGRAM WITH CANDIDATE AND USE CASES ....................................... 21
3.3 DESCRIBE THE EVENTS FLOW FOR USE CASE ....................................................................... 23
CHAPTER 4..................................................................................................................................... 29
WBS (Work Breakdown Structure) ....................................................................................... 30
4.1 Architecture Diagram ...................................................................................................... 31
4.2 ERD ................................................................................................................................. 32
4.3 Block Diagram ................................................................................................................. 32
4.4 Data Flow Diagram ......................................................................................................... 35
4.5 Class Diagram.................................................................................................................. 32
4.6 Object Diagram................................................................................................................ 32
4.7 Sequence Diagram ........................................................................................................... 32
4.8 Activity Diagram ............................................................................................................. 40
4.9 Collaboration Diagram .................................................................................................... 42
4.10 State Diagram ................................................................................................................ 46
CHAPTER 5..................................................................................................................................... 47
5.1 Component Diagram........................................................................................................ 48
5.2 Deployment Diagram ...................................................................................................... 49
5.3 Database Architecture...................................................................................................... 50
4
Government College University Faisalabad.
CHAPTER 6..................................................................................................................................... 51
6.1 Test Cases Specification .................................................................................................. 54
6.2 Black Box Testing ........................................................................................................... 57
6.2.1 BVA or Boundary Value Analysis .......................................................................... 57
6.2.2 Equivalence Class Partitioning ................................................................................ 58
6.2.3 State Transition Testing ........................................................................................... 60
6.2.4 Decision Table Testing ............................................................................................ 61
6.2.5 Graph Base Testing .................................................................................................. 63
6.3 White Box Testing ........................................................................................................... 65
WHITE BOX TESTING TECHNIQUES ..................................................................................................... 66
6.3.1 Statement Coverage ...................................................................................................... 67
6.3.2 Branch Coverage .......................................................................................................... 69
6.3.3 Path Coverage ............................................................................................................... 72
CHAPTER 7..................................................................................................................................... 76
7.1 PROGRAMMING LANGUAGES ................................................................................................. 77
7.2 OPERATING ENVIRONMENT ................................................................................................... 78
UI(USER INTERFACE) ................................................................................................................... 79
UI(USER INTERFACE) ADMIN PANEL............................................................................................ 86
REFERENCES ............................................................................................................................... 102
5
Government College University Faisalabad.
LIST OF TABLES
Table 1: Use Case Summary .................................................................................................................. 23
Table 2: Use Case Description for Login ................................................................................................ 24
Table 3: Use Case Description for Logout ............................................................................................. 24
Table 4: Use Case Description for a Donor ............................................................................................ 25
Table 5: Use Case Description for Search Blood.................................................................................... 26
Table 6: Use Case Description for Add Donor Record ........................................................................... 27
Table 7: Use Case Description for Update record ................................................................................. 27
Table 8: Use Case Description for Delete records ................................................................................. 28
Table 9: Use Case Description for Search Record .................................................................................. 28
Table 10: Data Dictionary for BDMS Class ............................................................................................ 33
6
Government College University Faisalabad.
LIST OF FIGURES
Figure 1: Use Case Diagram ........................................................................................................ 22
Figure 2 : WBS (Work Breakdown Structure) .............................................................................. 30
Figure 3: Architecture Diagram ................................................................................................... 31
Figure 4: Entity Relationship Diagram ........................................................................................ 32
Figure 5: Block Diagram .............................................................................................................. 34
Figure 6: LEVEL 0 DFD .............................................................................................................. 35
Figure 7: LEVEL 1 DFD .............................................................................................................. 36
Figure 8: Class Diagram .............................................................................................................. 37
Figure 9: Object Diagram ............................................................................................................ 38
Figure 10: Sequence Diagram ...................................................................................................... 39
Figure 11: Activity Diagram for System ....................................................................................... 40
Figure 12: Activity Diagram for Login......................................................................................... 41
Figure 13: Collaboration Diagram for Blood Seeker .................................................................. 43
Figure 14: Collaboration Diagram for Donor ............................................................................. 44
Figure 15: Collaboration Diagram for Admin ............................................................................. 45
Figure: 16: State Diagram............................................................................................................ 46
Figure: 17: Component Diagram ................................................................................................. 48
Figure: 18: Deployment Diagram ................................................................................................ 49
Figure: 19: Database Architecture ............................................................................................... 50
Figure: 20: Black Box Testing ...................................................................................................... 57
Figure: 21: Boundary Value Analysis .......................................................................................... 58
Figure: 22: Equivalence Class Partitioning ................................................................................. 58
Figure: 23: State Transition Graph .............................................................................................. 60
Figure: 24: State Transition Table ............................................................................................... 61
Figure: 25: Graph Base Testing ................................................................................................... 64
Figure: 26: Branch Coverage ....................................................................................................... 69
Figure: 27: Control Flow Graph .................................................................................................. 71
Figure: 28: Path Coverage ........................................................................................................... 72
Figure: 29: Homepage .................................................................................................................. 79
Figure: 30: Homepage .................................................................................................................. 80
Figure: 31: Become a Donor Page ............................................................................................... 81
Figure: 32: Search Blood Page .................................................................................................... 82
Figure: 33: Why Become Donor Page.......................................................................................... 83
Figure: 34: About Page ................................................................................................................ 84
Figure: 35: Contact Page ............................................................................................................. 85
Figure: 36: Admin LOGIN Page .................................................................................................. 86
Figure: 37: Change Page ............................................................................................................. 87
Figure: 38: Admin Dashboard Page ............................................................................................ 88
Figure: 39: Add Blood Group Page ............................................................................................. 89
Figure: 40: Manage Blood Group Page ....................................................................................... 90
Figure: 41: Add Donor Page ........................................................................................................ 91
Figure: 42: Donor List Page ........................................................................................................ 92
Figure: 43: Donor List (Make Hidden) Page ............................................................................... 93
Figure: 44: Donor List (Delete) Page .......................................................................................... 93
Figure: 45: Donor List (Sorting) Page ......................................................................................... 94
Figure: 46: Donor List (Search) Page.......................................................................................... 94
Figure: 47: Donor List (Pagination) Page ................................................................................... 95
Figure: 48: Download Donor List ................................................................................................ 95
7
Government College University Faisalabad.
8
Government College University Faisalabad.
Chapter 1
Introduction to Problem
9
Government College University Faisalabad.
1.1 INTRODUCTION
Blood is universally recognized as the most precious element that sustains life. It saves
innumerable lives across the world in a variety of conditions. BDMS is a place designed
especially for the people who need blood in emergency situation area wise. The blood
donor information system offers functionalities to quick access to register the donor, and
collected donor details from various parts of the provinces. It enables monitoring of the
results and performance of the blood donation activity such that relevant and measurable
objectives of the organization can be checked. In my system I’m providing the efficient
search who needs the blood in their own city, name, and blood groups as fast as possible.
1.2 Background
Some existing system of blood donation system are manual which cannot upload and
download the latest update and there is no use of web services and remoting. There is no
proper coordination between different systems and users. It consumes lot of manpower for
better results. Retrieval of data takes lot of time and percentage of accuracy is less. It takes
time to produce reports. To debug the existing system, remove procedures those cause data
redundancy, make navigational sequence proper.
The Blood Donor information system is fully computerized system it makes easy to manage
the system by the administrator. And the beginning of this project is research. I mean
researching new things and identify the fact and knowledge about that, focus on the
following areas of study,
Project Documentation
Project Documentation or the Report will give the brief idea about the system which has
been developed by the developers. In the project documentation contain many facts, such
as software development life cycle and each stages, I mean explanation of each stages or
phase and etc.
10
Government College University Faisalabad.
1.3 Purpose
‘’ Blood Donation Management System” is Web based application project and its purpose is
to simplify and automate the process of searching for blood and maintain the records of
blood donors, recipients, blood donation program and blood stocks in the save life system.
There are lots of communication gap among patients (accepting blood), donors (who donate
bold), blood banks and hospitals in our country. Medical facility is not available equally in
every part of the country. If someone needs blood, first of all he searches it within his family
members, then nearest hospitals and blood banks. If they cannot manage blood in these
ways, it is really hard for them to contact other people to collect blood in a short time. That
is the problem we want to solve through our application, Blood Donation Management
System in which electronic information about the donors and organizations related to
donating the blood is created. Through this application, any person interested in donating
blood can register himself as donor. Moreover if any general consumer wants to make
request to have blood online, he can also take the help of this system.
1.4 Scope
Anyone who has ever done a project will have tales of how scope changes caused grief.
Scope is bound to change, and this is to be expected. As the detail becomes clearer, more
complications creep in. These are not foreseeable at the start and hopefully I build in a
contingency for what we cannot see. The scope changes that usually cause problems are
those where the perception of what was in and out of scope was different between various
parties.
The Scope of the project mean normally expecting the result of something. Scope is same
like the motivation and objectives. But there some more special in this case. Scope is really
expecting, as we take our system, we have to think why we are using computerized system
rather other paper base, and we have to think what purpose of that system.
Why we need computerized system, actually today’s world we can’t maintain or manage the
things without proper system or computer. Now computers are merge with our life. So, the
computer-based systems are very popular, and that’s very secure rather than paper base
system. If we tell one example there were happened a flood disaster, and all the paper-
based records can be Drench to the water. Then we cannot recover the important
information. This kind of situation we can recover the information by using computerized
system. Just remove the hard disk and recover the file easily
11
Government College University Faisalabad.
And security is high, because using computerized system is not allow to use any peoples
without their accounts or authorized permission. So, the paper base is not like that, anyone
can see the information and they can do for that information whatever they want.
As my project also a computerized system called Blood Donor Information System. This
system can be used in the hospitals, blood donor camps, or any other important public
places, and etc.
Blood Donor Information System will be more use full for the important medical places,
because if someone need blood immediately, the system will help to identify the blood
donor, and it will be sending a SMS to that donor. So, it will be making a quick
communication with donors. As I told earlier the purpose of this system is send SMS to the
donors in the critical situation.
My initial thought is that this scope statement completely lacks any of the SMART goal
features. SMART stands for
• Specific
• Measurable
• Agreed Upon
• Realistic
• Time Bound
1.5 Objective
Goals and objectives are statements that describe what the project will accomplish.
Objectives are lower-level statements that describe the specific, tangible products and
deliverables that the project will deliver. Objectives are concrete statements describing
what the project is trying to achieve. The objective should be written at a lower level, so
that it can be evaluated at the conclusion of a project to see whether it was achieved or not.
Goal statements are designed to be vague. Objectives should not be vague. A well-worded
objective will be Specific, Measurable, Attainable/Achievable, Realistic and Time-bound.
Nowadays hackers and intruders are very disturbance for any kind of system, such as
Standalone or Web based Systems. So this system is very secures rather than other systems.
And the earlier day’s hospitals and blood camps were used paper base recording system.
Even though today also they all using Paper recording system. What I’m trying to say is
paper records are not secures, because any one can see the donors personal details without
authorized permission, if any natural disaster happened I mean flood or something
happened then we can’t sure papers are safe in that place. And there are more and more
disadvantages using paper records.
12
Government College University Faisalabad.
If we are using Computerized or Database record will be more secured. Anyone cannot see
or update the records without authorized permission. It will be more useful, and the blood
camp authorized people can handle these problems just simply. Because they all are the
people really going to be use this system. Some main objectives of this project,
• To computerize all details regarding blood donor details & events details.
• To maintain records effectively.
• To manage current blood group of the donors and maintaining new events.
• The project has information regarding the fresh blood donors, already registered
blood donor details, events, creating new events details and sending SMS to already
registered blood donors in the system.
• Creating New Admin for the System, only from admin privilege.
• The valuable data can be kept as secure.
• Creating new events to display about when next blood camp? , and where?
This application is made for patients. The stakeholder for this application is admin or a
company an organization that hold the information of patients and donors. The end user for
this application are patients that need the blood.
• Public
• Hospitals
• Blood Banks
This document will use IEEE format. For clarity, acronyms and technical jargon, deemed
uncommon by the author, will be annotated and included in glossary. The format for
heading is as followed: major headings are in bold 14px font, and concurrent headings are in
bold 12px font.
13
Government College University Faisalabad.
Chapter 2
14
Government College University Faisalabad.
• Login
• Donate
• Request
• Logout
• Contact
15
Government College University Faisalabad.
Admin login and get his respective panels. For login give the name and password.
Search donor
Add Donor
16
Government College University Faisalabad.
17
Government College University Faisalabad.
Knowledge based Rules. Moreover, the Web-based system provides more suitable
application for health care and life saving processes. This system can be extended to other
welfare societies and health organizations. The system would implement a database
interface in the form of queries that would interact with the back-end (database) for
transactions. An OS which is capable of running a modern web browser which supports Php
and HTML5
18
Government College University Faisalabad.
Chapter 3
Analysis
(Use Case Model)
19
Government College University Faisalabad.
Use Case
A use case analysis is the primary form for gathering usage requirements
for a new software program or task to be completed.
Use case plays a significant role in the distinct phases of the Software Development Life
Cycle. Use Case depends on ‘User Actions’ and ‘Response of System’ to the User Actions. It
is the documentation of the ‘Actions’ performed by the Actor/User and the corresponding
‘Behavior’ of the System to the User ‘Actions’. Use Cases may or may not result in achieving
a goal by the ‘Actor/User’ on interactions with the system. In Use Case, we will describe
‘How a System will respond to a given Scenario?’ It is ‘user-oriented’ not ‘system-oriented’.
It is ‘user-oriented’: We will specify ‘what are the actions done by the user?’ and ‘What the
Actors see in a system?’
It is not ‘system-oriented’: We will not specify ‘What are the input given to the system?’
and ‘What are the output produced by the system?’
• Actors
• Admin
Preconditions
• There is an active network connection.
• Application graphical Interface must be available.
Post-conditions
• Successful Completion
Failure Condition
• The logs have been updated accordingly
20
Government College University Faisalabad.
3.2 Forming Use Cas Diagram with Candidate and Use cases
Use case model consists of three things: actors, use cases, use case diagram.
Actors
An actor is a direct external user of a system, an object or set of objects that communicates
directly with system but that is not part of the system. Each actor represents those objects
that behave way towards the system.
Use Cases
A use case is a coherent piece of functionality that a system can provide by interacting with
various actors. Each use case involves one or more actors as well as the system itself. The
actor needs not all be the persons.
A use case involves a sequence of messages among the system and its actors. Some use
cases have a fixed sequence of messages. More often, however, the message sequence may
have some variations.
A system involves a set of use cases and a set of actors. Each use case represents a slice of
the functionality the system provides. The set of use cases shows the complete functionality
of the system at some level of detail. Similarly, each actor represents one kind of object for
which the system can perform behavior. The set of actors represents the complete set of
objects that the system can serve. Objects accumulate behavior from all the systems with
which they interact as actors.
The system involves a set of use cases like add record, search record, update record, delete
record and some other mention in use diagram with actors like Administrator and User.
Simply use cases define; in how many ways a system can be used or in how many ways a
system can act. Use cases show the complete functionality of the system that it provides.
Use case diagram is used to capture the dynamic nature of a system. It consists of use cases,
actors and their relationships. It is used at a high-level design to capture the requirements of
a system.
21
Government College University Faisalabad.
Become Donor
Search Blood
Add Donor
Manage Contact us
Queties
Manage Pages
Change Password
About Us
Contact Us
Logout
22
Government College University Faisalabad.
23
Government College University Faisalabad.
24
Government College University Faisalabad.
Become a donor
Exception Canceled: If the user press the cancel button instead of save button the ad
Generate program will canceled.
Missing filed: If any text box field is empty the system will ask to enter the data
in all mandatory fields.
Exit: If the Register user press the button exit or ALT+F4 from keyboard during
insertion process without pressing the button system will be closed and record
will not be inserted.
Post Condition After successfully become the donor the system prompted a successfully
message.
25
Government College University Faisalabad.
Search Blood
26
Government College University Faisalabad.
Add Donor
Update record
27
Government College University Faisalabad.
Delete record
Search Record
Exceptions: If system has no record so admin and user cannot find the record.
Post condition User and admin will easily search the record.
28
Government College University Faisalabad.
Chapter 4
Design
29
Government College University Faisalabad.
1.
BLOOD DONATION MANAGEMENT SYSTEM
1.2.1
1.1.3
1.1.1 1.1.2 1.1.4 Personal Details 1.3.1
MANAGE
AUTHENTICATION MANAGE DONOR MANAGE PAGES SEARCH BLOOD
QUERIES
1.2.2
Contact Detail 1.3.2
1.1.2.1 1.1.3.1 1.1.4.1
1.1.1.1 ADD DONOR READ Edit Blood Group
Login
1.2.3
Blood Group 1.3.3
1.1.2.2 1.1.3.2
1.1.1.2 DELETE DONOR DELETE Location
Logout
1.2.4
Contact 1.3.4
1.1.2.3 Contact with
1.1.1.3 HIDE & PUBLIC Donor
Change Password
1.3.5
Contact with
Admin
30
Government College University Faisalabad.
31
Government College University Faisalabad.
4.2 ERD
32
Government College University Faisalabad.
Data dictionary for all modeling elements help designers to understand the meaning and
purpose of all modeling elements. Figure below presents a data dictionary for OBDS classes:
33
Government College University Faisalabad.
ADMIN USER
Donor Requestor
Cloud Server
34
Government College University Faisalabad.
Level 0 DFD
Level 0 DFDs, also known as context diagrams, are the most basic data flow diagrams. They provide a
broad view that is easily digestible but offers little detail. Level 0 data flow diagrams show a single
process node and its connections to external entities.
PERSONAL INFORMATION
DONOR
BLOOD BLOOD INFORMATION
DONATION
ADMIN
RECEIVE REQUEST
RECEIPT
DONOR INFORATION
35
Government College University Faisalabad.
Level 1 DFD
Level 1 DFDs are still a general overview, but they go into more detail than a context diagram. In a
level 1 data flow diagram, the single process node from the context diagram is broken down into
subprocesses. As these processes are added, the diagram will need additional data flows and data
stores to link them together.
36
Government College University Faisalabad.
Manages
+1....M
ADMIN INVENTORY
DONOR
-adminname: varchar -blood_ID: varchar
-adminpassword: varchar -admin_ID: varchar -name: varchar
-fathername: varchar add to -blood_qty: varchar -email: date
+1...M Donate
-accountdate: date -date: date -age: date
-cnic: varchar +store() -phoneno: varchar
Manages -phoneno: varchar -gender: varchar
-email: varchar -address: varchar
+Login() -bloodgroup: varchar
+Logout() +donate()
+Search()
M...M
+addRecord()
+deleteRecord() 1...1
+managepages()
+update()
+addDonor()
+1...M TESTER
-blood_ID: varchar
BLOOD
-blood_group:varchar
REQUESTOR +test() -bloodquantity: varchar
-bloodgroup: varchar
-bloodgroup: varchar +inventory ()
-address: varchar
+Search()
+requestforblood()
+contact()
M....M
Need
37
Government College University Faisalabad.
+1....M
Manages
MOHSIN: ADMIN
INVENTORY
d1: DONOR
-adminname: admin
-adminpassword: 123456 -blood_ID: 001
-fathername: ahmad -admin_ID: A1 -name: Ali
add to -email: abc@gmail.com
-accountdate: 12-oct-2021 -blood_qty: 1 Pack Donate
-cnic: 3530252698987 -date: 12-oct-2021 -age: 21
-phoneno: 03002323323 -phoneno: 03002565656
Manages +store()
-email: admin@gmail.com -gender: male
-address: okara
+Login()
-bloodgroup: O+
+Logout()
+donate()
M...M
+Search()
+addRecord() 1...1
+deleteRecord()
+managepages()
+update() LAB: TESTER
+addDonor()
+1...M
-blood_ID: 001 BLOOD
PERSON: REQUESTOR -blood_group:O+
+test() -bloodquantity: 1 Pack
-bloodgroup: O+ -bloodgroup: O+
-address: Depalpur +inventory ()
+Search()
+requestforblood()
+contact()
M....M
Need
38
Government College University Faisalabad.
Donor userid
Login
Requester userid
Request Blood
Status
View Requests
Receipt
View Request
Check Status
Status
39
Government College University Faisalabad.
Activity Diagram describes the dynamic aspects of the system. Activity diagram is a
flowchart to represent the flow from one activity to another activity. The activity can be
described as an operation of the system. Activity diagrams deal with all type of flow control
by using different elements such as fork, join, etc.
4.8.1 Activity Diagram for system
40
Government College University Faisalabad.
41
Government College University Faisalabad.
Introduction
Specification level
It shows the generic case of collaboration. The diagram shows classifier (class) roles,
association roles and messages.
Instance level
It shows a specific instance of an interaction taking place and involving specific object
instances. The diagram shows objects, links and stimuli.
42
Government College University Faisalabad.
Blood Seeker
43
Government College University Faisalabad.
Blood Donor
44
Government College University Faisalabad.
Super Admin
45
Government College University Faisalabad.
A state diagram is a type of diagram used in computer science and related fields to describe
the behavior of systems. State diagrams require that the system described is composed of a
finite number of states; sometimes, this is indeed the case, while at other times this is a
reasonable abstraction. Many forms of state diagrams exist, which differ slightly and have
different semantics.
46
Government College University Faisalabad.
Chapter 5
Implementation
47
Government College University Faisalabad.
48
Government College University Faisalabad.
49
Government College University Faisalabad.
• First Tier: The Interface As viewed from the client’s web browser, the interface is
build by HTML pages with Java Script support.
• Second Tier: Web Server For this system, an Apache web server is used with the PHP
module to support the back ends in third tier. The PHP scripts will process the user
input, generate SQL queries to access the database and then the Apache will compile
and execute the output in dynamically generated HTML pages.
• Third Tier: Database Server In the third tier, the MySQL database server will receives
requests from the second tier to execute SQL statements. The server accesses the
database files to retrieve the stored data and then sends the queried data back.
50
Government College University Faisalabad.
Chapter 6
Testing
(Software Quality Attributes)
51
Government College University Faisalabad.
Testing
Testing is intended to show that a program does what it is intended to do and to discover
program defects before it is put into use. When you test software, you execute a program
using artificial data. You check the results of the test run for errors, anomalies, or
information about the programs non-functional attributes.
The testing process has two distinct goals:
• To demonstrate the developer and the customer that the software meets its
requirements. For custom software, this means that there should be at least one test for
every requirement in the requirements document. For generic software products, it
means that there should be tests for all the system features, plus combination of these
features, that will be incorporated in the product release.
• To discover situation in which the behavior of the software is incorrect, undesirable, or
does not conform to its specification. There are consequences of software defects.
Defects testing is concerned with rooting out undesirable system behavior such as
system crashes, unwanted interactions with other systems, incorrect computations and
data corruption.
Development Testing
Development testing includes all testing activities that are carried out by the team
developing the system. The tester of the software is usually the programmer who developed
that software, although this is not always the case. Some development processes use
programmer/tester pairs (Casamino and Selby, 1998) where each programmer has an
associated tester who develops tests and assists with the testing process. For critical
systems, a more formal process may be used, with a separate testing group within the
development team. They are responsible for developing tests and maintaining detailed
records of test results.
During development, testing may be carried out at three levels of granularity:
• Unit testing
where individual program units or object classes are tested. Unit testing should focus on
testing the functionality of objects or methods.
• Component testing,
52
Government College University Faisalabad.
Unit Testing
Unit testing is the process of testing program components, such as methods or object
classes. Individual functions or methods are the simplest type of component. Your tests
should be calls to these routines with different input parameters.
When you are testing object classes, you should design your tests to provide coverage of all
the features of the object. This means that you should:
• Test all operations associated with the object
• Test and check the value of all attributes associated with the object
• Put the object into all possible states.
This means that you should simulate all events that cause a state change.
Components Testing
Software components are often composite components that are made up of several
interacting objects. For example, in the weather station system, the reconfiguration
component includes objects that deal with each aspect of the reconfiguration. You access
the functionality of these objects through the defined component interface. Testing
composite components should therefore focus on showing that the component interface
behaves according to its specification. You can assume that unit tests on the individual
objects within the component have been completed.
System Testing
User Testing
User or customer testing is a stage in the testing process in which users or customers
provide input and advice on system testing. This may involve formally testing a system that
has been commissioned from an external supplier, or could be an informal process where
users experiment with a new software product to see if they like it and that it does what
they need. User testing is essential, even when comprehensive system and release testing
have been carried out. The reason for this is that influences from the user’s working
environment have a major effect on the reliability, performance, usability, and robustness of
a system.
53
Government College University Faisalabad.
Testing is expensive and time consuming, so it is important that you choose effective unit
test cases. Effectiveness, in this case, means two things:
The test cases should show that, when used as expected, the component that you are
testing does what it is supposed to do. If there are defects in the component, these should
be revealed by test cases. You should therefore write two kinds of test case. The first of
these should reflect normal operation of a program and should show that the component
works. For example, if you are testing a component that creates and initializes a new patient
record, then your test case should show that the record exists in a database and that its
fields have been set as specified. The other kind of test case should be based on testing
experience of where common problems arise. It should use abnormal inputs to check that
these are properly processed and do not crash the component.
Alternate flow of Events: System is shut down, leaves some mandatory details missing
or quits the system.
Actual Results: Admin successfully log in and can use system functions
accordingly.
Expected Results: Log in is carried successfully.
Actor: Admin.
Bugs, Errors: None
Estimated time: Less than 1 second.
54
Government College University Faisalabad.
Actor: User
Bugs, Errors: None
Estimated time: Less than 1 second.
55
Government College University Faisalabad.
56
Government College University Faisalabad.
Black Box Testing is a software testing method in which the functionalities of software
applications are tested without having knowledge of internal code structure,
implementation details and internal paths. Black Box Testing mainly focuses on input and
output of software applications and it is entirely based on software requirements and
specifications. It is also known as Behavioural Testing.
57
Government College University Faisalabad.
Example: Suppose the application you are testing accept values in the character limit of 1 – 100
only. Here, there would be three partitions: one valid partition and two invalid partitions.
1.Pressman Rule:
Rule 1: If input is a range of values, then design test cases for one valid and two invalid
values.
58
Government College University Faisalabad.
For example
2.Practice Method:
If the input is a range of values, then divide the range into equivalent parts. Then test for all
the valid values and ensure that 2 invalid values are being tested for.
For example:
Note:
• If there is deviation in between the range of values, then use Practice Method.
• If there is no deviation between the range of values, then use Pressman Rule.
59
Government College University Faisalabad.
Example 2:
In the flight reservation login screen, consider you have to enter correct agent name and
password to access the flight reservation application.
The application allows three attempts, and if users enter the wrong password at 4th
attempt, the system closes the application automatically.
The State Graphs helps you determine valid transitions to be tested. In this case, testing
with the correct password and with an incorrect password is compulsory. For the test
scenarios, log-in on 2nd, 3rd and 4th attempt anyone could be tested.
60
Government College University Faisalabad.
In a State Table, all the valid states are listed on the left side of the table, and the
events that cause them on the top.
Each cell represents the state system will move to when the corresponding event
occurs.
For example, while in S1 state you enter a correct password you are taken to state
S6 (Access Granted). Suppose if you have entered the wrong password at first
attempt you will be taken to state S3 or 2nd Try.
Two invalid states are highlighted using this method. Suppose you are in state S6
that is you are already logged into the application, and you open another instance
of flight reservation and enter valid or invalid passwords for the same agent.
System response for such a scenario needs to be tested.
Decision Table Testing is a software testing methodology used to test system behavior for
various input combinations. In this systematic approach, the several input combinations and
their corresponding system behavior are represented in tabular form. The decision table is
also called a Cause-Effect table, as the causes and effects for comprehensive test coverage
are captured in this table. Decision Table testing is a commonly used black-box testing
technique and is ideal for testing two or more inputs that have a logical relationship.
61
Government College University Faisalabad.
A decision table is a tabular representation of inputs vs cases, rules and test conditions.
Example 1:
In this example, we see how to create the decision table for a login screen that asks for
UserId and Password.
The condition here is that the user will be redirected to the homepage if he enters the
correct user name and password, and an error message will be displayed if the input is
wrong.
Username (T/F) F T F T
Password (T/F) F F T T
Output (E/H) E E E H
Legend:
T- Correct username or password
F- Wrong username or password
E- Error message is displayed.
H – Home screen is displayed.
62
Government College University Faisalabad.
• Enter the wrong username, wrong password, and click on login. The expected result is
that the user should get an error message.
For graph based testing firstly, the tester is asked to collect the data for graph model and
then cover all the elements for a particular graph. In this process of testing, the tester is first
assigned by the responsibility of creating a graph followed by other steps. These are
discussed next.
As we know software application is made up of some objects. These objects are identified
and graph is prepared.
It was earlier used for hardware testing but now it is introduced to the software testing.
Various testing methods in the software testing includes: static vs. dynamic testing and the
box approach includes white box testing, black box testing, specification based testing,
visual testing and grey box testing. Cause and effect testing comes under the graph based
testing that forms a part of black box testing. In this type of testing, one can choose the test
case that relates to cause and effect.
Here, cause represents the input condition that gives information about the internal change
in the system whereas effect refers to the output conditions or the transformation of the
system.
63
Government College University Faisalabad.
• It highlights the area from which the data is taken and can be taken for additional
studies.
• It helps in motivating the team.
• The data is arranged in such manner that even a non-technical person can also read it.
• It helps in detecting the reason of differences occurred in a process.
• It helps the team to decide the root reason of a problem.
• It is very appropriate for large systems.
Disadvantages of using cause effect graph are as follows:
• Difficult to design.
• It is difficult to choose the important input in limited time.
• There can be chances where path of drawing the graphs is not clear.
• There are chances of repetition of data already entered in the graph.
It comes under the category of black box testing in software testing. Mostly cause effect
graphs are helpful in testing as they are easy to understand and displays the parameters of
the advantages and disadvantages of a programme. This graph usually shows the nodes
which represent causes on the left side and the nodes representing effects on the right side.
The intermediate nodes present between the effect and cause combines input using the
commonly used logical operators AND/ OR. Constrains can also be added to the causes and
effect sides. These are represented by edges tagged with the constrain symbol using a
dotted line.
64
Government College University Faisalabad.
White Box Testing is software testing technique in which internal structure, design and
coding of software are tested to verify flow of input-output and to improve design, usability
and security. In white box testing, code is visible to testers so it is also called Clear box
testing, Open box testing, Transparent box testing, Code-based testing and Glass box
testing.
It is one of two parts of the Box Testing approach to software testing. Its counterpart,
Blackbox testing, involves testing from an external or end-user type perspective. On the
other hand, White box testing in software engineering is based on the inner workings of an
application and revolves around internal testing.
The term “WhiteBox” was used because of the see-through box concept. The clear box or
WhiteBox name symbolizes the ability to see through the software’s outer shell (or “box”)
into its inner workings. Likewise, the “black box” in “Black Box Testing” symbolizes not
being able to see the inner workings of the software so that only the end-user experience
can be tested.
The testing can be done at system, integration and unit levels of software development.
One of the basic goals of Whitebox testing is to verify a working flow for an application. It
involves testing a series of predefined inputs against expected or desired outputs so that
when a specific input does not result in the expected output, you have encountered a bug.
65
Government College University Faisalabad.
application, the tester must be very knowledgeable in the programming languages used in
the applications they are testing. Also, the testing person must be highly aware of secure
coding practices. Security is often one of the primary objectives of testing software. The
tester should be able to find security issues and prevent attacks from hackers and naive
users who might inject malicious code into the application either knowingly or unknowingly.
There are automated tools available to perform Code coverage analysis. Below are a few
coverage analysis techniques a box tester can use:
Statement Coverage:- This technique requires every possible statement in the code to be
tested at least once during the testing process of software engineering.
Branch Coverage – This technique checks every possible path (if-else and other
conditional loops) of a software application.
66
Government College University Faisalabad.
Apart from above, there are numerous coverage types such as Condition Coverage,
Multiple Condition Coverage, Path Coverage, Function Coverage etc. Each technique has
its own merits and attempts to test (cover) all parts of software code. Using Statement
and Branch coverage you generally attain 80-90% code coverage which is sufficient.
• Statement Coverage
• Decision Coverage
• Branch Coverage
• Condition Coverage
• Multiple Condition Coverage
• Finite State Machine Coverage
• Path Coverage
• Control flow testing
• Data flow testing
67
Government College University Faisalabad.
So, this is the basic structure of the program, and that is the task it is going to do.
Now, let's see the two different scenarios and calculation of the percentage of
Statement Coverage for given source code.
Scenario 1:
If a = 5, b = 4
In scenario 1, we can see the value of sum will be 9 that is greater than 0 and as per
the condition result will be "This is a positive result." The statements highlighted in
yellow color are executed statements of this scenario.
To calculate statement coverage of the first scenario, take the total number of
statements that is 7 and the number of used statements that is 5.
68
Government College University Faisalabad.
Branch coverage technique is used to cover all branches of the control flow graph. It covers
all the possible outcomes (true and false) of each condition of decision point at least once.
Branch coverage technique is a whitebox testing technique that ensures that every branch
of each decision point must be executed.
However, branch coverage technique and decision coverage technique are very similar, but
there is a key difference between the two. Decision coverage technique covers all branches
of each decision point whereas branch testing covers all branches of every decision point of
the code.
In other words, branch coverage follows decision point and branch coverage edges. Many
different metrics can be used to find branch coverage and decision coverage, but some of
the most basic metrics are: finding the percentage of program and paths of execution during
the execution of the program.
Like decision coverage, it also uses a control flow graph to calculate the number of
branches. find Nth Highest Salary in SQL
69
Government College University Faisalabad.
There are several methods to calculate Branch coverage, but pathfinding is the most
common method.
In this method, the number of paths of executed branches is used to calculate Branch
coverage. Branch coverage technique can be used as the alternative of decision coverage.
Somewhere, it is not defined as an individual technique, but it is distinct from decision
coverage and essential to test all branches of the control flow graph.
1. Read X
2. Read Y
3. IF X+Y > 100 THEN
4. Print "Large"
5. ENDIF
6. If X + Y<100 THEN
7. Print "Small"
8. ENDIF
This is the basic code structure where we took two variables X and Y and two
conditions. If the first condition is true, then print "Large" and if it is false, then go to
the next condition. If the second condition is true, then print "Small."
70
Government College University Faisalabad.
In the above diagram, control flow graph of code is depicted. In the first case traversing
through "Yes "decision, the path is A1-B2-C4-D6-E8, and the number of covered edges is 1,
2, 4, 5, 6 and 8 but edges 3 and 7 are not covered in this path. To cover these edges, we
have to traverse through "No" decision. In the case of "No" decision the path is A1-B3-5-D7,
and the number of covered edges is 3 and 7. So by traveling through these two paths, all
branches have covered.
Path 1 - A1-B2-C4-D6-E8
Path 2 - A1-B3-5-D7
Branch Coverage (BC) = Number of paths
=2
71
Government College University Faisalabad.
Yes 1, 2, 4, 5, 6, 8 A1-B2-C4-D6-E8 2
No 3,7 A1-B3-5-D7
Path coverage is concerned with linearly independent paths through the code. Testers draw
a control flow diagram of the code, such as the example below.
72
Government College University Faisalabad.
In this example, there are several possible paths through the code:
• 1, 2
• 1, 3, 4, 5, 6, 8
• 1, 3, 4, 7, 6, 8
• etc.
In a path coverage approach, the tester writers unit tests to execute as many as possible of
the paths through the program’s control flow. The objective is to identify paths that are
broken, redundant, or inefficient.
Scenario 1:
As said earlier, Path coverage is used to test the complex code snippets, which basically
involve loop statements or combination of loops and decision statements.
END IF
IF A>50
PRINT “ITS PENDING”
END IF
How? Simply – there are 2 decision statements, so for each decision statement, we would
need two branches to test. One for true and the other for the false condition. So for 2
decision statements, we would require 2 test cases to test the true side and 2 test cases to
test the false side, which makes a total of 4 test cases.
To simplify these let’s consider below flowchart of the pseudo code we have:
73
Government College University Faisalabad.
In order to have the full coverage, we would need following test cases:
74
Government College University Faisalabad.
75
Government College University Faisalabad.
Chapter 7
76
Government College University Faisalabad.
Front-End:
✓ HTML
✓ CSS
✓ Bootstrap
✓ JQuery
✓ JS
Back-End:
✓ PHP
Database
✓ MYSQL
77
Government College University Faisalabad.
Microsoft Visio
- Introduced by Microsoft Corporation.
- Help to draw the software related diagrams.
Adobe Photoshop
- Introduced by Adobe.
- Help to create nice artistic, and editing works.
78
Government College University Faisalabad.
First, when a user types the URL of BDMS, the landing page would be the home of BDMS. In
this page, there is header, slider, and some other details which will be updated.
UI(User Interface)
Figure show the home or landing page of BDMS. However there will be some modification
later. There will be Navbar and multiple menus like: Search Blood, Donate Blood, About,
Contact which are set by Administrator. The latest announcement will be accessible by
committee of BDMS for them to put anything up.
79
Government College University Faisalabad.
Figure show the home or landing page of BDMS. After scroll down Donors list will shown on
home screen also, which only include name and Blood Group. Further details can be access
from search blood page.
80
Government College University Faisalabad.
Figure show the page where a user can donate his blood. Donor should have to fill form in
which following fields are required:
• Full Name
• Mobile No
• Email ID
• AGE
• Gander
• Blood Group
• Address
• Message
81
Government College University Faisalabad.
Figure show the page where a user who need blood can contact to donor. Donor details of
same blood group persons will be shown on screen. Requestor need to input:
• Blood Group
• Location
82
Government College University Faisalabad.
Figure show the page where a user can see motivational lines about “Why Donate Blood”.
So the access to show the page is owned by Administrator. It only can be edited by Admin.
83
Government College University Faisalabad.
❖ About Page:
Figure show the page where the data about organization and all the staff shown. So the
access to show the page is owned by Administrator. It only can be edited by Admin.
84
Government College University Faisalabad.
❖ Contact Page:
Figure show the page where the form appears. From this page user can send queries /
message to admin, which will respond back by Admin. This form required fields:
• Full Name
• Phone No
• Email
• Message
85
Government College University Faisalabad.
First, when a Admin types the URL of BDMS, the landing page would be the home of BDMS.
❖ Login Form:
86
Government College University Faisalabad.
❖ Change Password:
After login, authenticated admin will be redirected to change password page as Figure 6.
From there you can change your password or you can also skip it. This function is enabled
for the user to change the password if needed.
87
Government College University Faisalabad.
❖ Admin’s Dashboard:
After login, authenticated user will be redirected to dashboard page as Figure which acts as
admin’s main navigation page. There would be several interfaces for different user
depending on the access level. This interface have many functionalities in the sidebar.
▪ Dashboard
▪ Blood Group
▪ Add Donor
▪ Donor List
▪ Manage Contact Queries
▪ Manage Pages
▪ Update Contact Info.
88
Government College University Faisalabad.
❖ Blood Group:
Under the Dashboard menu, there is Blood Group menu shown. Click on this, two options
appears:
When admin click on Add Blood Group, a form field appear. In input field we insert
Blood Group. This page is linked with Manage Blood Group page.
89
Government College University Faisalabad.
When admin click on Manage Blood Group, all Listed Blood Groups list appear which
was inserted by Add Blood Group function in Fig
Functionalities:
➢ Sorting
➢ Searching
➢ Pagination
90
Government College University Faisalabad.
❖ Add Donor:
We have seen that a Donor enter his/her detail himself. But Admin also can input details
of Donor by clicking “Add Donor” function.
• Full Name
• Mobile no
• Email ID
• Age
• Gender
• Blood Group
• Address
• Message
After submission it all the information will stored in Donor List Fig .
91
Government College University Faisalabad.
❖ Donor List:
All the Donor’s data will be shown in the form of table. (Rows & Columns)
A table include:
• Serial no
• Name
• Mobile no
• Email
• Age
• Gender
• Blood Group
• Address
• Message
• Action
Functionalities:
➢ Make Hidden
Admin can hide the details from user by simply click “Make Hidden” and then he
details of that donor will hide from user side. And a message appears “Booking
successfully canceled”.
After that when admin want, he can make “public again”.
92
Government College University Faisalabad.
➢ Delete
Admin can permanently delete the details from user by simply click “Delete” and
then the data of that donor will delete permanently. And a message appears “Record
Deleted Successfully”
93
Government College University Faisalabad.
➢ Sorting
Admin can sort the details of donors by every entity individually by clicking double
arrow icon.
➢ Search
Admin can search the donor from search box. Admin can:
• Search by Serial No.
• Search by Name
• Search by Email
• Search by Mobile no
• Search by age
• Search by gender
• Search by blood group
• Search by address
• Search by message
94
Government College University Faisalabad.
➢ Pagination
All the data of donor data shown in a sequence of pages which are connected and
have similar content.
95
Government College University Faisalabad.
✓ After clicking “Download Donor List”, file will start download Excel File.
All the queries which are performed by users will show here in the form of table (rows &
columns).
A table include:
• Serial no
• Name
• Mobile no
• Email
• Message
• Posting Date
• Action
96
Government College University Faisalabad.
Functionalities:
97
Government College University Faisalabad.
➢ Sorting
Admin can sort the details of queries by every entity individually by clicking double
arrow icon.
➢ Search
Admin can search the queries from search box. Admin can:
• Search by Serial No.
• Search by Name
• Search by Email
• Search by Mobile no
• Search by message
• Search by date
98
Government College University Faisalabad.
➢ Pagination
All the data of user queries data shown in a sequence of pages which are connected
and have similar content.
❖ Manage Pages:
Admin can edit or delete the content of pages which are displayed on user side:
• About
• Why Become Donor
99
Government College University Faisalabad.
100
Government College University Faisalabad.
• Address
• Email ID
• Contact Number
101
Government College University Faisalabad.
References
102