Modeling and Predicting Cyber Hacking BR

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 78

MODELING AND PREDICTING CYBER

HACKING BREACHES

ABSTRACT:
Analyzing cyber incident data sets is an important method for
deepening our understanding of the evolution of the threat situation. This
is a relatively new research topic, and many studies remain to be done.
In this paper, we report a statistical analysis of a breach incident data set
corresponding to 12 years (2005–2017) of cyber hacking activities that
include malware attacks. We show that, in contrast to the findings
reported in the literature, both hacking breach incident inter-arrival times
and breach sizes should be modeled by stochastic processes, rather than
by distributions because they exhibit autocorrelations. Then, we propose
particular stochastic process models to, respectively, fit the inter-arrival
times and the breach sizes. We also show that these models can predict
the inter-arrival times and the breach sizes. In order to get deeper
insights into the evolution of hacking breach incidents, we conduct both
qualitative and quantitative trend analyses on the data set. We draw a set
of cybersecurity insights, including that the threat of cyber hacks is
indeed getting worse in terms of their frequency, but not in terms of the
magnitude of their damage.
ARCHITECTURE:

EXISTING SYSTEM:
The present study is motivated by several questions that have not been
investigated until now, such as: Are data breaches caused by cyber-
attacks increasing, decreasing, or stabilizing? A principled answer to this
question will give us a clear insight into the overall situation of cyber
threats. This question was not answered by previous studies.
Specifically, the dataset analyzed in [7] only covered the time span from
2000 to 2008 and does not necessarily contain the breach incidents that
are caused by cyber-attacks; the dataset analyzed in [9] is more recent,
but contains two kinds of incidents: negligent breaches (i.e., incidents
caused by lost, discarded, stolen devices and other reasons) and
malicious breaching. Since negligent breaches represent more human
errors than cyber-attacks, we do not consider them in the present study.
Because the malicious breaches studied in [9] contain four sub-
categories: hacking (including malware), insider, payment card fraud,
and unknown, this study will focus on the hacking sub-category (called
hacking breach dataset thereafter), while noting that the other three sub-
categories are interesting on their own and should be analyzed
separately. Recently, researchers started modeling data breach incidents.
Maillart and Sornette studied the statistical properties of the personal
identity losses in the United States between year 2000 and 2008. They
found that the number of breach incidents dramatically increases from
2000 to July 2006 but remains stable thereafter. Edwards et al. analyzed
a dataset containing 2,253 breach incidents that span over a decade
(2005 to 2015). They found that neither the size nor the frequency of
data breaches has increased over the years. Wheatley et al., analyzed a
dataset that is combined from corresponds to organizational breach
incidents between year 2000 and 2015. They found that the frequency of
large breach incidents (i.e., the ones that breach more than 50,000
records) occurring to US firms is independent of time, but the frequency
of large breach incidents occurring to non-US firms exhibits an
increasing trend.

PROPOSED SYSTEM:
In this paper, we make the following three contributions. First, we
show that both the hacking breach incident interarrival times (reflecting
incident frequency) and breach sizes should be modeled by stochastic
processes, rather than by distributions. We find that a particular point
process can adequately describe the evolution of the hacking breach
incidents inter-arrival times and that a particular ARMA-GARCH model
can adequately describe the evolution of the hacking breach sizes, where
ARMA is acronym for “AutoRegressive and Moving Average” and
GARCH is acronym for “Generalized AutoRegressive Conditional
Heteroskedasticity.”We show that these stochastic process models can
predict the inter-arrival times and the breach sizes. To the best of our
knowledge, this is the first paper showing that stochastic processes,
rather than distributions, should be used to model these cyber threat
factors. Second, we discover a positive dependence between the
incidents inter-arrival times and the breach sizes, and show that this
dependence can be adequately described by a particular copula. We also
show that when predicting inter-arrival times and breach sizes, it is
necessary to consider the dependence; otherwise, the prediction results
are not accurate. To the best of our knowledge, this is the first work
showing the existence of this dependence and the consequence of
ignoring it. Third, we conduct both qualitative and quantitative trend
analyses of the cyber hacking breach incidents. We find that the
situation is indeed getting worse in terms of the incidents inter-arrival
time because hacking breach incidents become more and more frequent,
but the situation is stabilizing in terms of the incident breach size,
indicating that the damage of individual hacking breach incidents will
not get much worse. We hope the present study will inspire more
investigations, which can offer deep insights into alternate risk
mitigation approaches. Such insights are useful to insurance companies,
government agencies, and regulators because they need to deeply
understand the nature of data breach risks.

ALGORITHM:
SUPPORT VECTOR MACHINE
“Support Vector Machine” (SVM) is a supervised machine learning
algorithm which can be used for both classification and regression
challenges. However, it is mostly used in classification problems. In this
algorithm, we plot each data item as a point in n-dimensional space
(where n is number of features you have) with the value of each feature
being the value of a particular coordinate. Then, we perform
classification by finding the hyper-plane that differentiate the two
classes very well (look at the below snapshot). Support Vectors are
simply the co-ordinates of individual observation. Support Vector
Machine is a frontier which best segregates the two classes (hyper-plane/
line). More formally, a support vector machine constructs a hyper plane
or set of hyper planes in a high- or infinite-dimensional space, which can
be used for classification, regression, or other tasks like outliers
detection. Intuitively, a good separation is achieved by the hyper plane
that has the largest distance to the nearest training-data point of any class
(so-called functional margin), since in general the larger the margin the
lower the generalization error of the classifier. Whereas the original
problem may be stated in a finite dimensional space, it often happens
that the sets to discriminate are not linearly separable in that space. For
this reason, it was proposed that the original finite-dimensional space be
mapped into a much higher-dimensional space, presumably making the
separation easier in that space.

MODULES:
1. UPLOAD DATA
The data resource to database can be uploaded by both
administrator and authorized user. The data can be uploaded with
key in order to maintain the secrecy of the data that is not released
without knowledge of user. The users are authorized based on their
details that are shared to admin and admin can authorize each user.
Only Authorized users are allowed to access the system and upload
or request for files.
2. ACCESS DETAILS
The access of data from the database can be given by
administrators. Uploaded data are managed by admin and admin is
the only person to provide the rights to process the accessing details
and approve or unapproved users based on their details.

3. USER PERMISSIONS
The data from any resources are allowed to access the data with
only permission from administrator. Prior to access data, users are
allowed by admin to share their data and verify the details which are
provided by user. If user is access the data with wrong attempts then,
users are blocked accordingly. If user is requested to unblock them,
based on the requests and previous activities admin is unblock users.

4. DATA ANALYSIS
Data analyses are done with the help of graph. The collected
data are applied to graph in order to get the best analysis and
prediction of dataset and given data policies. The dataset can be
analyzed through this pictorial representation in order to better
understand of the data details.

FUTUREWORK:
There are many open problems that are left for future research. For
example, it is both interesting and challenging to investigate how to
predict the extremely large values and how to deal with missing data
(i.e., breach incidents that are not reported). It is also worthwhile to
estimate the exact occurring times of breach incidents. Finally, more
research needs to be conducted towards understanding the predictability
of breach incidents (i.e., the upper bound of prediction accuracy).

REQUIREMENT ANALYSIS

The project involved analyzing the design of few applications so as


to make the application more users friendly. To do so, it was really
important to keep the navigations from one screen to the other well
ordered and at the same time reducing the amount of typing the user
needs to do. In order to make the application more accessible, the
browser version had to be chosen so that it is compatible with most of
the Browsers.

REQUIREMENT SPECIFICATION

Functional Requirements

 Graphical User interface with the User.

Software Requirements

For developing the application the following are the Software


Requirements:

1. Python
2. Django

3. Mysql

4. Wampserver

Operating Systems supported

1. Windows 7

2. Windows XP

3. Windows 8

Technologies and Languages used to Develop

1. Python

Debugger and Emulator


 Any Browser (Particularly Chrome)
