Automated Software Transplantation QRS 2016 Talk by Mark Harman - - PowerPoint PPT Presentation

automated software transplantation
SMART_READER_LITE
LIVE PREVIEW

Automated Software Transplantation QRS 2016 Talk by Mark Harman - - PowerPoint PPT Presentation

Automated Software Transplantation QRS 2016 Talk by Mark Harman PhD work by Alexandru Marginean Collaborators Earl Barr, Yue Jia, Justyna Petke CREST, University College London Automated Software Transplantation QRS 2016 Talk by Mark


slide-1
SLIDE 1

Automated Software Transplantation

QRS 2016 Talk by Mark Harman PhD work by Alexandru Marginean

CREST, University College London

Collaborators Earl Barr, Yue Jia, Justyna Petke

slide-2
SLIDE 2

Automated Software Transplantation

QRS 2016 Talk by Mark Harman PhD work by Alexandru Marginean

CREST, University College London

Collaborators Earl Barr, Yue Jia, Justyna Petke

slide-3
SLIDE 3

Video Player Start from scratch

Why Autotransplantation?

Check open source repositories Why not handle H.264? ~100 players

slide-4
SLIDE 4

Why Autotransplantation?

Kate Start from scratch Check open source repositories C Call Graph? C Indentation?

slide-5
SLIDE 5

BBC World Service Interview WIRED article Many shares on Social Media ACM Distinguished Paper Award at ISSTA ‘15

Recognition for Our Tool μScalpel

slide-6
SLIDE 6

Autotransplantation Automatic Error Fixing In-Situ Code Reusal Manual Code Transplants

Related Work

Clone Detection Code Migration Dependence Analysis Feature Location Code Salvaging Feature Extraction In-Situ Code Reuse Synchronising Manual Transplants Automatic Replay Copy- Paste

slide-7
SLIDE 7

Autotransplantation Automatic Error Fixing

Related Work

Manual Code Transplants

In-Situ Code Reusal

Running Program Debugger

Binary Organ

Miles et al.: In situ reuse of logically extracted functional components

slide-8
SLIDE 8

Autotransplantation Manual Code Transplants In-Situ Code Reusal

Automatic Error Fixing

Related Work

Host Donors

Sidiroglou-Douskos et al.: Automatic Error Elimination by Multi-Application Code Transfer

slide-9
SLIDE 9

Related Work

Manual Code Transplants In-Situ Code Reusal Automatic Error Fixing

Autotransplantation

slide-10
SLIDE 10

Human Organ Transplantation

slide-11
SLIDE 11

Automated Software Transplantation

Host Donor

  • Organ

Organ ENTRY

Implantation Point

V

Organ Test Suite

Manual Work:

  • Organ Entry
  • Organ’s Test Suite
  • Implantation Point
slide-12
SLIDE 12

μTrans

Host Donor Stage 1: Static Analysis Host Beneficiary Stage 2: Genetic Programming Stage 3: Organ Implantation Organ Test Suite

Implantation Point Organ Entry

slide-13
SLIDE 13

Stage 1 — Static Analysis

Donor OE ENTRY

Vein Organ

Matching Table Dependency Graph Host Implantation Point Stm: x = 10; -> Decl: int x; Donor: int X -> Host: int A, B, C

slide-14
SLIDE 14

Stage 2 — GP

S1 S2 S3 S4 S5 … Sn

Matching Table

  • V3H V4H

Donor Variable ID Host Variable ID (set)

V1D V2D … V1H V2H V5H Individual

Var Matching Stateme nts

V1D V1H V2D V4H S1 S7 S73 M1: M2: … Genetic Programming

Compilation Week Proxies Strong Proxies

Fitness Function:

slide-15
SLIDE 15

Stage 2 - Gp Operators

Individual

Var Matching Stateme nts

V1D V1H V2D V4H S1 S7 S73 M1: M2: … Replace Mapping Matching Table

  • Donor

Variable ID Host Variable ID (set)

V1D V1H V2H V2H

slide-16
SLIDE 16

Stage 2 - Gp Operators

Individual

Var Matching Stateme nts

V1D V1H V2D V4H S1 S7 S73 M1: M2: … Replace Statement

S1 S2 S3 S4 S5 … Sn

S7 S3

slide-17
SLIDE 17

Stage 2 - Gp Operators

Individual

Var Matching Stateme nts

V1D V1H V2D V4H S1 S7 S73 M1: M2: …

S1 S2 S3 S4 S5 … Sn

Remove Statement

slide-18
SLIDE 18

Stage 2 - Gp Operators

Add Statement

S1 S2 S3 S4 S5 … Sn

Individual

Var Matching Stateme nts

V1D V1H V2D V4H S1 S7 S73 M1: M2: … S3

slide-19
SLIDE 19

Stage 2 - Gp Operators

