Optimal Testing Effort Control for Modular Software System Incorporating the Concept of Independent and Dependent Faults : A Control Theoretic Approach

In this paper, we discuss modular software system for Software Reliability Growth Models using testing effort and study the optimal testing effort intensity for each module. The main goal is to minimize the cost of software development when budget constraint on testing expenditure is given. We discuss the evolution of faults removal dynamics in incorporating the idea of leading /independent and dependent faults in modular software system under the assumption that testing of each of the modulus is done independently. The problem is formulated as an optimal control problem and the solution to the proposed problem has been obtained by using Pontryagin Maximum Principle.


Introduction
The software development industry has grown dramatically in scope, complexity and pervasiveness over the last few decades at an unprecedented pace.The Internet has practically transformed the world into a big computer network, where communication, information and business are constantly taking place on-line.Most industries are highly dependent on computers for their basic day-to-day functioning.Safe and reliable software operation is a significant requirement for many types of systems.Aircraft and air traffic control, medical devices, nuclear safety, petrochemical control, high speed rail, financial systems, automated manufacturing, military and nautical systems, aeronautics, space missions and appliance-type applications such as automobiles, washing machines, temperature control and telephony are highly computerized.
The cost and consequences of these systems failure can range from mildly annoying to catastrophic, with serious injury occurring or lives lost.As software assumes more responsibility for providing functionality and control in these systems, it becomes more complex and significant to the overall system performance and dependability.The software reliability assessment is important to evaluate and predict the reliability and performance of a software system.The models applicable to the assessment of software reliability are called Software Reliability Growth Models (SRGMs).Starting from the late sixties, in the approximately past 40 years a vast literature of software reliability models has been developed.Extensive research exists in modeling the failure detection and fault removal phenomenon by an Non-homogenuous poisson process (NHPP) [1,2,3].These models have been widely studied and applied on real software projects.Many concepts of software reliability modeling have been developed and models are proposed considering the various dynamic aspects of the software testing and debugging.Most of these models assume a perfect debugging environment.This means whenever an attempt is made to remove a detected fault it is removed perfectly and no new faults are generated.The earliest model in this category was due to Goel and Okumoto [4].Some other models in this category are Yamada et al. [5]; Ohba [6,7]; Yamada and Osaki [8]; Bittanti et al. [9] and Kapur and Garg [10] etc. Testing efforts plays a very crucial role on the testing progress.For example, at any instance of time during the testing phase testing can be made more rigorous through the additional testing efforts.A model that accommodates the effect of testing effort on the reliability growth more often proves to be more useful in the later phases of the testing as it can be used to determine the amount of additional efforts required to reach a specified reliability objective.Most of these earlier SRGMs use execution time as the unit of fault detection/removal period and either assume that the consumption rate of testing resources is constant or do not explicitly consider the testing effort and its effectiveness.A testing effort function describes the distribution or consumption pattern of testing resources (CPU time, manpower, etc) during the testing period.Putnam [11]; Yamada et al. [12,13,14]; Bokhari and Ahmad, [15]; Kapur et al. [16,17]; Kuo et al. [18] and Huang et al. [19,20,21], proposed SRGMs describing the relationship among the testing time (calendar time), testing-effort expenditure and the number of software faults detected.Most existing SRGMs belong to exponential-type models.Kapur et al. [17] and Huang et al. [19,20,21] proposed S-shaped testing effort dependent SRGM based on Yamada delayed S-shaped model which also describe the leaning phenomenon of the testing team.
The optimal control theory is a branch of mathematics developed to find optimal ways to control a dynamic system.Most early developments are reported in engineering literature.Optimal control problems with state variable inequality constraints arise frequently not only in Mechanics and aerospace engineering but also in area of management sciences and economics [22,23,24,25,26,27].In the present paper, we applied optimal control theory to solve a general and important problem related to modular software system for SRGMs using testing effort as a control variable.
In this paper, we discuss modular software system for SRGM using testing effort and how to allocate optimal testing effort to each module such that the total amount of testing effort expenditure is fixed.Here we assume that software firm wants to plan the testing process for the different modules with the objective to minimize the total software testing cost.Testing of each modules is done independently.We formulate an optimal control theory problem for modular software system and study the optimal testing effort expenditure rate towards each module.And, we apply Maximum Principle to solve testing effort allocation problem in modular software system.
We organized the paper as follows.In Section 2, we discuss the evolution of faults removal dynamics in modular software system under the assumption that testing of each modules is done independently and practitioner may choose independently the testing effort intensity directed to each different module.The problem is discussed and solved using Pontryagin's Maximum principle with Particular cases in Section 3.

