You are on page 1of 7

International Journal of Innovations & Advancement in Computer Science

IJIACS
ISSN 2347 – 8616
Volume 5, Issue 1
January 2016

An Effect of Particle Swarm Optimization on SDLC


Shrishti Tamrakar (M.Tech Scholar),


Anubhav Sharma (Asst.Prof.)
Acropolis Institute of Technology and Research, Bhopal

Abstract— Software Engineering is a systematic software product. The goal of software requirement
approach to the event, maintenance, and retirement of specification definition is to completely and
the software system. The Software requirement consistently specify the technical requirements for
specification is a technical specification of requirements the software product in a concise and unambiguous
for the software product. Formal specification is the manner, using formal notations appropriate. The
cluster of statements expressed in a language whose software requirement specifications based on the
vocabulary, syntax and semantics are formally defined. system definition. The requirement specification
Formal specification focuses on covering unsolved faults
will state that the ‘what‘ of the software product
that would probably go ignored with tradition
specification methods. So, it leads to correct and bug
without implying ‗how‘. For Software formal
free software. Many approaches are there for formal specification, formal methods are used which are
specification of software. This paper has used model- mathematical-based techniques used for
based approach which supports tools like B-notation, Z- specification, proving and verification of software
notation, VDM, etc. As VDM has various advantages systems [1]. The process of formal verification
over Z and B, so Formal specification is done using means that applying these approaches to verify the
VDM. As compiler is also software which performs many properties making certain correctness of a system.
operations. As part of the research, memory allocation Formal verification of software system targets the
has been taken into consideration for formal computer program wherever linguistics of the
specification. Whenever compiler allocates memory,
language provides precise aiming to the program
fragmentation occurs. To optimize the allocation for
reducing the internal and external fragmentation,
analyzed. Formal specification can be used to
particle swarm optimization algorithm is used and it is provide an unambiguous and consistent supplement
formally specified. Compiler memory allocation to natural language descriptions and can be
operation takes discrete values, so discrete particle rigorously validated and verified leading to the
swarm optimization should be specified. Using the VDM, early detection of specification errors [2].
the discrete particle swarm optimization algorithm is
formally specified. Further, compiler memory allocation
can be done using this algorithm; it will help for
reducing the fragmentation. For implementing the VDM,
overture tool is used.
Keywords: Formal Specification, Z, B, VDM, compiler,
fragmentation, particle swarm optimization

I. INTRODUCTION
Fig.1 Formal Specification
SOFTWARE ENGINEERING can be defined as Fig.1 depicts where the Formal Specification lies
―The systematic approach to the event, operation,
in the Software Development Life Cycle. It
maintenance and retirement of the software
illustrates that between the User requirement
system‖. The primary goal of software engineering
Definition and the High level design there exists the
is to boost the standard of software product. The
Formal Specification. Its advantage is that it
analysis phase of software development involves
increases the contractor involvement rather than the
project planning and software requirement
client involvement.
definition. The software requirement specification
is a technical specification of requirements for the Various researches have been made in different
fields by using Z [17], B [11] and VDM [16] formal

37 Shrishti Tamrakar, Anubhav Sharma


International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 5, Issue 1
January 2016

