+ All Categories
Home > Documents > StiCProb: A Novel Feature Mining Approach using ...

StiCProb: A Novel Feature Mining Approach using ...

Date post: 11-Apr-2022
Category:
Upload: others
View: 5 times
Download: 0 times
Share this document with a friend
39
StiCProb: A Novel Feature Mining Approach using Conditional Probability Yutian Tang, and Dr. Hareton Leung The Hong Kong Polytechnic University, Hong Kong @SANER 2017 more: www.chrisyttang.org/loong 1
Transcript
Page 1: StiCProb: A Novel Feature Mining Approach using ...

StiCProb: A Novel Feature Mining Approach using Conditional Probability

Yutian Tang, and Dr. Hareton Leung The Hong Kong Polytechnic University, Hong Kong

@SANER 2017 more: www.chrisyttang.org/loong

1

Page 2: StiCProb: A Novel Feature Mining Approach using ...

Motivationlegacy —-> product line

pm

acpi cpu_freq

acpi_system performance

cpu_hotplug powersave

1. How to locate the feature ? 2. How to measure ? feature← →⎯ element

Classi Classj

2

Page 3: StiCProb: A Novel Feature Mining Approach using ...

How to locate?

3

feature model

DomainExpert

defines

Step 1 Step 2 Step 3

Developers/Tool

Step 4

DomainExpert

select

feature seeds

feature mining strategy

A

B

C

Product Variants

1. Select seeds 2. Annotate features

Page 4: StiCProb: A Novel Feature Mining Approach using ...

Basic

4

Programming elements

Relationship

E

R⊆ E × E

Annotation

FFeature

A⊆ E × F

Page 5: StiCProb: A Novel Feature Mining Approach using ...

Basic (cond’)

5

mutual exclusion M ⊆ F × F

implications ⇒⊆ F × F

full annotation A⊆ E × F

A* = e, f( ) e, f( )∈A,g⇒∗ f{ }(e, f ) (e, f ) e, f( )∈A,g⇒ f

Page 6: StiCProb: A Novel Feature Mining Approach using ...

Annotate Features

6

Annotation State

S(A*, f ,i) = e e, f( )∈A*{ }

AnnotationState (i)

AnnotationState (j)

start end

mining process for a single feature

CandidateElements

seeds all elements in f

Page 7: StiCProb: A Novel Feature Mining Approach using ...

Feature-Element Correlation Coefficient

7

S A*, f ,i( ) S A*, f ,i +1( )

Prog. Elements Cand. feature f

Annotation State (i)

Annotation State (i+1)

Page 8: StiCProb: A Novel Feature Mining Approach using ...

Feature-Element Correlation Coefficient(cond’)

8

p e S A*, f ,i( )( )S A*, f ,i( ) S A*, f ,i +1( )

Prog. Elements Cand.

feature f

Page 9: StiCProb: A Novel Feature Mining Approach using ...

Feature-Element Correlation Coefficient(cond’)

calls

t

backward forwardt ∈S A*, f ,i( )

Page 10: StiCProb: A Novel Feature Mining Approach using ...

10

Feature-Element Correlation Coefficient(cond’)

Program P

(1) s = 0

(2) i = 0

(3) while (i < 5)

(4) if (i < 3)

(5) t = 1

(6) else t = i - 2

(7) s = s + t

(8) i = i + 1

(9) return s

enCFG

1

2

3

4

5

6

7

89

ex

en

1

2

3

4

56

7

8

ex

9

CDG DDGen

1

2

3

4

56

7

8

ex

9

s

t

i

i

en

1

2

3

4

56

7

8

ex

9

PDG

s

i

t

i

en

1

2

3

4

56

7

8

ex

9

i

i

SS: 3

Slicing Scope

sscope e( ) = e∪ s s dfcf⎯ →⎯ e, s∈E{ }

Page 11: StiCProb: A Novel Feature Mining Approach using ...

11

Feature-Element Correlation Coefficient(cond’)

Bindingbind e( ) = def e( )∪use e( )*

Context Binding

f

b.f()c.f()

contbind e, c[ ]( ) input context

sscope e( )in

* All def and use within e

