Sie sind auf Seite 1von 9

Journal of Computer Technology & Applications

Volume 2, Issue 1, March, 2011, Pages 32-40.

_____________________________________________________________________________________________

SOFTWARE-FAULT TOLERANCE WITH OOP APPROACH BY .NET


Jigna B. Prajapati*, Savan K.Patel, Dr.S.M,Parikh

Acharya Motibhai Patel Institute of Computer Studies, Ganpat University, Kherva, Mehsana,
Gujrat, India.

Abstract
Present study was focus on Object Oriented Paradigm using Visual Basic.net which can
be reusable and robust structures that support the prediction of fault tolerance of
software errors in the application layer. Once any software developed, their first goal is
to create error free and objective met software. Although developers often have several
problems after completion of their task, here we will give fault-tolerance techniques
with vb.net. We are trying to show Fault tolerance can be implemented with Visual
Basic.net. Implementation supports the approach of user defined library and re-designs.

KeyWords — Visual basic.net, object-oriented programming, software-fault tolerance,


Recovery Block (RcB), N-Version Programming (NVP).

*Author for correspondence Email: jigna.prajapti@ganpatuniversity.ac.in Tel: 9925043272

Introduction

To manage software system complexity, to As we develop our routine any code with
convert any real time problem, we use Object Oriented Paradigm (OOP) with
object-oriented programming. To enhance object Library based on meta object
reliability into any Software system we need protocols, we implement a set of monitoring
some of the new creation introducing by mechanisms for software fault tolerance in
Software fault-tolerance (1). Approaches Visual basic.net. Meta-level interface hides
and mechanisms are therefore required to most implementation details of the fault-
allow the system working with software tolerant mechanism at the application level
faults remaining in the system after its and allows the programmer to flexibly
development. There are many ways to do change the use of various schemes of fault
which have been proven successful (2). tolerance without modifying the code of
Here, we introduce our experience using application programs.
Visual basic.net for the implementation of
reusable, robust structure that can effectively In Addition, the document includes our
support the prediction of software fault reproduced model and implementation
tolerance at the application level in object- framework for software error tolerance and
oriented software (3). We focus on reliable addresses the separation of concerns
systems that can reduce the encumbrance of regarding the development of fault-tolerant
individual programmers, and therefore less programs. Visual basic.net is used to define
likely to produce software failures. and implement object libraries that support
© STM Journals 2011. All Rights Reserved. 32
Journal of Computer Technology & Applications
Volume 2, Issue 1, March, 2011, Pages 32-40.

_____________________________________________________________________________________________

software fault tolerance. Very firstly we As we know, software failures are endless. It
would like to focus on the software fault can occur any time because of any reason
tolerance framework, later OOP and fault though we keep mind over the development.
tolerance is discussed. Here we are There are many ways to manage errors in
developing the code for dealing with faults fault tolerance. First, we would focus on the
when the application is running. Finally, our Design Diversity. It is an approach in which
experiments focus on different sets of code the making of two or more components
and their results. intended at achieving the same output
through independent designs and
An Approached Framework of Software- implementations (6, 7). Design diversity
Fault Tolerance begins with the initial requirement of
specification. (1).
Fault tolerance can be made available, by
redundancy, functionality according to the Variety of designs with data diversity and
requirement, and when the flaws that environmental diversity of the whole system
occurred or are occurring. Laprie argues that can produce better services. There may be at
resilience is achieved by redundancy (5). It least two variations to design system faults
may be fine for the bugs that are not caused tolerance, which requires a primary solution
by design flaws; though, repeatedly of the that provides expected error-free result of
design fault in more than a few places will performance variations.
not help in the implementation of the
specification. It is also important to Classical techniques for tolerating software
emphasis on the specification as the final design faults are mostly based on some form
arbiter that no software faults tolerance in of design diversity including Recovery
the context of this work is a concern with all Blocks (RcB) (8) and N-version
methods required by the system to tolerate programming (NVP) (6). The RcB is one of
software design faults. To discuss the the two original varieties of techniques of
software fault tolerance, we must first software fault tolerance. It was introduced in
establish, or uncover a conceptual model for 1974, Horning et al., from early
describing software systems. The system is implementations developed by Randall in
supposed to consist of many components 1975 and Hecht in 1981 (8).
that interact under the control design (1).
The components are as systems in their way,
but the design of the system is also a
component which has special characteristics
for managing the interaction between the
components and the linkage between the
system and its environment.