Hardware Requirements

For developing the application the following are the Hardware


Requirements:

 Processor: Pentium IV or higher


 RAM: 2 GB
 Space on Hard Disk: minimum 512MB

Python Introduction
Python is a general purpose, dynamic, high level, and interpreted programming language.
It supports Object Oriented programming approach to develop applications. It is simple and
easy to learn and provides lots of high-level data structures.

Python is easy to learn yet powerful and versatile scripting language, which makes it
attractive for Application Development.

Python's syntax and dynamic typing with its interpreted nature make it an ideal language
for scripting and rapid application development.

Python supports multiple programming pattern, including object-oriented, imperative, and


functional or procedural programming styles.

Python is not intended to work in a particular area, such as web programming. That is why
it is known as multipurpose programming language because it can be used with web,
enterprise, 3D CAD, etc.

We don't need to use data types to declare variable because it is dynamically typed so we
can write a=10 to assign an integer value in an integer variable.

Python makes the development and debugging fast because there is no compilation step
included in Python development, and edit-test-debug cycle is very fast.

Python 2 vs. Python 3


In most of the programming languages, whenever a new version releases, it supports the
features and syntax of the existing version of the language, therefore, it is easier for the
projects to switch in the newer version. However, in the case of Python, the two versions
Python 2 and Python 3 are very much different from each other.

A list of differences between Python 2 and Python 3 are given below:

1. Python 2 uses print as a statement and used as print "something" to print some
string on the console. On the other hand, Python 3 uses print as a function and used
as print("something") to print something on the console.
2. Python 2 uses the function raw_input() to accept the user's input. It returns the
string representing the value, which is typed by the user. To convert it into the
integer, we need to use the int() function in Python. On the other hand, Python 3
uses input() function which automatically interpreted the type of input entered by
the user. However, we can cast this value to any type by using primitive functions
(int(), str(), etc.).
3. In Python 2, the implicit string type is ASCII, whereas, in Python 3, the implicit string
type is Unicode.
4. Python 3 doesn't contain the xrange() function of Python 2. The xrange() is the
variant of range() function which returns a xrange object that works similar to Java
iterator. The range() returns a list for example the function range(0,3) contains 0, 1,
2.
5. There is also a small change made in Exception handling in Python 3. It defines a
keyword as which is necessary to be used. We will discuss it in Exception handling
section of Python programming tutorial.

next →← prev

Python Features
Python provides lots of features that are listed below.

1) Easy to Learn and Use


Python is easy to learn and use. It is developer-friendly and high level programming
language.

2) Expressive Language
Python language is more expressive means that it is more understandable and readable.

3) Interpreted Language
Python is an interpreted language i.e. interpreter executes the code line by line at a time.
This makes debugging easy and thus suitable for beginners.

4) Cross-platform Language
Python can run equally on different platforms such as Windows, Linux, Unix and
Macintosh etc. So, we can say that Python is a portable language.
5) Free and Open Source
Python language is freely available at offical web address.The source-code is also
available. Therefore it is open source.

6) Object-Oriented Language
Python supports object oriented language and concepts of classes and objects come into
existence.

7) Extensible
It implies that other languages such as C/C++ can be used to compile the code and thus
it can be used further in our python code.

8) Large Standard Library


Python has a large and broad library and prvides rich set of module and functions for
rapid application development.

9) GUI Programming Support


Graphical user interfaces can be developed using Python.

10) Integrated
It can be easily integrated with languages like C, C++, JAVA etc.

Python History and Versions


o Python laid its foundation in the late 1980s.
o The implementation of Python was started in the December 1989 by Guido Van
Rossum at CWI in Netherland.
o In February 1991, van Rossum published the code (labeled version 0.9.0) to
alt.sources.
o In 1994, Python 1.0 was released with new features like: lambda, map, filter, and
reduce.
o Python 2.0 added new features like: list comprehensions, garbage collection
system.
o On December 3, 2008, Python 3.0 (also called "Py3K") was released. It was
designed to rectify fundamental flaw of the language.
o ABC programming language is said to be the predecessor of Python language
which was capable of Exception Handling and interfacing with Amoeba Operating
System.
o Python is influenced by following programming languages:
o ABC language.
o Modula.

Python programming language is being updated regularly with new features and supports.
There are lots of updations in python versions, started from 1994 to current release.

next →← prev

Python Applications
Python is known for its general purpose nature that makes it applicable in almost each
domain of software development. Python as a whole can be used in any sphere of
development.

Here, we are specifing applications areas where python can be applied.

1) Web Applications
We can use Python to develop web applications. It provides libraries to handle internet
protocols such as HTML and XML, JSON, Email processing, request, beautifulSoup,
Feedparser etc. It also provides Frameworks such as Django, Pyramid, Flask etc to
design and delelop web based applications. Some important developments are:
PythonWikiEngines, Pocoo, PythonBlogSoftware etc.

2) Desktop GUI Applications


Python provides Tk GUI library to develop user interface in python based application.
Some other useful toolkits wxWidgets, Kivy, pyqt that are useable on several platforms.
The Kivy is popular for writing multitouch applications.
3) Software Development
Python is helpful for software development process. It works as a support language and
can be used for build control and management, testing etc.

4) Scientific and Numeric


Python is popular and widely used in scientific and numeric computing. Some useful
library and package are SciPy, Pandas, IPython etc. SciPy is group of packages of
engineering, science and mathematics.

5) Business Applications
Python is used to build Bussiness applications like ERP and e-commerce systems. Tryton
is a high level application platform.

6) Console Based Application


We can use Python to develop console based applications. For example: IPython.

7) Audio or Video based Applications


Python is awesome to perform multiple tasks and can be used to develop multimedia
applications. Some of real applications are: TimPlayer, cplay etc.

8) 3D CAD Applications
To create CAD application Fandango is a real application which provides full features of
CAD.

9) Enterprise Applications
Python can be used to create applications which can be used within an Enterprise or an
Organization. Some real time applications are: OpenErp, Tryton, Picalo etc.

10) Applications for Images


Using Python several application can be developed for image. Applications developed are:
VPython, Gogh, imgSeek etc.

There are several such applications which can be developed using Python

next →← prev
How to Install Python (Environment
Set-up)
In this section of the tutorial, we will discuss the installation of python on various
operating systems.

Installation on Windows
Visit the link https://www.python.org/downloads/ to download the latest release of
Python. In this process, we will install Python 3.6.7 on our Windows operating system.

Double-click the executable file which is downloaded; the following window will open.
Select Customize installation and proceed.
The following window shows all the optional features. All the features need to be installed
and are checked by default; we need to click next to continue.
The following window shows a list of advanced options. Check all the options which you
want to install and click next. Here, we must notice that the first check-box (install for all
users) must be checked.

Now, we are ready to install python-3.6.7. Let's install it.


Now, try to run python on the command prompt. Type the command python in case of
python2 or python3 in case of python3. It will show an error as given in the below
image. It is because we haven't set the path.
To set the path of python, we need to the right click on "my computer" and go to
Properties → Advanced → Environment Variables.
Add the new path variable in the user variable section.
Type PATH as the variable name and set the path to the installation directory of the
python shown in the below image.
Now, the path is set, we are ready to run python on our local system. Restart CMD, and
type python again. It will open the python interpreter shell where we can execute the
python statements.

next →← prev

First Python Program


In this Section, we will discuss the basic syntax of python by using which, we will run a
simple program to print hello world on the console.

Python provides us the two ways to run a program:


o Using Interactive interpreter prompt
o Using a script file

Let's discuss each one of them in detail.

Interactive interpreter prompt


Python provides us the feature to execute the python statement one by one at the
interactive prompt. It is preferable in the case where we are concerned about the output
of each line of our python program.

To open the interactive mode, open the terminal (or command prompt) and type python
(python3 in case if you have python2 and python3 both installed on your system).

It will open the following prompt where we can execute the python statement and check
their impact on the console.