Page 12: StiCProb: A Novel Feature Mining Approach using ...

12

Context BindingContext Binding @ Method Invocation

callsite l = r0.m r1,r2,...,rn( )

[13] L. O. Anderson, “Program analysis and specification for c programming language”

contbind m,[r1,...,rn ]( ) = dispatch pi = ri( )→ bind m( )

Page 13: StiCProb: A Novel Feature Mining Approach using ...

13

Context BindingContext Binding @ Method Invocation

[13] L. O. Anderson, “Program analysis and specification for c programming language”

main(){ A a = new A(); z = wrapper(a); }

wrapper (A b){ y = bar(b); return y; }

bar (A c){ x = c.f; return x; }

a ocallsite 1csite 1:

contbind wrapper(..), a[ ]( )

Page 14: StiCProb: A Novel Feature Mining Approach using ...

14

Context BindingContext Binding @ Overriding

Animal

Cow

:eat(food: Food)

:eat(food: Grass)

m 1. def and use in m2. def in parent class/interface, used in m

Page 15: StiCProb: A Novel Feature Mining Approach using ...

15

Context BindingContext Binding @ Overriding

def(m) use(m) def(p(1))�>use(m)

def(p(2))�>use(m)

def(p(n))�>use(m)def(c)-def(m)

def(m)∪use(m)

Page 16: StiCProb: A Novel Feature Mining Approach using ...

16

Context BindingContext Binding @ Overriding

contbind m, p1,..., pn[ ]( ) = def m( )∪ use m( ) ∼> def pi( )( )i=1

n

defined in m:

used in m:

def m( )

use m( ) 1. used in m and defined in m2. used in m and not defined in m

~> used to specify the source of the context

Page 17: StiCProb: A Novel Feature Mining Approach using ...

17

Context BindingContext Binding @ Overriding : Example

1 public class FlyingCar implements OperateCar {2 public int startEngine(int encryptedValue) {3 OperateCar.super.startEngine(OperateCar.encryptedValue);4 }5 }——————————————————————————————————6 public interface OperateCar {7 int encryptedValue = 1;8 default public int startEngine(int value) {…}9 }

contextbind startEngine( ) = encryptedValue,OperateCar.encryptedValue{ }

Page 18: StiCProb: A Novel Feature Mining Approach using ...

18

Context BindingContext Binding @ Inheritance

Animal

Cow

contbind c, p1,.., pn[ ]( ) = bind c( )∪ def pi( )i=1

n

Page 19: StiCProb: A Novel Feature Mining Approach using ...

19

Feature-Element Correlation Coefficient(cond’)

Context Binding

f

b.f()c.f()

contbind e, c[ ]( ) input context

context-aware points-to analysisby default:

Page 20: StiCProb: A Novel Feature Mining Approach using ...

Feature-Element Correlation Coefficient(cond’)

S(A*, f ,i) = e e, f( )∈A*{ }

S(A*, f ,i) = contextbind a( )a

a∈S A* , f ,i( )∪

Page 21: StiCProb: A Novel Feature Mining Approach using ...

StiCProb

1. Build Program DB

2. Build uniqueness table

3. Annotate features

Page 22: StiCProb: A Novel Feature Mining Approach using ...

StiCProb: Uniquess Tableelement s and t with a relation r

U E,T ,R,Pforward ,Pbackward( )Pforward

the uniqueness of t to s if s has been annotated to a feature f

s r⎯→⎯ t

S t

S(A*, f ,i) = e e, f( )∈A*{ }s∈S A*, f ,i( )

Page 23: StiCProb: A Novel Feature Mining Approach using ...

StiCProb: Uniquess Table(cond’)

Pforwardthe uniqueness of t to s if s has been annotated to a feature f

pforward s r⎯→⎯ t s, f( )∈A*( ) = contbind t, s[ ]( )contbind s( )

S t

S(A*, f ,i) = e e, f( )∈A*{ }s∈S A*, f ,i( )

Page 24: StiCProb: A Novel Feature Mining Approach using ...

StiCProb: Uniquess Table(cond’)

Pbackwardthe uniqueness of s to t if t has been annotated to a feature f