© STM Journals 2011. All Rights Reserved. 33


Journal of Computer Technology & Applications
Volume 2, Issue 1, March, 2011, Pages 32-40.

_____________________________________________________________________________________________

Thus, the resulting rank of the variation


reflects the degradation in the performance
of the variation. A voting mechanism
determines a single adjudication result from
a set or a subset of all the results of variation
which are usually executed in parallel.

Apart from the two well-known approaches,


a number of other schemes for software-
fault tolerance have been developed such as
N Self-Checking Programming (7) for
sequential programs and Conversations (8).
NVP was suggested by Elmendorf in 1972
and developed by Avizienis and Chen in
1977–1978. NVP gives us the different
version of the same system (6). Compared
with RcB, NVP is static method. This means
that the task is executed by multiple
processes or programs, and the result will be
accepted only if it is recognized as an
acceptable outcome usually via a majority
vote. Hardware fault tolerance architectures
Fig. 1: Design diversy by RcB associated with NVP are N-modular (6).

RcB work with variations in output made We classify programmers into three classes
during the program execution on the basis of of fault-tolerant object-oriented program:
results of acceptance tests. RcB uses the users failover objects, designers of fault-
acceptance test, back and restore order to tolerant objects (or foot-designer) and
achieve fault tolerance. We know that most system (or meta-level) programmers. If only
of the functions of the program can be using fault-tolerant object or an improved
executed in more than one ways using version of the original object, the user must
different algorithms and structures. These know a little information about the
different functions are variations which have interested object of fault-tolerant or not.
varying degrees of effectiveness in the
management and use of memory, execution
time, reliability and other criteria. RcB
includes this variation, the most efficient
module, is the first in the flow. And it is
called a primary alternative or primary unit.

© STM Journals 2011. All Rights Reserved. 34


Journal of Computer Technology & Applications
Volume 2, Issue 1, March, 2011, Pages 32-40.

_____________________________________________________________________________________________

So, a supporting system for the development


of fault-tolerant programs may be defined in
a very conceptual way. To do so, we
required a network base system where
objects may be located in different nodes
started from node-1 to node-n which has
many objects over the network. Many
components can use many objects as shown
in communicative network. We use failover
objects, designers of fault-tolerant objects or
meta-level programs. When we concern
about the objects based network system,
where they are distributed in various nodes.
In which nodes have different collections of
objects. The objects are not generating the
same code of meta objects either for RcB or
for NVP. But this can enhance productivity
when we use OOP fundaments with the
same type of system.

OOP Approach

OOP is an approach to programming in


which each data item with the operations
used on it is designated as an object; the
Fig 2: Design diversity by NVP routines used to operate on the data item are
called methods; and objects are grouped in a
Though FT-designer is required for the hierarchy of classes (10). A programming
construction of fault-tolerant program, and technique that enables you to work with
therefore he/she must know more about the self-contained collections of data structures
schemes to combat software-error and is and routines interacts with other objects
responsible for development and associated (10). OOP having many advantages like
abnormalities of the arbitrator. He / she will simplicity, modularity, modifiability,
also choose the special schemes such as RcB extensibility etc. OOP supports many
or NVP for the development of fault-tolerant features like encapsulation, abstraction,
program. Notice that the control mechanism inheritance, polymorphism, message
for fault-tolerance scheme should be passing, data hiding, etc. (11).
independent of the application and so can be
done to re-use. It is a system programmer Class: collection of different entity to
who is responsible for providing FT- perform one specific task. Encapsulation:
designer with high-level programming The values of the variables inside an object
interface for various software fault-tolerance are private, unless methods are written to
schemes, which hides the implementation pass that information outside of the object.
details of the mechanisms of their control. Inheritance: Each subclass inherits all
variables and methods of its super class.
© STM Journals 2011. All Rights Reserved. 35
Journal of Computer Technology & Applications
Volume 2, Issue 1, March, 2011, Pages 32-40.