methods. Almeida et.al [7] in 1992 transformed a including regulation modelling, and turn it into a
semi formal specification to VDM. Descriptions of high quality abstract formal specification.
the requirements of a software system written in an Mojtaba Ahmadieh Khanesar, et.al [23] in 2009. In
unconstrained natural language are considered to be this research, a new interpretation for the velocity
informal. Informal descriptions are known to have of binary PSO was proposed, which is the rate of
the potential to contain ambiguities, partial change of bits of particles. The previous values,
descriptions, inconsistencies, and incompleteness state and direction were considered that helped
and poor ordering of requirements, Specifications finding better solutions. They presented the
written in VDM like language are considered application of Binary PSO where search space
formal. In between these two ends they recognized values are discrete in decision making, travelling
several techniques for semi-formal specifications. salesman problem, solving lot size problem, etc.
In this paper they proposed a technique for semi-
Dantas [11] in 2009 presented verified compilation
formal specification.
and the B method: A Proposal and a first appraisal.
Ledru [9] in 1993 developed a reactive system in a This paper investigates the application of the B
VDM framework. This paper studied detailed method beyond the classical algorithmic level
development of reactive systems, using an provided by the B0 sub-language, and presents
extension of VDM. The extension allows refinements of B models at a level of precision
specification and proof of behavioral aspects to be equivalent to assembly language. It claim and
expressed in the VDM framework. This is achieved justify that this extension provides a more reliable
by using traces of the input/output activities and software development process as it bypasses two of
introducing the notion of external entities whose the less trustable steps in the application of the B
behavior is described by a state machine. The major method : code synthesis and compilation. The
objective of this work is to improve understanding results presented in this paper have a value as a
of the practical implications of the specification, proof of concept and may be used as a basis to
design, and symbolic validation of machine- establish an agenda for the development of an
checked reactive systems. approach to build verifying compilers based on the
Rania Hassan, et.al [24] in 2005 compared the B method.
gentic algorithm and particle swarm optimization. Zafar et.al [3] in 2011 worked in Transformation of
PSO is like GA in the sense that both are heuristic class diagrams into Formal Specification. He says
population-based search method. PSO and GA that requirement analysis and design specification
move from a set of points (population) to another is a serious issue in software engineering because
set of points in a single iteration with likely of semantics involved in the transformation of real
improvement using a combination of deterministic world problems to computational models. Unified
and probabilistic rules. It is claimed that PSO gives Modeling language (UML) has been accepted as a
the same effect as GA but it has significantly better standard for design and development of object
computational efficiency by implementing oriented systems. UML has a lack of notations for
statistical analysis and formal hypothesis testing. description of a complete functional system and its
Ponsard et.al [20] in 2006 analyzed formal semantics is still semi-formal allowing ambiguities
requirement models to Formal Specifications in B. at desing level. Formal methods involve much
They analyzed that the development of critical mathematics. Therefore, a strong linkage of UML
systems requires a high assurance process from and formal methods is needed to overcome the
requirements to the running code. Formal methods, above issues. In this paper, an integration of UML
such as B, now provide industry-strength tools to and Z notation is defined for class diagrams
develop abstract models refine them in more considering both the syntax and semantics at an
concrete models and finally turn them into code. A abstract level of specification.
major remaining weakness in the development Buragga et.al [4] in 2011 analyzed formal parsing
chain is the gap between textual or semi-formal of CFG (Context-Free grammar) using Left most
requirements and formal models. In this paper, they Derivations. Formal approaches are useful to verify
explore how to cope with this problem using a goal- the properties of software and hardware systems.
oriented approach to elaborate a pertinent model, Formal verification of a software system targets the

38 Shrishti Tamrakar, Anubhav Sharma


International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 5, Issue 1
January 2016

source program where semantics of a language has declarative style, encourages an abstract statement
more meanings than its syntax. Therefore, program of a system‘s properties and hence results in
verification does not give guarantee the generated specifications which are easier to understand as
executed source code is correct as described in the they are not cluttered with unnecessary
source program. This is because the compiler may implementation details. Furthermore, the
lead to an incorrect target program due to bugs in production of a formal specification is supposed to
the compiler itself. It means verification of result in the early detection of inconsistencies
compiler is more important than verification of a because its production encourages the systematic
source program to be compiled. In this paper, consideration of the requirements. The ability to
context-free grammar is linked with Z notation to perform a limited amount of type-checking
be useful in the verification of a part of compiler. automatically on formal specifications removes
Firstly they defined the grammar, then language another source of inconsistency.
derivation procedure is described using the left 2. Ignorance of Compiler efficiency
most derivations. Next, verification of a given
Compiler performs many operations like lexical
language is described by recursive procedures. The
analysis, pre-processing, parsing, semantic analysis,
ambiguity of a language is checked as a part of the
code generation, code optimization, task
parsing analysis. By reading all these literatures it is
scheduling, memory allocation, etc. Any of these if
found that B and Z notations have been used
not formally specified with any one of the
mostly, but the same work can be done through
approaches, then it affects the compiler efficiency.
VDM which will give better output and easy to be
Already lexical analysis, pre-processing, parsing,
work with.
semantic analysis, all these have been specified
The paper is organized as follows: Section II using Z-notation, but memory allocation and task
provides the problem definition of informal and scheduling comes under optimization process, so
formal specifications like in Software industry this needs to formally specify the optimization
where the problem lies in specifying the software techniques first. In this paper, particle swarm
and pros and cons of formal specification, and also optimization is used for scheduling and its formal
describes ignorance of compiler efficiency. Section specification has been done. Since compiler
III presents the methodology used in specifying the memory allocation operation takes discrete values,
particle swarm optimization by using VDM. discrete particle swarm optimization is formal
Section IV reports the result of the formal specified.
specification of discrete particle swarm
optimization. Finally, Section V draws preliminary
conclusions on this result and an agenda for future III. METHODOLOGY
research. 1. The Vienna Development Method is a mature
formal method whose origins go back to the IBM
Vienna Laboratory in the 1970s. It is a formal
II. PROBLEM DEFINITION
method for the description and development of
1. Drawbacks of informal specification over formal computer systems. Its formal descriptions (or
specification:[25] It is often claimed that the use of 'specifications') use mathematical notation to
formal specification languages gives rise to the provide a precise statement of the intended function
desirable properties of clarity and abstraction in of a system. Such descriptions are built in terms of
specifications, and that their use leads to the early models of an underlying state with a collection of
detection of ambiguity and inconsistencies in operations which are specified by pre- and post-
requirements. The arguments for formal conditions. VDM designs are guided by a number
specifications resulting in clear and unambiguous of proof obligations whose discharge establishes
specifications are that : formal notations have a the correctness of design by either data rectification
mathematical semantics, and hence the meaning of or operation decomposition. Thus it can be seen
a given specification need not be in doubt for it can that VDM addresses the stages of development
be determined from the semantic model; and that from specification through to code. From the wide
the rich set of mathematical constructs available in variety of tools available it single out the Overture
formal specification languages, such as Z, and their