Let's run a python statement to print the traditional hello world on the console. Python3
provides print() function to print some message on the console. We can pass the
message as a string into this function. Consider the following image.
Here, we get the message "Hello World !" printed on the console.

Using a script file


Interpreter prompt is good to run the individual statements of the code. However, we
can not write the code every-time on the terminal.

We need to write our code into a file which can be executed later. For this purpose, open
an editor like notepad, create a file named first.py (python used .py extension) and write
the following code in it.

1. Print ("hello world"); #here, we have used print() function to print the message on the c
onsole.
To run this file named as first.py, we need to run the following command on the terminal.

$ python3 first.py

Hence, we get our output as the message Hello World ! is printed on the console.

Get Started with PyCharm


In our first program, we have used gedit on our CentOS as an editor. On Windows, we
have an alternative like notepad or notepad++ to edit the code. However, these editors
are not used as IDE for python since they are unable to show the syntax related
suggestions.
JetBrains provides the most popular and a widely used cross-platform IDE PyCharm to
run the python programs.

PyCharm installation
As we have already stated, PyCharm is a cross-platform IDE, and hence it can be
installed on a variety of the operating systems. In this section of the tutorial, we will
cover the installation process of PyCharm on Windows, MacOS, CentOS, and Ubuntu.

Windows
Installing PyCharm on Windows is very simple. To install PyCharm on Windows operating
system, visit the link https://www.jetbrains.com/pycharm/download/download-thanks.html?
platform=windows to download the executable installer. Double click the installer (.exe)
file and install PyCharm by clicking next at each step.

next →← prev

Python Variables
Variable is a name which is used to refer memory location. Variable also known as
identifier and used to hold value.

In Python, we don't need to specify the type of variable because Python is a type infer
language and smart enough to get variable type.

Variable names can be a group of both letters and digits, but they have to begin with a
letter or an underscore.

It is recomended to use lowercase letters for variable name. Rahul and rahul both are
two different variables.

Identifier Naming
Variables are the example of identifiers. An Identifier is used to identify the literals used
in the program. The rules to name an identifier are given below.

o The first character of the variable must be an alphabet or underscore ( _ ).


o All the characters except the first character may be an alphabet of lower-case(a-
z), upper-case (A-Z), underscore or digit (0-9).
o Identifier name must not contain any white-space, or special character (!, @, #,
%, ^, &, *).
o Identifier name must not be similar to any keyword defined in the language.
o Identifier names are case sensitive for example my name, and MyName is not the
same.
o Examples of valid identifiers : a123, _n, n_9, etc.
o Examples of invalid identifiers: 1a, n%4, n 9, etc.

Declaring Variable and Assigning Values


Python does not bound us to declare variable before using in the application. It allows us
to create variable at required time.

We don't need to declare explicitly variable in Python. When we assign any value to the
variable that variable is declared automatically.

The equal (=) operator is used to assign value to a variable.

Eg:

Output:

1. >>>
2. 10
3. ravi
4. 20000.67
5. >>>

Multiple Assignment
Python allows us to assign a value to multiple variables in a single statement which is
also known as multiple assignment.

We can apply multiple assignments in two ways either by assigning a single value to
multiple variables or assigning multiple values to multiple variables. Lets see given
examples.

1. Assigning single value to multiple variables

Eg:

1. x=y=z=50
2. print iple
3. print y
4. print z
Output:

1. >>>
2. 50
3. 50
4. 50
5. >>>
2.Assigning multiple values to multiple variables:

Eg:

1. a,b,c=5,10,15
2. print a
3. print b
4. print c
Output:

1. >>>
2. 5
3. 10
4. 15
5. >>>
The values will be assigned in the order in which variables appears.

Basic Fundamentals:
This section contains the basic fundamentals of Python like :

i)Tokens and their types.

ii) Comments

a)Tokens:

o Tokens can be defined as a punctuator mark, reserved words and each individual
word in a statement.
o Token is the smallest unit inside the given program.

There are following tokens in Python:

o Keywords.
o Identifiers.
o Literals.
o Operators.

Tuples:
o Tuple is another form of collection where different type of data can be stored.
o It is similar to list where data is separated by commas. Only the difference is that
list uses square bracket and tuple uses parenthesis.
o Tuples are enclosed in parenthesis and cannot be changed.

Eg:

1. >>> tuple=('rahul',100,60.4,'deepak')
2. >>> tuple1=('sanjay',10)
3. >>> tuple
4. ('rahul', 100, 60.4, 'deepak')
5. >>> tuple[2:]
6. (60.4, 'deepak')
7. >>> tuple1[0]
8. 'sanjay'
9. >>> tuple+tuple1
10. ('rahul', 100, 60.4, 'deepak', 'sanjay', 10)
11. >>>

Dictionary:
o Dictionary is a collection which works on a key-value pair.
o It works like an associated array where no two keys can be same.
o Dictionaries are enclosed by curly braces ({}) and values can be retrieved by
square bracket([]).

Eg:

1. >>> dictionary={'name':'charlie','id':100,'dept':'it'}
2. >>> dictionary
3. {'dept': 'it', 'name': 'charlie', 'id': 100}
4. >>> dictionary.keys()
5. ['dept', 'name', 'id']
6. >>> dictionary.values()
7. ['it', 'charlie', 100]
8. >>>

next →← prev

Python Data Types


Variables can hold values of different data types. Python is a dynamically typed language
hence we need not define the type of the variable while declaring it. The interpreter
implicitly binds the value with its type.

Python enables us to check the type of the variable used in the program. Python provides
us the type() function which returns the type of the variable passed.

Consider the following example to define the values of different data types and checking
its type.

1. A=10
2. b="Hi Python"
3. c = 10.5
4. print(type(a));
5. print(type(b));
6. print(type(c));
Output:
<type 'int'>
<type 'str'>
<type 'float'>

Standard data types


A variable can hold different types of values. For example, a person's name must be
stored as a string whereas its id must be stored as an integer.

Python provides various standard data types that define the storage method on each of
them. The data types defined in Python are given below.

1. Numbers
2. String
3. List
4. Tuple
5. Dictionary

In this section of the tutorial, we will give a brief introduction of the above data types.
We will discuss each one of them in detail later in this tutorial.

Numbers
Number stores numeric values. Python creates Number objects when a number is
assigned to a variable. For example;

1. a = 3 , b = 5 #a and b are number objects


Python supports 4 types of numeric data.

1. int (signed integers like 10, 2, 29, etc.)


2. long (long integers used for a higher range of values like 908090800L, -
0x1929292L, etc.)
3. float (float is used to store floating point numbers like 1.9, 9.902, 15.2, etc.)
4. complex (complex numbers like 2.14j, 2.0 + 2.3j, etc.)

Python allows us to use a lower-case L to be used with long integers. However, we must
always use an upper-case L to avoid confusion.
A complex number contains an ordered pair, i.e., x + iy where x and y denote the real
and imaginary parts respectively).

String
The string can be defined as the sequence of characters represented in the quotation
marks. In python, we can use single, double, or triple quotes to define a string.

String handling in python is a straightforward task since there are various inbuilt
functions and operators provided.

In the case of string handling, the operator + is used to concatenate two strings as the
operation "hello"+" python" returns "hello python".

The operator * is known as repetition operator as the operation "Python " *2 returns
"Python Python ".

The following example illustrates the string handling in python.

1. str1 = 'hello javatpoint' #string str1


2. str2 = ' how are you' #string str2
3. print (str1[0:2]) #printing first two character using slice operator
4. print (str1[4]) #printing 4th character of the string
5. print (str1*2) #printing the string twice
6. print (str1 + str2) #printing the concatenation of str1 and str2
Output:

he
o
hello javatpointhello javatpoint
hello javatpoint how are you

List
Lists are similar to arrays in C. However; the list can contain data of different types. The
items stored in the list are separated with a comma (,) and enclosed within square
brackets [].
We can use slice [:] operators to access the data of the list. The concatenation operator
(+) and repetition operator (*) works with the list in the same way as they were working
with the strings.