Crossover Operator Individual 1 S1 S7 M1 M2 Individual 2 S3 S9 M3 M4 Offspring 1 Offspring 2 Offspring 3 Random Mapping Selection M1 S1 M4 S9 M3 S3 M2 S7 S1 S7 S3 S9 M3 M2

slide-20
SLIDE 20

Host Organ Donor RQ1: Do we break the initial functionality? RQ2: Have we really added new functionality? RQ3: How about the computational effort? RQ4: Is autotransplantation useful?

Research Questions

Regression Tests Acceptance Tests

slide-21
SLIDE 21

Research Questions

RQ1: Do we break the initial functionality? RQ3: How about the computational effort? RQ4: Is autotransplantation useful? RQ2: Have we really added new functionality? Empirical Study

  • 15 Transplantations

300 Runs 5 Donors 3 Hosts Case Studies:

  • H.264 Encoding

Transplantation; Kate - call graph generation & C indentation;

slide-22
SLIDE 22

Validation

Regression Tests Augmented Regression Tests Donor Acceptance Tests Acceptance Tests Manual Validation RQ1.1 RQ1.2 RQ2 Host Beneficiary

slide-23
SLIDE 23

Subjects

Minimal size: 0.4k Max size: 422k Average Donor:16k Average Host: 213k

  • Subjects

Type Size KLOC Reg. Tests Organ Tests Idct Donor 2.3

  • 3-5

Mytar Donor 0.4

  • 4

Cflow Donor 25

  • 6-20

Webserver Donor 1.7

  • 3

TuxCrypt Donor 2.7

  • 4-5

Pidgin Host 363 88

  • Cflow

Host 25 21

  • SoX

Host 43 157

  • Case Study

VLC Host 422 27

  • Kate

Host 50 238

  • x264

Donor 63

  • 5

Cflow Donor 22

  • 13

Indent Donor 26

  • 7
slide-24
SLIDE 24

Experimental Methodology and Setup

μSCALPEL Host Implantation Point Donor

  • OE

Organ Test Suite

Host Beneficiary

Implantation Point Organ

Count LOC — CLOC Count LOC CLOC

x 20 GNU Time

Validation Test Suites

  • Coverage Information:

Gcov 64 bit Ubuntu 14.10 16 GB RAM 8 threads

slide-25
SLIDE 25

Alexandru Marginean — Automated Software Transplantation Donor Host All Passed Regression Regression++ Acceptance Idct Pidgin 16 20 17 16 Mytar Pidgin 16 20 18 20 Web Pidgin 20 18 Cflow Pidgin 15 20 15 16 Tux Pidgin 15 20 17 16 Idct Cflow 16 17 16 16 Mytar Cflow 17 17 17 20 Web Cflow 17 Cflow Cflow 20 20 20 20 Tux Cflow 14 15 14 16 Idct SoX 15 18 17 16 Mytar SoX 17 17 17 20 Web SoX 17 Cflow SoX 14 16 15 14 Tux SoX 13 13 13 14 TOTAL 188/300 233/300 196/300 256/300 RQ1.1 RQ1.2 RQ2

Empirical Study RQ1,2

  • All Passed

188/300 Regression 233/300 RQ1.1 Regression++ 196/300 RQ1.2 Acceptance 256/300 RQ2

slide-26
SLIDE 26

Alexandru Marginean — Automated Software Transplantation Execution Time (minutes) Donor Host Idct Pidgin 5 7 97 Mytar Pidgin 3 1 65 Web Pidgin 8 5 160 Cflow Pidgin 58 16 1151 Tux Pidgin 29 10 574 Idct Cflow 3 5 59 Mytar Cflow 3 1 53 Web Cflow 5 2 102 Cflow Cflow 44 9 872 Tux Cflow 31 11 623 Idct SoX 12 17 233 Mytar SoX 3 1 60 Web SoX 7 3 132 Cflow SoX 89 53 74 Tux SoX 34 13 94 Total

Empirical Study RQ3

Average 334 (min)

  • Std. Dev.

Total 72 (hours) 10 (Average)

slide-27
SLIDE 27

Case Study VLC

Transplant Time & Test Suites Time (hours) Regression Regression++ Acceptance H.264 26 1 1 1

  • VLC

H264

slide-28
SLIDE 28

Donor Host All Passed Organ Test Suite Regression Regression++ Acceptance Cflow Kate 16 18 20 17 18 Indent Kate 18 19 20 18 19 TOTAL 34/40 37/40 40/40 35/40 37/40 All Passed — RQ1.1 RQ1.2 RQ2

Case Study - Kate

Regression 40/40 RQ1.1 Regression++ 35/40 RQ1.2 Acceptance All Passed 37/40 RQ2 34/40 All Passed Organ Test Suite 37/40 — Execution Time (minutes) Donor Host Average (min)

  • Std. Dev. (min)

Total (hours) Cflow Kate 101 31 33 Indent Kate 31 6 11 Total 132 18.5 44

  • Std. Dev. (min)

Total (hours) 44 18.5 Average (min) 132