39 Shrishti Tamrakar, Anubhav Sharma


International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 5, Issue 1
January 2016

Automatic Proof System (APS) and the VDMTools own position establishes the particle‘s experience
for type checking, interpretation and code implying a local search along with global search
generation. Peter Gorm Larsen [10] presented emerging from the neighboring experience or the
―Recent industrial Applications of VDM in Japan‖. experience of the whole swarm.
He analyzed that there is an industrial use of VDM Two variants of the PSO algorithm were developed,
in Japan since the acquisition of VDMTools by one with a global neighborhood, and other one with
CSK systems. This acquisition followed a very a local neighborhood. According to the global
successful application of VDM++ in the neighborhood, each particle moves towards its best
development of two subsystems of the Trade one previous position and towards the best particle in
back office system for securities trading. FeliCa the whole swarm, called gbest model. On the other
Networks also applied VDM++ in the development hand, according to the local variant, called lbest
of a new generation IC chip for use as an electronic model, each particle moves towards its best
purse which can be embedded in a cellular previous position and towards the best particle in its
telephone. restricted neighborhood. The discrete binary
2. Particle Swarm Optimization (PSO) [24] is one version of the PSO has already been developed.
of the evolutionary optimization methods inspired PSO has been successfully applied to a wide range
by nature which include evolutionary strategy (ES), of applications such as power and voltage control,
evolutionary programming (EP), genetic algorithm mass-spring system, and task assignment. The
(GA), and genetic programming (GP). PSO is comprehensive survey of the PSO algorithms and
distinctly different from other evolutionary-type applications can be found in [].
methods in that it does not use the filtering PSO algorithm
operation- crossover and mutation and the members
Pseudo code of the general PSO is given in Figure
of the entire population are maintained through the
1. In a PSO algorithm, population is initiated
search procedure. In PSO algorithm, each member
randomly with particles and evaluated to compute
is called ―particle‖, and each particle flies around in
finesses together with finding the particle best (best
the multi-dimensional search space with a velocity,
value of each individual so far) and global best
which is constantly updated by the particle‘s own
(best particle in the whole swarm). Initially, each
experience and the experience of the particle‘s
individual with its dimensions and fitness value is
neighbors. Since PSO was first introduced by
assigned to its particle best. The best individual
Kennedy and Eberhart (1995, 2001), it has been
among particle best population, with its dimension
successfully applied to optimize various continuous
and fitness value is, on the other hand, assigned to
nonlinear functions. Although the applications of
the global best. Then a loop starts to converge to an
PSO on combinatorial optimization problems are
optimum solution. In the loop, particle and global
still limited, PSO has its merit in the simple concept
bests are determined to update the velocity first.
and economic computational cost.
Then the current position of each particle is updated
The main idea behind the development of PSO is with the current velocity. Evaluation is again
the social sharing of information among individuals performed to compute the fitness of the particles in
of a population. In PSO algorithms, search is a the swarm. This loop is terminated with a stopping
Binary Particle Swarm Optimization Algorithm criterion predetermined in advance.
conducted by using a population of particles, Initialize parameters
corresponding to individuals as in the case of Initialize population
evolutionary algorithms. Unlike GA, there is no Evaluate
operator of natural evolution which is used to Do{
generate new solutions for future generation. Find particlebest
Instead, PSO is based on the exchange of Find globalbest
information between individuals, so called Update velocity
particles, of the population, so called swarm. Each Update position
particle adjusts its own position towards its Evaluate
previous experience and towards the best previous }While (Termination)
position obtained in the swarm. Memorizing its best
Figure 1. Simple PSO algorithm