Consider the following example.

1. l = [1, "hi", "python", 2]


2. print (l[3:]);
3. print (l[0:2]);
4. print (l);
5. print (l + l);
6. print (l * 3);
Output:

[2]
[1, 'hi']
[1, 'hi', 'python', 2]
[1, 'hi', 'python', 2, 1, 'hi', 'python', 2]
[1, 'hi', 'python', 2, 1, 'hi', 'python', 2, 1, 'hi', 'python', 2]

Tuple
A tuple is similar to the list in many ways. Like lists, tuples also contain the collection of
the items of different data types. The items of the tuple are separated with a comma (,)
and enclosed in parentheses ().

A tuple is a read-only data structure as we can't modify the size and value of the items of
a tuple.

Let's see a simple example of the tuple.

1. t = ("hi", "python", 2)
2. print (t[1:]);
3. print (t[0:1]);
4. print (t);
5. print (t + t);
6. print (t * 3);
7. print (type(t))
8. t[2] = "hi";
Output:
('python', 2)
('hi',)
('hi', 'python', 2)
('hi', 'python', 2, 'hi', 'python', 2)
('hi', 'python', 2, 'hi', 'python', 2, 'hi', 'python', 2)
<type 'tuple'>
Traceback (most recent call last):
File "main.py", line 8, in <module>
t[2] = "hi";
TypeError: 'tuple' object does not support item assignment

Dictionary
Dictionary is an ordered set of a key-value pair of items. It is like an associative array or
a hash table where each key stores a specific value. Key can hold any primitive data type
whereas value is an arbitrary Python object.

The items in the dictionary are separated with the comma and enclosed in the curly
braces {}.

Consider the following example.

1. d = {1:'Jimmy', 2:'Alex', 3:'john', 4:'mike'};


2. print("1st name is "+d[1]);
3. print("2nd name is "+ d[4]);
4. print (d);
5. print (d.keys());
6. print (d.values());
Output:

1st name is Jimmy


2nd name is mike
{1: 'Jimmy', 2: 'Alex', 3: 'john', 4: 'mike'}
[1, 2, 3, 4]
['Jimmy', 'Alex', 'john', 'mike']

next →← prev
Python Functions
Functions are the most important aspect of an application. A function can be defined as
the organized block of reusable code which can be called whenever required.

Python allows us to divide a large program into the basic building blocks known as
function. The function contains the set of programming statements enclosed by {}. A
function can be called multiple times to provide reusability and modularity to the python
program.

In other words, we can say that the collection of functions creates a program. The
function is also known as procedure or subroutine in other programming languages.

Python provide us various inbuilt functions like range() or print(). Although, the user can
create its functions which can be called user-defined functions.

Advantage of functions in python


There are the following advantages of C functions.

o By using functions, we can avoid rewriting same logic/code again and again in a
program.
o We can call python functions any number of times in a program and from any
place in a program.
o We can track a large python program easily when it is divided into multiple
functions.
o Reusability is the main achievement of python functions.
o However, Function calling is always overhead in a python program.

Creating a function
In python, we can use def keyword to define the function. The syntax to define a
function in python is given below.

1. def my_function():
2. function-suite
3. return <expression>
The function block is started with the colon (:) and all the same level block statements
remain at the same indentation.
A function can accept any number of parameters that must be the same in the definition
and function calling.

Function calling
In python, a function must be defined before the function calling otherwise the python
interpreter gives an error. Once the function is defined, we can call it from another
function or the python prompt. To call the function, use the function name followed by
the parentheses.

A simple function that prints the message "Hello Word" is given below.

1. def hello_world():
2. print("hello world")
3.
4. hello_world()
Output:

hello world

Parameters in function
The information into the functions can be passed as the parameters. The parameters are
specified in the parentheses. We can give any number of parameters, but we have to
separate them with a comma.

Consider the following example which contains a function that accepts a string as the
parameter and prints it.

Example 1

1. #defining the function


2. def func (name):
3. print("Hi ",name);
4.
5. #calling the function
6. func("Ayush")

Example 2
1. #python function to calculate the sum of two variables
2. #defining the function
3. def sum (a,b):
4. return a+b;
5.
6. #taking values from the user
7. a = int(input("Enter a: "))
8. b = int(input("Enter b: "))
9.
10. #printing the sum of a and b
11. print("Sum = ",sum(a,b))
Output:

Enter a: 10

Enter b: 20

Sum = 30

Call by reference in Python


In python, all the functions are called by reference, i.e., all the changes made to the
reference inside the function revert back to the original value referred by the reference.

However, there is an exception in the case of mutable objects since the changes made to
the mutable objects like string do not revert to the original string rather, a new string
object is made, and therefore the two different objects are printed.

Example 1 Passing Immutable Object (List)

1. #defining the function


2. def change_list(list1):
3. list1.append(20);
4. list1.append(30);
5. print("list inside function = ",list1)
6.
7. #defining the list
8. list1 = [10,30,40,50]
9.
10. #calling the function
11. change_list(list1);
12. print("list outside function = ",list1);
Output:

list inside function = [10, 30, 40, 50, 20, 30]

list outside function = [10, 30, 40, 50, 20, 30]

Example 2 Passing Mutable Object (String)

1. #defining the function


2. def change_string (str):
3. str = str + " Hows you";
4. print("printing the string inside function :",str);
5.
6. string1 = "Hi I am there"
7.
8. #calling the function
9. change_string(string1)
10.
11. print("printing the string outside function :",string1)
Output:

printing the string inside function : Hi I am there Hows you

printing the string outside function : Hi I am there

Types of arguments
There may be several types of arguments which can be passed at the time of function
calling.

1. Required arguments
2. Keyword arguments
3. Default arguments
4. Variable-length arguments

Required Arguments
Till now, we have learned about function calling in python. However, we can provide the
arguments at the time of function calling. As far as the required arguments are
concerned, these are the arguments which are required to be passed at the time of
function calling with the exact match of their positions in the function call and function
definition. If either of the arguments is not provided in the function call, or the position of
the arguments is changed, then the python interpreter will show the error.

Consider the following example.

Example 1

1. #the argument name is the required argument to the function func


2. def func(name):
3. message = "Hi "+name;
4. return message;
5. name = input("Enter the name?")
6. print(func(name))
Output:

Enter the name?John

Hi John

Example 2

1. #the function simple_interest accepts three arguments and returns the simple interest ac
cordingly
2. def simple_interest(p,t,r):
3. return (p*t*r)/100
4. p = float(input("Enter the principle amount? "))
5. r = float(input("Enter the rate of interest? "))
6. t = float(input("Enter the time in years? "))
7. print("Simple Interest: ",simple_interest(p,r,t))
Output:

Enter the principle amount? 10000

Enter the rate of interest? 5

Enter the time in years? 2

Simple Interest: 1000.0

Example 3

1. #the function calculate returns the sum of two arguments a and b


2. def calculate(a,b):
3. return a+b
4. calculate(10) # this causes an error as we are missing a required arguments b.
Output:

TypeError: calculate() missing 1 required positional argument: 'b'

Keyword arguments
Python allows us to call the function with the keyword arguments. This kind of function
call will enable us to pass the arguments in the random order.

The name of the arguments is treated as the keywords and matched in the function
calling and definition. If the same match is found, the values of the arguments are copied
in the function definition.

Consider the following example.

Example 1

1. #function func is called with the name and message as the keyword arguments
2. def func(name,message):
3. print("printing the message with",name,"and ",message)
4. func(name = "John",message="hello") #name and message is copied with the values Joh
n and hello respectively
Output:

printing the message with John and hello

Example 2 providing the values in different order at


the calling

1. #The function simple_interest(p, t, r) is called with the keyword arguments the order of
arguments doesn't matter in this case
2. def simple_interest(p,t,r):
3. return (p*t*r)/100
4. print("Simple Interest: ",simple_interest(t=10,r=10,p=1900))
Output:

Simple Interest: 1900.0


If we provide the different name of arguments at the time of function call, an error will
be thrown.

Consider the following example.

Example 3

1. #The function simple_interest(p, t, r) is called with the keyword arguments.


2. def simple_interest(p,t,r):
3. return (p*t*r)/100
4.
5. print("Simple Interest: ",simple_interest(time=10,rate=10,principle=1900)) # doesn't fi
nd the exact match of the name of the arguments (keywords)
Output:

TypeError: simple_interest() got an unexpected keyword argument 'time'

The python allows us to provide the mix of the required arguments and keyword
arguments at the time of function call. However, the required argument must not be
given after the keyword argument, i.e., once the keyword argument is encountered in
the function call, the following arguments must also be the keyword arguments.

Consider the following example.

Example 4

1. def func(name1,message,name2):
2. print("printing the message with",name1,",",message,",and",name2)
3. func("John",message="hello",name2="David") #the first argument is not the keyword ar
gument
Output:

printing the message with John , hello ,and David

The following example will cause an error due to an in-proper mix of keyword and
required arguments being passed in the function call.

Example 5

1. def func(name1,message,name2):
2. print("printing the message with",name1,",",message,",and",name2)
3. func("John",message="hello","David")
Output:

SyntaxError: positional argument follows keyword argument

Default Arguments
Python allows us to initialize the arguments at the function definition. If the value of any
of the argument is not provided at the time of function call, then that argument can be
initialized with the value given in the definition even if the argument is not specified at
the function call.

Example 1

1. def printme(name,age=22):
2. print("My name is",name,"and age is",age)
3. printme(name = "john") #the variable age is not passed into the function however the d
efault value of age is considered in the function
Output:

My name is john and age is 22

Example 2

1. def printme(name,age=22):
2. print("My name is",name,"and age is",age)
3. printme(name = "john") #the variable age is not passed into the function however the d
efault value of age is considered in the function
4. printme(age = 10,name="David") #the value of age is overwritten here, 10 will be printe
d as age
Output:

My name is john and age is 22

My name is David and age is 10

Variable length Arguments


In the large projects, sometimes we may not know the number of arguments to be
passed in advance. In such cases, Python provides us the flexibility to provide the
comma separated values which are internally treated as tuples at the function call.
However, at the function definition, we have to define the variable with * (star) as
*<variable - name >.

Consider the following example.

Example

1. def printme(*names):
2. print("type of passed argument is ",type(names))
3. print("printing the passed arguments...")
4. for name in names:
5. print(name)
6. printme("john","David","smith","nick")
Output:

type of passed argument is <class 'tuple'>

printing the passed arguments...

john

David

smith

nick

Scope of variables
The scopes of the variables depend upon the location where the variable is being
declared. The variable declared in one part of the program may not be accessible to the
other parts.

In python, the variables are defined with the two types of scopes.

1. Global variables
2. Local variables

The variable defined outside any function is known to have a global scope whereas the
variable defined inside a function is known to have a local scope.

Consider the following example.

Example 1
1. def print_message():
2. message = "hello !! I am going to print a message." # the variable message is local to
the function itself
3. print(message)
4. print_message()
5. print(message) # this will cause an error since a local variable cannot be accessible here
.
Output:

hello !! I am going to print a message.

File "/root/PycharmProjects/PythonTest/Test1.py", line 5, in

print(message)

NameError: name 'message' is not defined

Example 2

1. def calculate(*args):
2. sum=0
3. for arg in args:
4. sum = sum +arg
5. print("The sum is",sum)
6. sum=0
7. calculate(10,20,30) #60 will be printed as the sum
8. print("Value of sum outside the function:",sum) # 0 will be printed
Output:

The sum is 60
Value of sum outside the function: 0

next →← prev
Python Class and Objects
As we have already discussed, a class is a virtual entity and can be seen as a blueprint of
an object. The class came into existence when it instantiated. Let's understand it by an
example.

Suppose a class is a prototype of a building. A building contains all the details about the
floor, doors, windows, etc. we can make as many buildings as we want, based on these
details. Hence, the building can be seen as a class, and we can create as many objects of
this class.

On the other hand, the object is the instance of a class. The process of creating an object
can be called as instantiation.

In this section of the tutorial, we will discuss creating classes and objects in python. We
will also talk about how an attribute is accessed by using the class object.

Creating classes in python


In python, a class can be created by using the keyword class followed by the class name.
The syntax to create a class is given below.

Syntax
1. class ClassName:
2. #statement_suite
In python, we must notice that each class is associated with a documentation string
which can be accessed by using <class-name>.__doc__. A class contains a statement
suite including fields, constructor, function, etc. definition.

Consider the following example to create a class Employee which contains two fields as
Employee id, and name.

The class also contains a function display() which is used to display the information of
the Employee.

Example
1. class Employee:
2. id = 10;
3. name = "ayush"
4. def display (self):
5. print(self.id,self.name)
Here, the self is used as a reference variable which refers to the current class object. It is
always the first argument in the function definition. However, using self is optional in the
function call.

Creating an instance of the class


A class needs to be instantiated if we want to use the class attributes in another class or
method. A class can be instantiated by calling the class using the class name.

The syntax to create the instance of the class is given below.

1. <object-name> = <class-name>(<arguments>)
The following example creates the instance of the class Employee defined in the above
example.

Example
1. class Employee:
2. id = 10;
3. name = "John"
4. def display (self):
5. print("ID: %d \nName: %s"%(self.id,self.name))
6. emp = Employee()
7. emp.display()
Output:

ID: 10
Name: ayush

next →← prev

DJANGO
Introduction
Django is a web application framework written in Python programming language. It is
based on MVT (Model View Template) design pattern. The Django is very demanding due
to its rapid development feature. It takes less time to build application after collecting
client requirement.

This framework uses a famous tag line:The web framework for perfectionists with
deadlines.

By using Django, we can build web applications in very less time. Django is designed in
such a manner that it handles much of configure things automatically, so we can focus
on application development only.

History
Django was design and developed by Lawrence journal world in 2003 and publicly
released under BSD license in July 2005. Currently, DSF (Django Software Foundation)
maintains its development and release cycle.

Django was released on 21, July 2005. Its current stable version is 2.0.3 which was
released on 6 March, 2018.

next →← prev

Features of Django
o Rapid Development
o Secure
o Scalable
o Fully loaded
o Versatile
o Open Source
o Vast and Supported Community

Rapid Development
Django was designed with the intention to make a framework which takes less time to
build web application. The project implementation phase is a very time taken but Django
creates it rapidly.

Secure
Django takes security seriously and helps developers to avoid many common security
mistakes, such as SQL injection, cross-site scripting, cross-site request forgery etc. Its
user authentication system provides a secure way to manage user accounts and
passwords.

Scalable
Django is scalable in nature and has ability to quickly and flexibly switch from small to
large scale application project.

Fully loaded
Django includes various helping task modules and libraries which can be used to handle
common Web development tasks. Django takes care of user authentication, content
administration, site maps, RSS feeds etc.

Versatile
Django is versatile in nature which allows it to build applications for different-different
domains. Now a days, Companies are using Django to build various types of applications
like: content management systems, social networks sites or scientific computing
platforms etc.

Open Source
Django is an open source web application framework. It is publicly available without cost.
It can be downloaded with source code from the public repository. Open source reduces
the total cost of the application development.

Vast and Supported Community


Django is an one of the most popular web framework. It has widely supportive community
and channels to share and connect.