Model Formulation
Testing is an important stage of Software Development Life Cycle as it provides the measure of software reliability and assists to judge the performance, safety, fault tolerance or security of the software.As most software systems are modular, it is of great importance for the management to allocate the limited testing effort recourses among the software modules in an optimal way.Testing effort can be measured by the manpower, the number of test cases, the number of CPU hours etc.There exist a number of successful S-shaped models in literature of the software reliability but we are mainly concerned here with the Kapur and Garg model [10] due to its simplicity and capability to study the failure growth rate of software.It has been observed that during testing, the team can remove some faults in the software, without these faults causing any failures.Fault which is removed consequent to failure is known as a leading fault.While removing the leading faults, some other faults are removed which may have caused failure.These faults are known as dependent faults.
We begin our analysis by describing a model for modular software system with a very few number of assumptions [19,1].Here are the modeling assumptions: 1) The fault removal process follows the Non Homogenous Possion Process (NHPP).
2) The software system is composed of N independent modules that are tested independently.
3) The total amount of testing resources expenditure available for the module testing processes is fixed and denoted byW .4) The system manager has to allocate the total testing resources W to each software module to minimize the number of faults remaining in the system during the testing period.5) If any of the software modules is faulty, the whole software system fails.6) The detection of the error causing failure also results in detection of the remaining errors without those errors causing any failure.
With these assumptions, the number of faults detected by the current testing effort expenditure is proportional to the number of remaining faults.The evolution of fault removal dynamics for each modules can be described by the following differential equation:  in (1) Where, m i (t) is the expected mean number of faults detected in time (0, t) in i th module, a i is initial number of faults in i th module in the software before start of testing phase, p i is the fault detection rate, i q is the fault detection rate of additional faults and i w is current testing effort expenditure rate in the time interval (0,t] for i th modules.

Wt i
is the allocated amount of testing resources expenditure for i th module and We can evaluate the total software cost by using cost criterion, the cost of testing-effort expenditures during software development and testing phase, and the cost of correcting errors before and after release [28].Therefore, the total software cost for each module as follows Where, 1i C is the cost of testing effort ( i w ) utilized for correcting an error during testing for i th module, 2i C is the cost of testing effort ( (3) Here, optimization problem is how to allocate optimal testing effort to each module such that the total amount of testing effort expenditure for all modules is fixed.We formulate an optimal control problem to allocate an optimal amount of testing effort to each modules to minimize the total software testing cost.The problem consisting of choosing the control variable () i wt such that it minimizes the total testing cost at time t, with the requirement that there are N modules in system.Let T is the release time of software product.Now the objective can be written as ) subject to (1) and the testing resources expenditure constraints for all modules Constarint (5) corresponds to the common testing effort allocation resourse capacity that is allocated among all the modules.This is the only constraint that is coupling the modules and prevents us from simply solving n times a singlemodule problem.
Therefore, the modules dependent testing problem is equivalent to determine the minimal cost for all modulus and testing effort rate The optimal control formulation can be written as:

Solution and Results of Proposed Optimal Control Problem
To solve the above optimal control theory problem (P1), we have introduced a new state variable B(t) into the problem such that the integral constraint can be replaced by a condition in terms of B(t).
Let us define     Where, the upper limit of integration is the variable t , not the terminal time T .The derivative of this variables is