40 Shrishti Tamrakar, Anubhav Sharma


International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 5, Issue 1
January 2016

The basic elements of PSO algorithm is [0,1] [4]. The normalization function used here is a
summarized as follows: sigmoid function as:
 Particle: is a candidate solution i in swarm at
iteration. The ith particle of the swarm is represented
by a d-dimensional vector and can be defined as Xik Also the equation (1) is used to update the velocity
= [xi1k, xi2k,...xidk], where x‘s are the optimized vector of the particle. And the new position of the
parameters and xidk is the position of the ith particle particle is obtained using the equation below:
with respect to dth dimension. In other words, it is
the value dth optimized parameter in the ith
candidate solution.
 Population: popk is the set of n particles in the Where is a uniform random number in the range
swarm at iteration k, i.e., [0,1].
popk = [X1k, X2k, ... Xnk]
 Particle velocity: Vik is the velocity of particle i IV. RESULT & DISCUSSUION
at iteration k. It can be described as ,
Vik = [vi1k, vi2k,...vidk] where vid is the velocity with Using the methodology in Overture, it gives the
respect to dth dimension. following result shown in table 1 below:
 Particle best: PBik is the best value of the
particle i obtained until iteration k. The best
position associated with the best fitness value of the
particle i obtained so far is called particle best and
defined as PBik= [pbi1k, pbi2k,...pbidk] with the fitness
function f(PBik).
 Global best: GBk is the best position among all
particles in the swarm, which is achieved so far and
can be expressed as GBk = [gb1k, gb2k,...gbdk] with
the fitness function f(GBk). Table 1. Result of Formal Specification of BPSO
 Termination criterion: it is a condition that the algorithm
search process will be terminated. In this study,
search is terminated when the number of iteration The screenshot of coding in Vienna Development
reaches a predetermined value, called maximum method is shown in Fig.1
number of iteration.
3. Binary particle swarm optimization :
Kennedy and Eberhart proposed a discrete binary
version of PSO for binary problems [23]. In their
model a particle will decide on "yes" or " no",
"true" or "false", "include" or "not to include" etc.
also this binary values can be a representation of a
real value in binary search space. In the binary
PSO, the particle's personal best and global best is
updated as in real- valued version. The major
difference between binary PSO with real-valued
version is that velocities of the particles are rather
defined in terms of probabilities that a bit will
change to one.
Using this definition a velocity must be restricted
within the range [0,1] . So a map is introduced to
map all real valued numbers of velocity to the range Fig. 2 Screenshot of coding in VDM

41 Shrishti Tamrakar, Anubhav Sharma


International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 5, Issue 1
January 2016