next →← prev
Django Installation
To install Django, first visit to django official site
(https://www.djangoproject.com) and download django by clicking on the download
section. Here, we will see various options to download The Django.

Django requires pip to start installation. Pip is a package manager system which is used
to install and manage packages written in python. For Python 3.4 and higher
versions pip3 is used to manage packages.

In this tutorial, we are installing Django in Ubuntu operating system.

The complete installation process is described below. Before installing make sure pip is
installed in local system.

Here, we are installing Django using pip3, the installation command is given below.

1. $ pip3 install django==2.0.3

Verify Django Installation


After installing Django, we need to varify the installation. Open terminal and
write python3 and press enter. It will display python shell where we can verify django
installation.
Look at the Django version displayed by the print method of the python. Well, Django is
installed successfuly. Now, we can build Django web applications.

next →← prev

Django Project
In the previous topic, we have installed Django successfully. Now, we will learn step by
step process to create a Django application.

To create a Django project, we can use the following command. projectname is the name
of Django application.

1. $ django-admin startproject projectname

Django Project Example


Here, we are creating a project djangpapp in the current directory.

1. $ django-admin startproject djangpapp


Locate into the Project
Now, move to the project by changing the directory. The Directory can be changed by
using the following command.

1. cd djangpapp

To see all the files and subfolders of django project, we can use tree command to view
the tree structure of the application. This is a utility command, if it is not present, can be
downloaded via apt-get install tree command.
A Django project contains the following packages and files. The outer directory is just a
container for the application. We can rename it further.

o manage.py: It is a command-line utility which allows us to interact with the


project in various ways and also used to manage an application that we will see
later on in this tutorial.
o A directory (djangpapp) located inside, is the actual application package name. Its
name is the Python package name which we'll need to use to import module
inside the application.
o __init__.py: It is an empty file that tells to the Python that this directory should
be considered as a Python package.
o settings.py: This file is used to configure application settings such as database
connection, static files linking etc.
o urls.py: This file contains the listed URLs of the application. In this file, we can
mention the URLs and corresponding actions to perform the task and display the
view.
o wsgi.py: It is an entry-point for WSGI-compatible web servers to serve Django
project.

Initially, this project is a default draft which contains all the required files and folders.

Running the Django Project


Django project has a built-in development server which is used to run application
instantly without any external web server. It means we don't need of Apache or another
web server to run the application in development mode.

To run the application, we can use the following command.


1. $ python3 manage.py runserver

Look server has started and can be accessed at localhost with port 8000. Let's access it
using the browser, it looks like the below.

The application is running successfully. Now, we can customize it according to our


requirement and can develop a customized web application.
next →← prev

Django Configuration with Apache


Web Server
Django uses its built-in development server to run the web application. To start this
server, we can use python manage.py runserver command.

This command starts the server which runs on port 8000 and can be accessed at browser
by entering localhost:8000. It shows a welcome page of the application.

And at browser, it can be accessed as below.


But if we want to run our application by using apache server rather than built-in
development server, we need to configure apache2.conf file located
at /etc/apache directory. Add the following code into this file.

// apache2.conf

1. WSGIScriptAlias / /var/www/html/django7/django7/wsgi.py
2. WSGIPythonPath /var/www/html/django7/
3.
4. <Directory /var/www/html/django7>
5. <Files wsgi.py>
6. Require all granted
7. </Files>
8. </Directory>
After adding these lines, restart apache server by using the service apache2
restart command and then type localhost to the browser's address bar. This time,
project will run on apache server rather than a built-in server. See, it shows the home
page of the application.
next →← prev

Django Virtual Environment Setup


The virtual environment is an environment which is used by Django to execute an
application. It is recommended to create and execute a Django application in a separate
environment. Python provides a tool virtualenv to create an isolated Python
environment. We will use this tool to create a virtual environment for our Django
application.

To set up a virtual environment, use the following steps.

1. Install Package

First, install python3-venv package by using the following command.

1. $ apt-get install python3-venv


2. Create a Directory

1. $ mkdir djangoenv
After it, change directory to the newly created directory by using the cd djangoenv.

3. Create Virtual Environment

1. $ python3 -m venv djangoenv


4. Activate Virtual Environment

After creating a virtual environment, activate it by using the following command.

1. $ source djangoenv/bin/activate
Till here, the virtual environment has started. Now, we can use it to create Django
application.

Install Django
Install Django in the virtual environment. To install Django, use the following command.

1. $ pip install django

Django has installed successfully. Now we can create a new project and build new
applications in the separate environment

next →← prev

Django Admin Interface


Django provides a built-in admin module which can be used to perform CRUD operations
on the models. It reads metadata from the model to provide a quick interface where the
user can manage the content of the application.

This is a built-in module and designed to perform admin related tasks to the user.

Let's see how to activate and use Django's admin module (interface).

The admin app (django.contrib.admin) is enabled by default and already added into
INSTALLED_APPS section of the settings file.

To access it at browser use '/admin/' at a local machine like localhost:8000/admin/


and it shows the following output:
It prompts for login credentials if no password is created yet, use the following command
to create a user.

Create an Admin User


1. $ python3 managen.py createsuperuser

Now start development server and access admin login.

1. $ python3 manage.py runserver


Provide created username and password and login.
After login successfully, it shows the following interface.

It is a Django Admin Dashboard.

next →← prev
Django App
In the previous topics, we have seen a procedure to create a Django project. Now, in this
topic, we will create app inside the created project.

Django application consists of project and app, it also generates an automatic base
directory for the app, so we can focus on writing code (business logic) rather than
creating app directories.

The difference between a project and app is, a project is a collection of configuration files
and apps whereas the app is a web application which is written to perform business logic.

Creating an App
To create an app, we can use the following command.

1. $ python3 manage.py startapp appname

Django App Example


1. $ python3 manage.py startapp myapp

See the directory structure of the created app, it contains the migrations folder to store
migration files and model to write business logic.

Initially, all the files are empty, no code is available but we can use these to implement
business logic on the basis of the MVC design pattern.

To run this application, we need to make some significant changes which display hello
world message on the browser.

Open views.py file in any text editor and write the given code to it and do the same
for urls.py file too.
// views.py

1. from django.shortcuts import render


2.
3. # Create your views here.
4. from django.http import HttpResponse
5.
6. def hello(request):
7. return HttpResponse("<h2>Hello, Welcome to Django!</h2>")
// urls.py

1. from django.contrib import admin


2. from django.urls import path
3. from myapp import views
4.
5. urlpatterns = [
6. path('admin/', admin.site.urls),
7. path('hello/', views.hello),
8. ]
We have made changes in two files of the application. Now, let's run the it by using the
following command. This command will start the server at port 8000.

Run the Application


1. $ python3 manage.py runserver

Open any web browser and enter the URL localhost:8000/hello. It will show the output
given below.
next →← prev

Django MVT
The MVT (Model View Template) is a software design pattern. It is a collection of three
important components Model View and Template. The Model helps to handle database. It
is a data access layer which handles the data.

The Template is a presentation layer which handles User Interface part completely. The
View is used to execute the business logic and interact with a model to carry data and
renders a template.

Although Django follows MVC pattern but maintains it?s own conventions. So, control is
handled by the framework itself.

There is no separate controller and complete application is based on Model View and
Template. That?s why it is called MVT application.

See the following graph that shows the MVT based control flow.
Here, a user requests for a resource to the Django, Django works as a controller and
check to the available resource in URL.

If URL maps, a view is called that interact with model and template, it renders a
template.

Django responds back to the user and sends a template as a response.

next →← prev

Django Views
A view is a place where we put our business logic of the application. The view is a python
function which is used to perform some business logic and return a response to the user.
This response can be the HTML contents of a Web page, or a redirect, or a 404 error.

All the view function are created inside the views.py file of the Django app.

Django View Simple Example


//views.py

1. import datetime
2. # Create your views here.
3. from django.http import HttpResponse
4. def index(request):
5. now = datetime.datetime.now()
6. html = "<html><body><h3>Now time is %s.</h3></body></html>" % now
7. return HttpResponse(html) # rendering the template in HttpResponse
Let's step through the code.

First, we will import DateTime library that provides a method to get current date and
time and HttpResponse class.

Next, we define a view function index that takes HTTP request and respond back.

View calls when gets mapped with URL in urls.py. For example

1. path('index/', views.index),
Output:

UMLDIAGRAMS:

USE CASE DIAGRAM:

A use case diagram in the Unified Modeling Language (UML) is a type of


behavioral diagram defined by and created from a Use-case analysis. Its purpose is
to present a graphical overview of the functionality provided by a system in terms
of actors, their goals (represented as use cases), and any dependencies between
those use cases. The main purpose of a use case diagram is to show what system
functions are performed for which actor. Roles of the actors in the system can be
depicted.

user

Admin
CLASS DIAGRAM:

In software engineering, a class diagram in the Unified Modeling Language


(UML) is a type of static structure diagram that describes the structure of a system
by showing the system's classes, their attributes, operations (or methods), and the
relationships among the classes. It explains which class contains information.

SEQUENCE DIAGRAM:

A sequence diagram in Unified Modeling Language (UML) is a kind of interaction


diagram that shows how processes operate with one another and in what order. It is
a construct of a Message Sequence Chart. Sequence diagrams are sometimes called
event diagrams, event scenarios, and timing diagrams.
ACTIVITY DIAGRAM:

Activity diagrams are graphical representations of workflows of stepwise activities


and actions with support for choice, iteration and concurrency. In the Unified
Modeling Language, activity diagrams can be used to describe the business and
operational step-by-step workflows of components in a system. An activity
diagram shows the overall flow of control.

SYSTEM TEST

The purpose of testing is to discover errors. Testing is the process of trying to discover every
conceivable fault or weakness in a work product. It provides a way to check the functionality of
components, sub assemblies, assemblies and/or a finished product It is the process of exercising
software with the intent of ensuring that the Software system meets its requirements and user
expectations and does not fail in an unacceptable manner. There are various types of test. Each
test type addresses a specific testing requirement.
TYPES OF TESTS
Unit testing
Unit testing involves the design of test cases that validate that the internal
program logic is functioning properly, and that program inputs produce valid outputs. All
decision branches and internal code flow should be validated. It is the testing of individual
software units of the application .it is done after the completion of an individual unit before
integration. This is a structural testing, that relies on knowledge of its construction and is
invasive. Unit tests perform basic tests at component level and test a specific business process,
application, and/or system configuration. Unit tests ensure that each unique path of a business
process performs accurately to the documented specifications and contains clearly defined inputs
and expected results.

Integration testing
Integration tests are designed to test integrated software components to
determine if they actually run as one program. Testing is event driven and is more concerned
with the basic outcome of screens or fields. Integration tests demonstrate that although the
components were individually satisfaction, as shown by successfully unit testing, the
combination of components is correct and consistent. Integration testing is specifically aimed at
exposing the problems that arise from the combination of components.

Functional test
Functional tests provide systematic demonstrations that functions tested are
available as specified by the business and technical requirements, system documentation, and
user manuals.
Functional testing is centered on the following items:

Valid Input : identified classes of valid input must be accepted.

Invalid Input : identified classes of invalid input must be rejected.

Functions : identified functions must be exercised.

Output : identified classes of application outputs must be exercised.


Systems/Procedures : interfacing systems or procedures must be invoked.

Organization and preparation of functional tests is focused on requirements, key


functions, or special test cases. In addition, systematic coverage pertaining to identify Business
process flows; data fields, predefined processes, and successive processes must be considered for
testing. Before functional testing is complete, additional tests are identified and the effective
value of current tests is determined.

System Test
System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable results. An example of
system testing is the configuration oriented system integration test. System testing is based on
process descriptions and flows, emphasizing pre-driven process links and integration points.

White Box Testing


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.

Black Box Testing


Black Box Testing is testing the software without any knowledge of the inner
workings, structure or language of the module being tested. Black box tests, as most other kinds
of tests, must be written from a definitive source document, such as specification or requirements
document, such as specification or requirements document. It is a testing in which the software
under test is treated, as a black box .you cannot “see” into it. The test provides inputs and
responds to outputs without considering how the software works.
Unit Testing

Unit testing is usually conducted as part of a combined code and unit test phase
of the software lifecycle, although it is not uncommon for coding and unit testing to be
conducted as two distinct phases.

Test strategy and approach


Field testing will be performed manually and functional tests will be written in
detail.
Test objectives
 All field entries must work properly.
 Pages must be activated from the identified link.
 The entry screen, messages and responses must not be delayed.

Features to be tested
 Verify that the entries are of the correct format
 No duplicate entries should be allowed
 All links should take the user to the correct page.
Integration Testing
Software integration testing is the incremental integration testing of two or more
integrated software components on a single platform to produce failures caused by interface
defects.

The task of the integration test is to check that components or software applications, e.g.
components in a software system or – one step up – software applications at the company level –
interact without error.

Test Results: All the test cases mentioned above passed successfully. No defects encountered.

Acceptance Testing
User Acceptance Testing is a critical phase of any project and requires significant participation
by the end user. It also ensures that the system meets the functional requirements.

Test Results: All the test cases mentioned above passed successfully. No defects encountered.

LITERATURE SURVEY
Literature survey is the most important step in software development
process. Before developing the tool it is necessary to determine the time factor,
economy and company strength. Once these things are satisfied, ten next steps
are to determine which operating system and language can be used for
developing the tool. Once the programmers start building the tool the
programmers need lot of external support. This support can be obtained from
senior programmers, from book or from websites. Before building the system the
above consideration are taken into account for developing the proposed system.

 TITLE: "ONLINE TESTING SUFFERS SETBACKS IN MULTIPLE STATES”


 AUTHOR: MICHELLE R. DAVIS
Widespread technical failures and interruptions of recent online testing in a number of states
have shaken the confidence of educators and policymakers in high-tech assessment methods and
raised serious concerns about schools' technological readiness for the coming common-core
online tests. The glitches arose as many districts in the 46 states that have signed on to the
Common Core State Standards are trying to ramp up their technological infrastructure to prepare
for the requirement that students take online assessments starting in 2014-15. Disruptions of
testing were reported across Indiana, Kentucky, Minnesota, and Oklahoma and were linked to
the states' assessment providers: CTB/McGraw-Hill, in Indiana and Oklahoma; ACT Inc., in
Kentucky; and the American Institutes for Research, in Minnesota. Thousands of students
experienced slow loading times of test questions, students were closed out of testing in mid-
answer, and some were unable to log in to the tests. Hundreds, if not thousands, of tests may be
invalidated. The difficulties prompted all four states' education departments to extend testing
windows, made some state lawmakers and policymakers reconsider the idea of online testing,
and sent district officials into a tailspin. The testing problems were "absolutely horrible, in terms
of kids being anxious," said Eric F. Hileman, the executive director of information technology
services for the 43,000-student Oklahoma City schools. Some high school students were taking
Oklahoma's high-stakes tests, which require that students pass four out of seven end-of-
instruction tests to graduate. "It was heartbreaking to watch them," Mr. Hileman said. "Some of
them were almost in tears”

 TITLE: IMPLEMENTING E-ASSESSMENT USING OPEN CV IN ∞EXAMS


 AUTHOR’S:
1. Prajakta Pathe
2. Dr. Sachin Choudhari
3. Ms. Monali Gulhane

This paper features a software system called ∞Exams (Infinity Exams) which supports (primarily
in higher education) paper-based examination and makes it easier, more comfortable and speeds
up the whole process while keeping every single positive attribute of it but also reducing the
number of negative aspects. The approach significantly differs from the ones used in the
previous 10+ years which were implemented in such a way that they could not reproduce and
replace the traditional paper-based examination model. The heart of the article relies on the most
important element of the software which is the image processing flow.The way of conducting
testing the knowledge of a person using Multiple Choice Questions (MCQ) has been increased
gradually. In Educational industries (like schools and colleges) it is more common now days
having tests using multiple choice questions. Even in conducting interviews it is used. Current
day scenario is either using OMR technology to correct the test or manually. In real-time it is
quite difficult to have OMR at all the time and manually it is highly taking the time to correct
and it may give you the error. We address this issue, in our proposed system we using digital
image processing technique to correct the answer using multi choice question in python. We are
here using Open Source Computer Vision Library (Open CV) to process and correct the answer.
Python is the best language to implement this concept with the available Open CV library. In this
system we also implement in the django environment. There is a growing need for storing paper-
based information digitalized nowadays. This problem concerns education as well but it does not
always get enough attention, however using our technology accordingly many aspects of the
educational process could be made a lot simpler, easier, faster, more comfortable and (partially)
automatable. Most of the educational institutions are using traditional teaching and examination
methods in most of their subjects still. Though the digitalization of teaching got a little bit of
attention in the previous years and began its growth since then. Alongside it there are also
computer-based examination methods but it is not the main functionality of the e-learning
systems. So mostly the traditional examination models are used concerning those subjects who
require such a way to be examined accordingly. From now on the paper-based examination
method will be discussed, since it is the main concern of this paper. The keyword “e-assessment”
refers to electronic assessment as software is used to mark the exam papers filled by the students
after the exam is completed. Multiple choices Question (MCQ) are a form of an objective
assessment in which respondents are asked to select only correct answers out of the choices from
a list.[1] The multiple choice format is most frequently used in educational testing, in market
research, and in elections, when a person chooses between multiple candidates, parties, or
policies. In this paper we are using image processing to accomplish the MCQ correction in very
easy manner. It produces the great effort to deal to remove the barriers of multi choice
assessment correction. In this we are using array format to correct the answer paper which is
photo copier and uploaded by user. The main concept is to get the image and get the answer
which is shadowed by user. In Python Open CV library is available for image processing. In
order to get the best effective output we use the django framework along with python. The Open
CV is a library of programming functions mainly aimed at real-time computer vision. The
Following topics are organized to explain the process of how to deal with this technique.
 TITLE: INTELLIGENT SHORT TEXT ASSESSMENT IN EMAX
 AUTHOR’S:
1. Dezso Sima
2. Balazs Schmuck
3. Sandor Szollosi
4. Arpad Miklos

Rapidly increasing student numbers and spreading distance learning systems strengthen the urgent
need for effective Knowledge Assessment Systems (KAS’s). Recent KAS’s have however, the deficiency of
not providing intelligent assessment modules for e.g. the evaluation of freely formulated short answers
including a few sentences or partially solved mathematical problems. The eMax KAS, developed at the
Intelligent Knowledge Management Innovation Center of IBM Hungary and the John von Neumann
Faculty of Informatics at Budapest Tech, aims to provide these capabilities. Our paper gives an
introduction to the intelligent assessment of short texts component of eMax by presenting the approach
used for the formal description of the “answer space” defined as well as the methods chosen for the
syntactic analysis, semantic analysis and scoring. The α version of eMax is now completed and is in
testing In the last decade student enrollment to our faculty has steadily grown, nearly five-fold in ten
years. The annual intake to our Engineer Informatics program approaches already 400 direct and 100
part time students. With such a large number of students, the assessment of midterm and final exams
require a huge effort from our faculty members. In order to substantially ease the burden of assessing
large numbers of exam questions while avoiding the constraints of passive answer types, such as
multiple-choice questions, an internal project was launched five years ago with the goal of developing
an intelligent knowledge assessment system (KAS). In the first phase of the project, a wide range
literature research was conducted [1], [2] and a test system called Evita [3] was developed to check the
feasibility of our ideas concerning the assessment of freely formulated short texts. Based on positive
results obtained, an Intelligent Knowledge Management Innovation Center was established in 2005
jointly by IBM Hungary and the John von Neumann Faculty of Informatics at Budapest Tech to develop
an appropriate intelligent KAS. The research and development work performed has resulted in the α
version of the eMax system, now under testing. Beyond the usual passive question types, eMax is able
to semi-automatically assess freely formulated short student answers and partially solved mathematical
problems as well. Unlike Automated Essay Grading (AEG) published widely [4],[5] the short text module
of our eMax is constrained only to a few (say 2-3) sentences and is based on a formal semantic
description rather than on methods used in AEG, such as statistical or Natural Language Processing (NLP)
techniques. Our paper and a companion paper [6] give an account of the two intelligent assessment
modules developed as parts of eMax

 TITLE: AUTOMATIC EXAM CORRECTION


 AUTHOR’S: REMCO HENDRIKS
Educational institutions apply traditional examination methods, using pencil and paper. Correctors are
to read through the answers manually, calculating a grade from the work, and optionally provide written
feedback. Students are to receive only a grade from the corrector, usually they are urged to collect
feedback individually from the corrector. This traditional approach of exam correcting, grading and
feedback provision, has pitfalls in regard to correction efficiency and feedback distribution The
Universiteit van Amsterdam employs various methods for teachers and instructors to examine a
student’s knowledge of a particular subject. Most popular is the written exam, where the instructor
provides a question sheet and a separate answer sheet. The question sheet is generated in a manner the
instructor suits them best, enumerating the individual open and multiple choice questions linearly or in
sections. Other examinations are used as well, popular courses with high attendance often employ
multiple-choice only exams, which use a standardized answer sheet that is able to be scanned,
recognized and corrected by a software package. Alternative methods such as verbal or practical
examinations are left out the scope of this paper. Both the automated and manual examination
methods have benefits and disadvantages. Most importantly, the manual examination provides ability
for the instructor to write feedback on the sheets of the student, where the automatic examination
greatly reduces time required to calculate a grade. This paper discusses an (internet) software package
which has the combined functionality of providing feedback to the student as well as automatically
correct multiple choice questions. Spearhead abilities of the package are to move the correction
environment from pencil and paper to an online interface, displaying the answer regions of the scanned
paper sheets; provide automatic recognition of ticked multiple choice question boxes, and thus
automatically grade multiple choice questions; access for the student on the online platform so it may
receive (general) personalized feedback. The automatic exam correction project is inspired and based on
several other works. The most prominent related work is Auto Multiple Choice (AMC)[4], which
functionality set overlaps with that of Automatic Exam Correction. Identical exam generation and
configuration file generation is derived from the AMC papers. Notably the AMC package does not offer
open question correction and feedback provisioning, and operates stand-alone as an installer desktop
application. C´ıp and Babinec[5] have made a multiple-choice concept where document calibration and ˇ
identification is described in detail to recognize forms. Many elements from Automatic Exam Correction
are derived from this paper relating the document generation concept. Lira, Bronfman et al. wrote
Multitest[6], a full digital environment dedicated to generate, correct and analyze (digital) multiple
choice answer sheets. Although the materials and methods used are relatively outdated, it reveals
insights on a functional model for a digital correction environment. Olˇs´ak[7] made a TEX library to
generate EAN-13 barcodes, which transforms an input string into a pure TEX barcode, which is used for
digital detection and identification in the Automatic Exam Correction project. The book Learning
OpenCV [8] is a great reference with many examples written by Bradski and Kaehler, on which the
computer vision part of the Automatic Exam Correction project is based.
CONCLUSION:
We analyzed a hacking breach dataset from the points of view of
the incidents inter-arrival time and the breach size, and showed that they
both should be modeled by stochastic processes rather than distributions.
The statistical models developed in this paper show satisfactory fitting
and prediction accuracies. In particular, we propose using a copula-
based approach to predict the joint probability that an incident with a
certain magnitude of breach size will occur during a future period of
time. Statistical tests show that the methodologies proposed in this paper
are better than those which are presented in the literature, because the
latter ignored both the temporal correlations and the dependence
between the incidents inter-arrival times and the breach sizes. We
conducted qualitative and quantitative analyses to draw further insights.
We drew a set of cybersecurity insights, including that the threat of
cyber hacking breach incidents is indeed getting worse in terms of their
frequency, but not the magnitude of their damage. The methodology
presented in this paper can be adopted or adapted to analyze datasets of a
similar nature.

You might also like