33
Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University December 20, 2004. University of Paderborn, Paderborn, Germany. Software Cybernetics: Progress and Challenges

Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

  • View
    218

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Aditya P. Mathur

Professor, Department of Computer Science,

Associate Dean, Graduate Education and International

Programs

Purdue University

Monday December 20, 2004. University of Paderborn, Paderborn, Germany.

Software Cybernetics:Progress and Challenges

Page 2: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Cybernetics

[n] the field of science concerned with processes

of communication and control (especially the

comparison of these processes in biological and

artificial systems)

Page 3: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Software Cybernetics

[n] the field of science concerned with processes of communication and control in software systems.

Page 4: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Sample Problems

Control of the software test process:How much and what additional effort is to be applied to achieve the desired quality objective under time/cost constraints?

Optimal selection of tests:What is an optimal set of tests for achieving the desired quality objective given time constraints?

Page 5: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Sample Problems (continued)

Software performance controlHow best to adjust software parameters so that an optimal level of performance is maintained?

Control of the software development process:What is an optimal set of process variables required to achieve delivery objectives within cost/time constraints?

Page 6: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Approaches

1. Use instinct and experience.

2. Use (1) supported by quantitative tools.

(b) Use simulation: “forward” approach.

(c) Use (a) plus feedback control: “inverse” approach.

Software cybernetic approach..

(a) Use simulation: “forward” approach.

Page 7: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Closed Loop (feedback) Control

Specifications

ProgramEffort +

f(e)Additionaleffort What is f ?

-

RequiredQuality

rQ

ObservedQuality

oQ

oQr

Qe −=

Page 8: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Sample Problem Scenario

cp1 cp2 cp3 cp4 cp5 cp6 cp7 cp8 cp9

cpi = check point i

rf

schedule set bythe manager

Approximation of how r is likely to change

r0 observed

deadline

r -

num

ber

ofre

mai

ning

err

ors

t- time

t0

Page 9: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Our Approach

Controllerrerror(t)

w’f

+

+

wf+wf

+

wf+wf

+

robserved(t)

rexpected(t)

Actual STP

sc r0

STP State Model

sc r0

Initial Settings(wf,)

wf

Test Manager

wf: workforce : quality of the test process

Page 10: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Decision Support via Feedback

ActualProcess

ParameterEstimation

ProgressMetrics

Process Model

ModelParameters

FeedbackController Estimated Future

Schedule Deviation

Sug

gest

edD

ecis

ion

Cha

nges

Mgmt.Control

ManagementDecisions

-Predicted Schedule

-

+Desired Schedule

Act

ual

Sch

edul

e

+

EstimationError

Page 11: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Challenges (Sources of difficulty)Physical Logical (software)

Laws of physics Yes No

Object controlled Physical Logical (and Humans)

Time dependence Stationary and non-stationary

Non-stationary

Rate of change Very slow to very fast

Slow

Parameter variability Relatively low High

Page 12: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Overcoming the challenge: Understanding the problem

Partnership amongst researchers and practitioners.

Is the problem real?

Are the existing solutions adequate?

Page 13: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Overcoming the challenge: Solving the problem

Parternership amongst researchers and practitioners.

Develop realistic models

Develop parameter estimation methods.

Develop ways to incorporate parameter estimation into the development process.

Page 14: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Details and Case Studies

Razorfish

Guidant Corporation

Sun Microsystems

Page 15: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Physical and Software Systems: An Analogy

Dashpot

Rigid surface

External force

Xequilibrium

X: Position

Number of remainingerrors

Spring Force

Effective Test Effort

Block

Software

Mass of the blockSoftware

complexity

Quality of thetest process

Viscosity

Xcurrent

SpringTo err isHuman

Page 16: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Physical Systems: Laws of Motion [1]

First Law:

Every object in a state of uniform motion tends to remain in that state of motion unless an external force is applied to it.

Does not (seem to) apply to testing because the number of errors does not change when no external effort is applied to the application.

Page 17: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Physical Systems: Laws of Motion [2]

Newton’s Second Law:

The relationship between an object's mass m, its acceleration a, and the applied force F is F = ma.

CDM First Postulate:

The relationship between the complexity Sc of an application, its rate of reduction in the number of remaining errors, and the applied effort E is E=Sc .

r..

Page 18: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Physical Systems: Laws of Motion [3]

Third Law:

For every action force, there is an equal and opposite reaction force.

When an effort is applied to test software, it leads to (mental) fatigue on the tester.

Unable to quantify this relationship.

Page 19: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

CDM First Postulate

The magnitude of the rate of decrease of the remaining errorsis directly proportional to the net applied effort and inverselyproportional to the complexity of the program under test.

˙ ̇ r = E

sc⇒ E = ˙ ̇ r sc