_____________________________________________________________________________________________

Polymorphism: ability to take more than one Implementation of OOPs in Visual


form from one form. basic.net for Software Fault Tolerance

We will start with a simple example of a


Sorting application. This example is made
up of an application program and three
Sorting servers. Each Sorting server
implements a variation of the Sorting
operation by receiving an object which
contains a list of integer numbers, Sorting
the list, and then sending the result back to
the application. Here is one interface called
ItemList which include the Sorting
mechanism in the form of function, when we
create the object of the same class and call
the method that can help us use differently
like quick, RCB, NVP etc. One of the
Method (function) of class ItemList will use
different kind parameters can be redefined
Fig. 3: Meta Object in vb.net later in the sub-classes of ItemList. The
interface will become the reusable
Visual basic.net is one of the object-oriented components of the system which will use
languages, and it also includes inheritance, when ever the same set of code is required.
data abstraction, reusable components,
portable codes and device freedom (3, 4). Public interface ItemList
Abstraction and inheritance are based on the Function Itemlist(ByVal k As Integer) As
concept of a class: instances of a class are IntegerFunction vector(ByVal k As Integer)
objects with specific operations provided for As Integer
their manipulation. Furthermore, given a End interface
base class, a sub-class of the base class can Assume that there exist some VB library
be defined so as to inherit some or all of the programs provided by the system
attributes of the base class (3,4). Whole set programmers that implement the control
of code treated as the meta data for the same mechanisms for different fault tolerance
program. Meta data are stored within an schemes. The class below provides several
assembly which isolated like Main Objects interfaces for the control of recovery blocks,
and Sub Objects. N-version programming and other schemes.

There are several possible solutions for Public Interface FaultT1


software-fault tolerance in the application Function Variation(ByVal port As Integer,
layer (2, 7), but most this is based on pre- ByVal machine As Char)
defined, user defined classes and runtime Function QuickSort() As Integer
libraries. Function RCB(ByVal Obj As
FaultTolerance1) As Boolean
Function NVP(ByVal Obj As
FaultTolerance1) As Boolean
© STM Journals 2011. All Rights Reserved. 36
Journal of Computer Technology & Applications
Volume 2, Issue 1, March, 2011, Pages 32-40.

_____________________________________________________________________________________________

End Interface End function