pbackward s r⎯→⎯ t t, f( )∈A*( ) = contbind t, s[ ]( )contbind t, i[ ]( )

i r⎯→⎯ t∪

contbind t, i[ ]( )i r⎯→⎯ t∪ a collection of context binding from all prog.

elements, which have relation r with t.

S t

S(A*, f ,i) = e e, f( )∈A*{ }s∈S A*, f ,i( )

Page 25: StiCProb: A Novel Feature Mining Approach using ...

StiCProb

candidate set

f - annotation state (i)

f - annotation state (i+1)me

e

mn

Page 26: StiCProb: A Novel Feature Mining Approach using ...

StiCProbFeature model(fm)

Seeds(seeds)

threshold

Uniqueness Table(U)

Page 27: StiCProb: A Novel Feature Mining Approach using ...

Case StudyProjects LOC #features domain

Prevalyer 8,009 5object

persistence library

MobileMedia 4,653 6 mobile

Lampiro 44,584 *2 message client

ArgoUML ~120K 7 modeling tool

Page 28: StiCProb: A Novel Feature Mining Approach using ...

Case StudyExperimental Setting:

Related Approaches:

Measurement:

seeds: FLAT3 toolfeature model: benchmarkbenchmark

Type system, Topology analysis, Text comparison

tool: Loong Eclipse plugin

precision recall f-score

Page 29: StiCProb: A Novel Feature Mining Approach using ...

Case StudyOther Settings:

# seeds: 3

threshold: 0.6

Page 30: StiCProb: A Novel Feature Mining Approach using ...

Experimental Result

30

StiCProb with threshold t = 0.6

LOC: line of code, FR: count of distinct code fragments, IT: number of iteration, Prec.: precision

Page 31: StiCProb: A Novel Feature Mining Approach using ...

Experimental Result (cond’)

31

StiCProb with threshold t = 0.6

LOC: line of code, FR: count of distinct code fragments, IT: number of iteration, Prec.: precision

Page 32: StiCProb: A Novel Feature Mining Approach using ...

Experimental Result (cond’)

32

������

���

���

���

���

��

��

��

���������

��������

Recall Performance Precision PerformanceSP: StiCProb (t = 0.6)TP: topology analysis

TS: type systemTC: text comparison

Page 33: StiCProb: A Novel Feature Mining Approach using ...

Experimental Result f-score

33

SP: StiCProb (t = 0.6)TP: topology analysis

TS: type systemTC: text comparison

0

0.15

0.3

0.45

0.6

f-score

0.12

0.440.450.55

SP TS TP TC

Page 34: StiCProb: A Novel Feature Mining Approach using ...

Experimental Result Runtime

34

SP: StiCProb (t = 0.6)TP: topology analysis

TS: type systemTC: text comparison

0

35

70

105

140

Prevalyer MobileMeida Lampiro

135

21

71

1332 121 2922

SP TS TP TC

0

1500

3000

4500

6000

ArgoUML

5,415

1,980254

1,500

SP TS TPTC

Page 35: StiCProb: A Novel Feature Mining Approach using ...

Discussion

35

Seeds:

2. number of seeds

3. granularity of seeds: coarse granularity could improve the recall performance, but sometimes at the cost of precision.

1. seeds provided by FLAT3 might be not correct

Page 36: StiCProb: A Novel Feature Mining Approach using ...

DiscussionThresholds:

threshold: 0.6 —-> 0.8

precision: 83% —-> 85%

The threshold contributes less to the performance.

Structure of the program

Page 37: StiCProb: A Novel Feature Mining Approach using ...

Thanks

Page 38: StiCProb: A Novel Feature Mining Approach using ...

Loong Plugin

• Download: http://www.chrisyttang.org/loong/

• Source code: https://github.com/csytang/Loong

• Experimental results: https://drive.google.com/folderview?id=0B9l0qvk6pnW0ZDRYMmxIQVhRb0U&usp=sharing

• Online Tutorial: http://www.chrisyttang.org/loong/

Page 39: StiCProb: A Novel Feature Mining Approach using ...

Discussion

• Need of req. specification <—> seeds selection/ poor naming

• Variants of our approach? or better solutions ?

• - weighted graph —> graph clustering

• ?


Recommended