This is analogous to Newton’s Second Law of motion.

Page 20: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

CDM Second Postulate

The magnitude of the effective test effort is proportional to theproduct of the applied work force and the number of remaining errors.

for an appropriate .

Analogy with the spring:

Note: While keeping the effective test effort constant, a reduction in r requires an increase in workforce.

eet = ζwf r

Page 21: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

CDM Third Postulate

The error reduction resistance is proportional to the errorreduction velocity and inversely proportional to the overallquality of the test phase.

er = ξ1

γ˙ r

for an appropriate .

Analogy with the dashpot:

Note: For a given quality of the test phase, a larger error reduction velocity leads to larger resistance.

Page 22: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

State Model

˙ r

˙ ̇ r

⎣ ⎢

⎦ ⎥=

0 1

−ζ wf

sc−

ξ

γ sc

⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥

r

˙ r

⎣ ⎢

⎦ ⎥+

0

1

sc

⎢ ⎢ ⎢

⎥ ⎥ ⎥Fd

r

˙ r

⎢ ⎢ ⎢

⎥ ⎥ ⎥=

1 0

0 1

⎢ ⎢ ⎢

⎥ ⎥ ⎥

r

˙ r

⎢ ⎢ ⎢

⎥ ⎥ ⎥

Fd: Disturbance

x(t) = Ax(t) + B u(t).

etr eeE −=Force (effort) balance equation:

Page 23: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Computing the feedback: Question

Question:

What changes to the process parameters will achieve the desired r(T+T) ?

r(T): the number of remaining errors at time T

r(T+T): the desired number of remaining errors attime T+T

Given:

Page 24: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Computing the feedback: Answer

From basic matrix theory:

The largest eigenvalue of a linear system dominates the rate of convergence.

Hence we need to adjust the largest eigenvalue of the system so that the response converges to the desired value within the remaining weeks (T). This can be achieved by maintaining:

teTrtTr −=+ max)()( λObtain the desired eigenvalue.

Page 25: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Computing the feedback-Calculations (λmax)

Compute the desired λmax

teTrtTr −=+ max)()( λGiven the constraint:

We know that the eigenvalues of our model are the roots of its characteristic polynomial of the A matrix.

Page 26: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Computing the feedback-Calculations (λmax)

[ ]

c

f

c

cc

f

s

w

s

ss

wAI

ˆ

ˆ

ˆ

ˆ1

detdet

2 ζλ

γ

ξλ

γ

ξλ

ζλ

λ

++=

⎥⎥

⎢⎢

+

−=−

fwff wwandwhere +=+= ˆˆ

We use the above equation to calculate the space of changes to w and such that the system maintains its desired eigenvalue.

f

Page 27: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

A Flow Model of Incremental Software Development/Test

TestSpecs Test

Authoring

Feat.Specs

TestCode

Coding

TestVerification

& Correction Reg.Cases

RegressionTesting

KnownDefects

CodeDebugging

ProjectCode

LatentDefects

Page 28: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Workforce Allocation

Workforce allocated to particular tasks Effort is split across all active tasks

Page 29: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

State-Model [Example] Equations

tkPkudtkud ddTT ⋅−=+ )()()(

System State Progress

Feature Coding (fc) Code Debugging (dr) Test Authoring (ta) Test Debugging (td) Regression Testing (rr)

Defect Model Development Testing

tkPkfctkfc fc ⋅+=+ )()()(

tkPkudtkud diDD ⋅+=+ )()()(

Page 30: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

cn

bb w

w

rcrcP

⋅+−= )1(

Variable Productivity Equation

Human Productivity Workload Dependent (Csikszentmihalyi,’88)

•rb – Base Work rate

•c – Fractional size-dependent increase

•wc – Current workload size

•wn – Nominal workload size

Page 31: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

The “Productivity” Eqns.

[ ]))()(()1()()( kfckfcwrcrcdkwfkP goalfc

fcfcfcfcifcfc −⋅−= +

Process Productivity (E.g. Feature Coding)

Defect Introduction

Defect Detection (Cangussu et al., ’02)

)()()( kPikPikP drdrfcfcdi ⋅+⋅=

[ ])()()()( . kPkPkudckP rrtdTedd +⋅=

Page 32: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

Control Strategy

Model Predictive Control

timek k+Pk0

Desired behavior

Actual Behavior

Control Input Prediction Horizon

Predicted FutureBehavior

CalculatedControl Input

Page 33: Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Monday December

2,2,

21

,)(Q

Pkk

Q

Pkkd uxxkJ Pkk

p

++ +−= +

Model Predictive Control Select Cost Functional

E.g. Q1,Q2 := positive definite

Calculate

where S[xk, uk,k+P] xpk,k+P

)(min,

kJPkku +