V. CONCLUSION & FUTURE WORK [6] Nazir Ahmad Zafar, ―Automatic Construction of
formal Syntax tree based on regular expressions‖,
Though Z, B and VDM are model based formal
2012.
specification languages used for specifying user‘s [7] Juliette D‘Almeida, R.Achuthan, T.radahkrishnan,
requirements in mathematical language that can be V.S.Alagar, ‖Transformation of a semi-formal
proved, verified and tested unambiguously. While specification to VDM‖, IEEE, 1992.
the journey of all the three languages starts at the [8] Peter Gorm Larsen, kenneth Lausdahl, Nick Battle,
requirements specification phase of the software ―Combinatorial Testing for VDM‖, IEEE, 2010.
development life cycle (SDLC) model, but their [9] Y.Ledru, ―Developing reactive systems in a VDM
path divides after this phase. Z works on high level framework‖, Elsevier, 1993, 51-71.
abstraction of a system and provides a strong base [10] Peter Gorm Larsen, ―Recent Industrial Applications
for system designing and then testing it. However, of VDM in Japan‖.
[11] Bartira Dantas, ―Verified Compilation and the B
B models the system in an abstract machine
method: A Proposal and a first Appraisal‖, Elsevier,
notation that can be used further to design system, 2009,79-96.
generate its code and then refine and test the same. [12] Daniel Plagge and Michael Leuschel, ―Validation B,
VDM is used to prove the equivalence of Z and TLA+ using ProB and Kodkod‖, Technical
programming language concepts. They all do not Report, March 2012, Rev: 8536.
differ radically from one another, but at some [13] Michael Leuschel and David Schneiderm, ―Towards
factors they differ a lot. B as a high-level constraint Modelling Language
Solving the jobs puzzle challenge‖.
By seeing the different characteristics of all the
[14] John Witulski and Michael Leuschel, ―Checking
three methods, it can be concluded that as Z and B
computations of formal method tools - A secondary
has already been applied to compiler‘s specification tool chain for ProB‖.
but still remain a challenge for error-free compiler. [15] Carlos A.L.Nunes and Ana C.R.Pava, ‖Automatic
If this application is to be put through VDM, then Generation of GUI from VDM++ specification‖,
this can be helpful for providing error-free compiler ICSEA 2011,pp.399-404, ISSN:2308-4235,
better than the previous work done. Barcelona, Spain, October 23,2011 to October
All the operations of compiler are formally 29,2011.
[16] Juan C.Bicarregui, JohnS.Fitz Gerald, Peter
specified except the memory allocation and task
A.Lindsay, Richard Moore, Brian Ritchie, ―Proof in
scheduling. So memory allocation operation is done VDM : A Practitioner‘s Guide‖, 1st ed. Springer
by formally specifying the binary particle swarm 1994. Available at http://overturetool. Org
optimization algorithm. As Binary PSO has given a /publications/ books/ proof-in-vdm/Proofin VDM.
satisfiable result in formal specification, so it can pdf
be used in Task scheduling done by compiler also. [17] J.M.Spivey, ‖The Z-notation-A Reference Manual‖,
In future, we will implement this concept so that the 2nd Edition, 1998. Available at
compiler can be proven error-free in all perspective. http://spivey.oriel.ox.ac.uk/~mike/zrm/zrm.pdf
[18] Tony Hoare, ―The verifying compiler- A grand
challenge for computing research‖, Volume 50, Issue
REFERENCES 1, Pages 63-69, ACM New York, USA, Jan 2003.
[1] Dr.Arvinder Kaur, Ms Samridhi Gulati, and Available at http://www. cs.ox.ac. uk/files
Ms.Sarita Singh, ―Analysis of three formal methods- /6187/Grand.pdf
Z, B and VDM‖ , ISSN:2278-0181vol. 1, June 2012. [19] Andreas Muller, ―VDM-Vienna Development
[2] Nazir Ahmad Zafar and Fawaz Alsaade, ―Syntax-tree Method‖, Bachelor thesis in ―Formal methods in
regular expression based DFA formal construction‖, software Engineering‖, Johannes Kepler University
IIM,2012,4,138-146. Linz, April 20,2009. Available at https://
[3] Nazir Ahmad Zafar and Fahad Alhumaidan, www.yumpu.com/en/document/view/25785430/vdm-
―Transformation of Class Diagrams into Formal a-the-vienna-development-method-citeseerx
specification‖, IJCSNS,Vol.11 No.5,May 2011 [20] Christophe Ponsard and Emmanuel Dieul, ―From
[4] Khalid A.Buragga and Nazir Ahmad Zafar, ―Formal Requirements Models to Formal Specifications in
Parsing Analysis of context-free grammer using left B‖, available at http://ceur-ws.org/Vol-
most derivations‖, IARIA, 2011. 241/paper10.pdf
[5] Nazir Ahmad Zafar, ―LR(K) parser Construction [21] D J Andrews and D C Ince, ―Transformational data
using Bottom-up formal analysis‖, JSEA, 2012, 5, refinement and VDM‖, Elsevier 1995.
21-28.

42 Shrishti Tamrakar, Anubhav Sharma


International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 5, Issue 1
January 2016

[22] M. Fatih Taşgetiren & Yun-Chia Liang, ―A Binary [24] Rania Hassan, Babak Cohanim, Olivier de Weck ―A
particle swarm optimisation algorithm for lot sizing comparison of particle swarm optimization and
problem‖, Journal of Economic and Social Research genetic algorithm‖, IEEE, Power Electronics and
5 (2), 1-20, 2014 Motion Control Conference, 2009. IPEMC '09. IEEE
[23] Mojtaba Ahmadieh Khanesar, Hassan Tavakoli, 6th International, pp.822 – 825, 17-20 May 2009
Mohammad Teshnehlab andMahdi Aliyari [25] Paynter, S.E. , The Benifits of Formal Specification
Shoorehdeli, ―Novel Binary Particle Swarm are not formal, IET, Practical Application of Formal
Optimisation‖, IEEE, Control & Automation, 2007. Methods, IEE Colloquium on, pp.3/1 - 3/3, 19 May
MED '07. Mediterranean Conference on, pp. 1 – 6, 1995.
27-29 June 2007

43 Shrishti Tamrakar, Anubhav Sharma

You might also like