We are introducing our own interface for the „define each method from interface
different faults tolerance techniques that can Public function QuickSort() as integer
be bound within one code. Interface FaultT1 implements FaultT1. QuickSort()
having three techniques of Design diversity Dim ob2 as Items
would used for relative fault managing. Dim err AS Boolean
At this point FaultT1 is the interface of the Private Sub BubbleQuickSort()
reference type that will be used by the Dim temp As Integer = 0
various classes in the remote servers. Both For j As Integer = 0 To arr.Length - 1
control structures return a Boolean result For k As Integer =(arr.Length)-1 To j + 1
indicating if the variations achieve an Step -1
acceptable result (TRUE) or an incorrect IfCInt((arr.GetValue(k)))<
result (FALSE). Since an arbitrator is often CInt((arr.GetValue(k - 1))) Then
application-specific, the object passed to the temp = CInt(arr.GetValue(k))
fault-tolerant control structures must provide arr.SetValue(arr.GetValue(k-1),
a pre-defined Arbitrator operation. As an k)
example, the control mechanism for arr.SetValue(temp, k - 1)
recovery blocks could be implemented by End If
the system programmer as follows. Next
Next
Public class Item End Sub
Implements FaultT1, ItemList Obj2.variation(p1,"node1.a")
Dim s As System.Net.Sockets.Socket Obj2.variation(p2,"node2.b")
„implements all property and method from Obj2.variation(p3,"node3.c")
interface err = Obj2.RCBlock(list)
„action(event) return err
Public function RCB(ByVal Obj As item) End class
implements FaultT1. RCB
„Use socket class At this point, Item is class which
Dim BK As item implements the FaultT1, ItemList. As it
BK = Obj implements, means it uses the concepts of
for i=0 to i< nVariations multiple inheritance, it can use all the
„Try alternate/Variation property and methods of implemented
s.Connect("host as string", Port as integer) interfaces. More precisely, the structure RcB
s.Close() control receives the object and passes that
if (obj.Arbitrator()) then object to the first variation. When the result
„Ensure test was not successful comes back, referee operations are
„recover the object and try performed. If the result is acceptable, it
„another alternate/Variation returns TRUE, or, otherwise object is
else restored and the following alternative holds.
return(TRUE) If all the deputies are not satisfied, the
end if operation RcB returns an error signal (false)
„ All alternates failed that a satisfactory result can not be obtained.
return (FALSE) (Note that the sockets were used in this
next i particular experiment.
© STM Journals 2011. All Rights Reserved. 37
Journal of Computer Technology & Applications
Volume 2, Issue 1, March, 2011, Pages 32-40.

_____________________________________________________________________________________________

It can be easily modified using various enabling speedy experimentations and some
communication protocols, such as reduction of the extra burden on the FT-
mechanisms of RPC, used by the system designers. However, the application
Arjuna (11). Now, by using the reusable programmer who wishes to utilize the
control structures provided above, an fault library routines must be fully responsible for
tolerant designer can easily construct correct use of them; the programming
dependable versions (or sub-classes) of the conventions related to the use of library
ItemList class. The fault tolerant designer programs must be strictly adhered and all
has to develop the Variations and to indicate checks as to the faithfulness can be
which type of objects will be handled by the performed only by the programmer
FaultT1. him/herself. Moreover, such conventions
cannot make a clear separation between
Public function NVP(ByVal Obj As item) application code and the extra code for
implements FaultT1. NVP software-fault tolerance. To support Sorting,
Dim i As Integer = left, j As Integer = right we can have QuickSort as well as NVP for
Dim temp As Integer achieving Design diversity.
Dim pivot__1 As Integer =
CInt(arr.GetValue(Pivot(right, left))) Public class FMT
While i <= j Inherits Item
While CInt(arr.GetValue(i))< pivot1 if ( NOT obj.List) then
i += 1 „Use NVP(..)
End While Else
While CInt(arr.GetValue(j)) > pivot1 „use QuickSort()
j -= 1 End if
End While End Function
If i <= j Then End class
temp = CInt(arr.GetValue(i))
arr.SetValue(arr.GetValue(j), i) Suppose one would like to make the
arr.SetValue(temp, j) QuickSort() operation fault-tolerant. We
i += 1 should be able to make the QuickSort()
j -= 1 operation reflective first and inherits it by
End If the next used class of vb.net. Note that the
End While code of the control mechanisms
If left < j Then implemented in FMC can use Item and
QuickSort(left, j) FaultT1 both. So the base-level programs
End If will be very similar to normal, non-fault-
If i < right Then tolerant ones and Item is derived from
QuickSort(i, right) Itemlist which treated as sub objects.
End If Further, we can create any class that can use
End Function our earlier defined class for achieving same
functionality.
We defined the QuickSort() for the different
objects from different nodes which can use
it. We can achieve few advantages of this
approach as no change to the compiler so
© STM Journals 2011. All Rights Reserved. 38
Journal of Computer Technology & Applications
Volume 2, Issue 1, March, 2011, Pages 32-40.

_____________________________________________________________________________________________

Experimental Evaluation used to measure the times. Here is chart


representation of the data of above table 1.
In our experiment we use vb.net version 5 as
basic programming language. Clients and In Test One, every QuickSort operation was
servers communicate with each other using executed without fault injection, and all lists
TCP / IP by System.Net.Sockets. We received were correctly sorted. It is
believe that this means of communication is interesting to notice that the dependable
effective enough to support our experiment versions based on RcB and NVP have
on the fault-tolerance and object-oriented longer execution time than the faster
development. We define a special object that versions of the normal Sorting operation. It
provides functionality for connection over has longer execution time than RcB which
network with System.Net.Sockets.Socket. uses QuickSort as its first alternate.
Two operations are tied to Socket: However, due to the use of an acceptance
Connect(), which is responsible for test, the overhead of RcB is slightly higher
establishing the connection between the than that of the QuickSort operation itself.
client and the server to send the object on
the server, and Close () is responsible for In Test Two, design faults were also inserted
obtaining the result from the server and into the server; this causes the failure of
close the connection. QuickSort. The RcB can still deliver correct
computation. NVP fails because the voter
Table 1 Performance-related testing OUTPUT. failed to find the majority of three different
results. This time, we can see that the time
Test 1 2 3 of NVP is shorter than that of RcB since
QuickSort O/P DONE NOT NOT RcB has to activate all its alternate to reach
DONE DONE a correct result.
Time 2089 289 2207 Chart1: Performance-related testing OUTPUT
RcB O/P DONE DONE NOT
DONE
Time 4312 14004 4225
NVP O/P DONE NOT DONE
DONE
Time 9971 8971 9971

In order to examine the effectiveness of each


implementation testing based on software-
fault injection is performed. Here we have
three techniques of fault tolerance which
wrapped in reflective code through interface,
class and function as QuickSort, RcB and
NVP. The O/P of the each method‟s
execution time was measured in
microseconds (µseconds) while the time of
network communication is assumed as
constant. A data set of 200 elements was

© STM Journals 2011. All Rights Reserved. 39


Journal of Computer Technology & Applications
Volume 2, Issue 1, March, 2011, Pages 32-40.

_____________________________________________________________________________________________

In the third test, some software faults which References


cannot be detected by the acceptance test
were inserted into the Sort server, and both 1. P. A. Lee and T. Anderson. Fault
QuickSort and RcB produce erroneous lists Tolerance: Principles and Practice
without signaling any error. The general Second Edition, Springer-Verlag. 1990.
overhead is similar to those in the first test. 2. M. Lyu (ed.) Software Fault Tolerance
Note that NVP can tolerate such a fault very Trends in Software series, WILEY.
effectively. 1995.
3. Gabria Oances and Bob Donald Visual
Conclusions Basic .Net By Example by Techmedia
Publication.
We can have modular programming 4. Bill Evjen et al. Visual Basic.net
implemented in VB.net with the Meta Programming Bible by willy-India
object. Whatever we use function, class and Publication.
interface, all these features along with 5. http://www.ece.cmu.edu/~koopman/des
socket programming show that the run-time _s99/sw_fault_tolerance.
overhead of software-fault tolerance. The 6. Avizienis A. “The N-Version
fault tolerance would become more effective Approach to Fault-Tolerant Software”
when we make it clear, structured, IEEE Transactions on Software
separation of both design and operation Engineering 1985. SE-11(12) 1491-
stages. The metaobject approach provides an 1501p.
FT-designer with the clearer and simpler 7. Laprie J. C. et al. Hardware and
interface but with a slightly higher run-time software fault tolerance: definition and
overhead. We experiments these modules analysis of architectural solutions in
with different types of error at different type Proceedings of 17th International
of phase and shown the results of their Symposium on Fault-Tolerant
Execution. Computing, Pittsburgh. 1987. 116-
121p.
8. Randell B. “System Structure for
Software Fault Tolerance” IEEE
Transactions on Software Engineering
1975 SE-1(2) 220–232p.
9. www.ic.gc.ca/eic/site/trmcrt.nsf/eng/rm
00196.html.
10. Robert Layfort. Object Oriented
Concept and Programming in C++
Galgotia publication.
11. Shrivastava S. K. et al. “An Overview
of the Arjuna Distributed Programming
System” IEEE Software 1991. 8(1) 66-
73p.

© STM Journals 2011. All Rights Reserved. 40

Das könnte Ihnen auch gefallen