Testability of Software System: Manu Phogat, Dharmender Kumar Research Scholar, DCRUST Murthal, Haryana, India
Testability of Software System: Manu Phogat, Dharmender Kumar Research Scholar, DCRUST Murthal, Haryana, India
Abstract
This paper investigates factors of the testability of object- Major Factors
oriented software systems. The starting point is given by a
study of the literature to obtain both an initial model of Testing Criterion. A major factor of the test effort picture
testability and existing OO metrics related to testability. is the degree of validity that the software is required to
The goal of this paper is to define and evaluate a set of have. Based on the validity requirements, a project uses a
metrics that can be used to assess the testability of the testing criterion (or code coverage criterion) that specifies
classes of an Object Oriented System. which parts of the software have to be tested. In effect, a
testing criterion will establish a lower bound on the
validity of the software, and an upper bound on the number
of test cases required. A project will thus have to make a
1. Introduction trade-off between the verification of validity on the one
hand, and the required amount of testing on the other.
What is it that makes code hard to test? Why is one class
easier to test than another? How can I tell that I‘m writing Documentation. There are many reasons why a software
a class that will be hard to test? What contributes to a system should be accompanied by documentation of
class‘ testability? How can quantify this notion? Software several kinds. With regards to testing, requirements and
testability is affected by many different factors, including specifications are of prime importance, capturing required
the required validity, the process and tools used, the and specified behavior, respectively. These documents
representation of the requirements, and so on — in the next should be correct and complete, and clear links should
section we will survey what has been written on this topic exist between the concepts captured in the various
so far. This paper investigates testability from the documents.
perspective of unit testing, where our units consist of the
classes of an object-oriented software system. Our Implementation. The implementation is the target of all
approach is to evaluate a set of object-oriented metrics testing, and thus the extent to which the implementation
with respect to their capabilities to predict the effort allows itself to be tested is a key factor of the testing effort.
needed for testing. We choose this approach because One important aspect of the implementation is
metrics are a good driver for the investigation of aspects of determinism; it should be possible to consistently repeat
software. The evaluation of metrics that are thought to tests. The major part of the implementation of an
have a bearing on the testing effort allows us, on the one application consists of source code expressed in one or
hand, to gain insight into the factors of testability, and to more programming languages. Factors of the source code
obtain refined metrics on the other. Both results can that relate to the testability of the implementation, and thus
subsequently be used in further studies. the testing effort, are the topic of this paper.
1.1 Testability Test Suite. Factors of the test suite itself also determine
the effort required to test. Desirable features of test suites
are correctness, automated execution and reuse of test
The ISO defines testability as ―attributes of software that
cases. Similar to the system-under-test, test suites need
bear on the effort needed to validate the software product‖
documentation detailing the implemented tests, a test plan,
[2]. Binder [1] offers an analysis of the various factors that
test results of previous test runs and reports.
contribute to a system‘s testability.
IJCEM
www.ijcem.org
IJCEM International Journal of Computational Engineering & Management, Vol. 14, October 2011 58
ISSN (Online): 2230-7893
www.IJCEM.org
IJCEM
www.ijcem.org
IJCEM International Journal of Computational Engineering & Management, Vol. 14, October 2011 59
ISSN (Online): 2230-7893
www.IJCEM.org
IJCEM
www.ijcem.org
IJCEM International Journal of Computational Engineering & Management, Vol. 14, October 2011 60
ISSN (Online): 2230-7893
www.IJCEM.org
4.1.3 Dependency Based Testability 3. All method overloading and over ridding allow.
Measurement 4. Not consider static method but treat public static
void main as a starting point.
5. Not consider abstract method.
Clearly, the two previous approaches need program source
code and/or a program-based model to support software The input, output and constant for the java class will
testability measurement. A. Bertolino and L. Strigni [7] be as follows
proposed a black-box approach, where the software
testability measurement is performed based on the Input:
dependency relationships between program inputs and 1. All parameter into the class.
outputs. The basic idea is to perform an oracle in a manual 2. Parameters pass into the method signature.
(or systematic) mode to decide whether a given program 3. All class method parameter of the parent class
behave correctly on a given test. The oracle decides the excluding system parameter.
test outcome by analyzing the behavior of the program 4. All method of interface implementation.
against its specification. In particular, an input/ output
(I/O) oracle only observes the input and the output of each Output:
test, and looks for failures. A program is correct with 1. The return value of the method
respect to its specification if it is correct on every input 2. Any exception either checked or unchecked by
setting; otherwise the program is faulty. If the program the method
generates an incorrect output, then the test has failed. If the 3. All implicit parameter & object attribute define in
oracle output is approved, then the test is successful. the class
4. Object reference in the method signature.
5. Goal Constant
In this paper working definition of testability is 1. Final
―Testability of a program is a degree of simplicity of the 2. Literal
program‖. In this work we are trying to understand the 3. Static final variable is also effectively used as a
simplicity in the form of complexity. Means if system‘s constant.
complexity is increase that means its simplicity decrease
and the effort of testing (Testability) will increase. 5.2 Complexity Measurement
Cyclomatic complexity is software metric (measurement).
5.1Testability Measurement
It was developed by Thomas J. McCabe [14] and is used to
Several techniques have been made for development of
measure the complexity of a program. It directly measures
meaningful testability [10, 11, and 12] but here we are
the number of linearly independent paths through a
using the testability measurement techniques of John
program's sourcecode. Cyclomatic complexity is computed
McGregor and S. Srinivas [13].They mentioned that
using the control flow graph of the program: the nodes of
Testability of a method into the class depends upon the
the graph correspond to the commands of a program, and a
visibility component. Testability of method is
directed edge connects two nodes if the second command
might be executed immediately after the first command.
TM=constant*(VC)
Testability of the class is
The cyclomatic complexity of a flow graph is as follows
θ=min (TM)
M = E − N + 2P
The definition of the visibility component (VC) is
Where
VC= Possible Input/Possible Output M = Cyclomatic complexity
E = Number of edges of the graph
Before doing implementation we are defining our input, N = Number of nodes of the graph
output and constant for testability analysis work and also P = Number of connected components.
taking some assumption for this work.
Assumption: Example:
1. Not consider system parameter 1. Vending Machine
2. Consider only concrete class. 1. public class VendingMachine
IJCEM
www.ijcem.org
IJCEM International Journal of Computational Engineering & Management, Vol. 14, October 2011 61
ISSN (Online): 2230-7893
www.IJCEM.org
1 Vending 3/3=1 2*1=2 After the study our conclusion is that testability is a quality
Machine factor that attempts to predict how much effort will be
() required for software testing and to estimate the difficulty
2 void 3/3=1 2*1=2 2 of causing a fault to result in a failure (called revealing the
insert() fault).
3 void 3/3=1 2*1=2
return() 7. References
4 void 4/4=1 2*1=2 1.R. Binder. Design for testability in object-oriented
vend()
systems. Comm. of the ACM, 37(9):87–101, 1994
IJCEM
www.ijcem.org
IJCEM International Journal of Computational Engineering & Management, Vol. 14, October 2011 62
ISSN (Online): 2230-7893
www.IJCEM.org
IJCEM
www.ijcem.org