SCAM’08 -- Evaluating Key Statements AnalysisZheng Li Evaluating Key Statements Analysis David...

Post on 08-Jan-2018

229 views 1 download

description

SCAM’08 -- Evaluating Key Statements AnalysisZheng Li Key Statement Analysis (KSA) Identify key statements The statements that capture most impact with highest cohesion

Transcript of SCAM’08 -- Evaluating Key Statements AnalysisZheng Li Evaluating Key Statements Analysis David...

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Evaluating Key Statements AnalysisEvaluating Key Statements Analysis

David Binkley - Loyola College, USA

Nicolas Gold, Mark Harman, Zheng Li, Kiarash Mahdavi

CREST, King’s College London, UK

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Overview

• KSA• Two metrics

– Impact– Cohesion

• Research Questions• Empirical study• Results

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Key Statement Analysis (KSA)

• Identify key statements

• The statements that capture most impact with highest cohesion

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Why KSA

Many analyses produce far too much e.g. slicing, chopping

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Framework

Modules

Functions ClassesConcept bindings

Principal Variables Key Statements

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Principal Variables (PV)

Bieman and Ott’s Principal Variables

• PVG – a global variable assigned in F• PVO – a variable used in an output

statement in F• PVG U PVO

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

void cylinder(int r, h){

D=2*r;perimeter=PI*D;undersurface=PI*r*r;sidesurface=perimeter*h;area=2*undersurface+sidesurface;volume=undersurface*h;printf(“\nThe Area is %d\n", );printf(“\nThe Volume is %d\n", );

}

r

h

areavolume

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Metrics for KSA

• Impact: outward influence of the key statements

• Cohesion: inward connectedness of the key statements

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Cohesion

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Dependence Cluster

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

The worst case for KSA

If all statements in a module are in a dependence cluster…

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Research Questions

• Size• Impact • Cohesion• Large dependence cluster

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Analysis Subjects

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Tools

• CodeSurfer

• SPSS

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Impact

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Cohesion

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

Results

• Size– 25% of the function size

• Impact– 70% of impact of the function.

• Cohesion– More than 80% of cohesion

• Large Dependence Cluster– a clear and largely negative impact

SCAM’08 -- Evaluating Key Statements Analysis Zheng Li

less is more less is more