B t w t (Equation of motion for B(t)) . And the terminal values of B(t)
in the testing period are Using new state variable with terminal conditions (6), we can restate optimal control problem (P1) as follow: Thus, we have an optimal control problem with n control variable(w i (t)) and n+1 state variable (m i (t), B(t)) for all modules.
To solve the , we define the Hamiltonian as A simple interpretation of the Hamiltonian is that it represents the sum of current cost Assuming the existence of an optimal control solution, the maximum principle provides the necessary optimality conditions [29].There exists a piecewise continuously differentiable function λ i (t) and µ(t) for all tϵ[0,T].Where λ i (t) and µ(t) are known as adjiont variables and the value of λ i (t) and µ(t) at time t describe the marginal valuation of variables m i (t) and B(t) at time t respectively (or λ i (t) stands for future cost incurred as one more fault introduced in the system at time t and µ(t) is the future cost of testing per unit testing effort expenditure at time t ).It describes the similar behavior in optimal control theory as dual variable have in non linear programming.
The following necessary optimality conditions holds for an optimal solution: Where   0 The Hamiltonian is independent of B(t), we have . It is clear that the multiplier associated with any integral constraint is constant over time irrespective of their nature (i.e.whether equality or inequality).
From the optimality conditions, we get the testing effort rate As () ii m t a , value of testing effort rate increasing and becomes very large.
The solution of the equation( 10) is W t w d as the cumulative testing effort towards i th module.The above equation takes the form p q W t ii p q W t i i e m t a q e p (12) Equation ( 12) gives the optimal number of faults detected in time (0, t) in i th module.Integrating equation (11) with condition λ i (T)=0, we have the future cost of removing one more fault can be given as Particular Cases: In the next section, we examine the behaviour of the proposed optimal control problem by changing the correcting costs.

When the costs are linear function of testing effort
In this section, we assume that the costs are linear function of testing effort i.e.  (13) From the optimality conditions, we have optimal value of testing effort rate   * i wt for each module.The optimal testing effort for each module is a m t a (14) The optimal value of adjoint and state equations are The physical interpretation of the above optimal policies for the testing effort allocation can be decribed as: Intially m i (t) increases due to S-shaped nature of fault detection function, then allocation path of testing effort expenditure will decrease.Later allocation path of testing effort expenditure will start increasing, when m i (t) slow down due to S-shapedness in fault detection rate.

When the costs are constant
In this section, we assume that the costs Where C 2i andC 1i are constant values [20].
To solve the optimal control problem, we can define the Hamiltonian as The Here, H and it is called the "switching function" and is illustrated in Fig. 3.This type of optimal control is known as "bangbang" in the terminology of optimal control theory.However, interior control is possible on an arc along which   0  16) can be written as The interpretation of the optimal polices given by equation ( 17) can be described as follows: If the total cost of correcting an error is less than the unit testing cost, then all testing effort expenditure rate should be minimum for all modules.On the other hand, if total cost of correcting an error is greater than the unit testing cost, then all testing effort expenditure rate should be maximum for all modules.Using equation ( 8) and ( 17 From equation (19) ,we show that    i t is the negative and decreasing function.The physical interpretation of the    i t is marginal value of faults at time t , which should be negative because increase in the number of faults will increase the correcting cost.Equation (20) shows the optimal expected mean number of faults detected in time (0,t) with optimal testing effort * i w   0  ii u or u depend on switching function.

Conclusion
In this paper, we present an optimal allocation problem of testing resource expenditure for modular software system under dynamic condition.We propose a optimal control theortic approach to optimize the resource allocation problem.It minimizes the cost of software development with a given fixed amount of testing resouces expenditure.

C
are not directly dependent on testing effort rate i.e.
can be omitted in the equation.Since the Hamiltonian is linear in control variable, the maximum principle given the following condition for the optimal testing effort arcs[27].Now, the equation (
) , we can defined the adjoint variable and state variable as follows