Automated Software Transplantation Earl T. Mark Yue Alexandru Justyna Barr Harman Jia Marginean Petke CREST, University College London Alexandru Marginean — Automated Software Transplantation
Why Autotransplantation? ~100 players Check open source repositories Why not handle Video Player H.264? Start from scratch Alexandru Marginean — Automated Software Transplantation
Related Work Manual Code Transplants In-Situ Code Reusal Dependence Clone Detection Code Migration Analysis Feature Feature Location Code Salvaging Extraction Automatic Error Fixing Autotransplantation Synchronising Automatic In-Situ Code Manual Replay Copy- Reuse Transplants Paste Alexandru Marginean — Automated Software Transplantation
Related Work Miles et al.: In situ reuse of logically extracted functional components In-Situ Code Reusal Manual Code Transplants Debugger Binary Automatic Error Fixing Autotransplantation Organ Running Program Alexandru Marginean — Automated Software Transplantation
Related Work Sidiroglou-Douskos et al.: Automatic Error Elimination by Multi-Application Code Transfer Automatic Error Fixing Manual Code Transplants In-Situ Code Reusal Host Donors Autotransplantation Alexandru Marginean — Automated Software Transplantation
Related Work Autotransplantation Manual Code Transplants In-Situ Code Reusal Automatic Error Fixing Alexandru Marginean — Automated Software Transplantation
Human Organ Transplantation Alexandru Marginean — Automated Software Transplantation
Automated Software Transplantation Donor ENTRY Manual Work: V Organ Entry Organ O Organ’s Organ’s Test Suite Test Suite Host Implantation Point Alexandru Marginean — Automated Software Transplantation
μ Trans Host Stage 2: Stage 3: Stage 1: Genetic Organ Static Analysis Programming Implantation Donor Organ’s Host Test Suite Beneficiary Alexandru Marginean — Automated Software Transplantation
Stage 1 — Static Analysis Donor Organ Vein ENTRY OE H Matching Implantation Table Dependency Point Graph Donor: int X -> Host: int A, B, C Stm: x = 10; -> Decl: int x; Alexandru Marginean — Automated Software Transplantation
Stage 2 — GP Individual S 1 S 2 S 3 S 4 S 5 … S n Matching V 1H M 1 : V 1D Var M 2 : V 4H V 2D Does it compile? Stateme Genetic nts S 1 S 7 S 73 … Programming Matching Table Donor Host Variable Variable ID ID (set) ( V 1H V 2H 3 (1 + | T X i | + | T P i | 1 | T | ) i ∈ I C V 1D | T | fitness ( i ) = 0 i / ∈ I C V 3H V 4H V 5H V 2D … Weak Proxies: Strong Proxies: Does it Does it execute test cases without produce the correct output? crashing? Alexandru Marginean — Automated Software Transplantation
Research Questions Acceptance Tests Regression Tests Donor Host Organ RQ1: Do we break the initial RQ2: Have we really added RQ4: Is autotransplantation RQ3: How about the computational effort? new functionality? functionality? useful? Alexandru Marginean — Automated Software Transplantation
Research Questions RQ1: Do we break the initial RQ2: Have we really added functionality? new functionality? Empirical Study Case Study: 15 Transplantations H.264 Encoding 300 Runs Transplantation 5 Donors 3 Hosts RQ3: How about the RQ4: Is autotransplantation computational effort? useful? Alexandru Marginean — Automated Software Transplantation
Validation Donor Regression Acceptance Tests Tests Augmented Acceptance Regression Tests Tests RQ1.1 RQ1.2 RQ2 Host Manual Beneficiary Validation Alexandru Marginean — Automated Software Transplantation
f a c i t t r A * C o m p * l e t t n A e e Subjects * t s * E W i s n e C o l A l C D T * o * S c e u s S m u e E e I R n * o t v t e d y s a * E a d l e u t a Size Reg. Organ Subjects Type • Minimal size: KLOC Tests Test Suite 0.4k; Idct Donor 2.3 - 3-5 Mytar Donor 0.4 - 4 Cflow Donor 25 - 6-20 • Max size: 422k; Webserver Donor 1.7 - 3 TuxCrypt Donor 2.7 - 4-5 • Average Donor: Pidgin Host 363 88 - Cflow Host 25 21 - 16k; SoX Host 43 157 - Case Study • Average Host: x264 Donor 63 - 5 VLC Host 422 27 - 213k; Alexandru Marginean — Automated Software Transplantation
Experimental Methodology Count LOC — Count LOC and Setup CLOC CLOC Host Donor Organ’s Implantation OE Test Suite Point Validation Test x 20 Suites GNU Time Coverage Information: Gcov Ubuntu 14.10, 16 GB Ram Host μ S CALPEL 8 threads Beneficiary Implantation Point Organ Alexandru Marginean — Automated Software Transplantation
f a c Empirical Study i t t r A * C o m p * l e t t n A e e * t s * E W i s n e C o l A l C D T * o * S c e u s S m RQ1,2 u e E e I R n * o t v t e d y s a * E a d l e u t a All All Test Suites Donor Host Passed Passed Regression Regression Regression++ Regression++ Acceptance Acceptance Idct Pidgin 16 20 17 16 Mytar Pidgin 16 20 18 20 Web Pidgin 0 20 0 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 0 0 0 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 0 0 0 17 Cflow SoX 14 16 15 14 Tux SoX 13 13 13 14 256/300 TOTAL 188/300 188/300 233/300 233/300 196/300 196/300 256/300 RQ1.1 RQ1.1 RQ1.2 RQ1.2 RQ2 RQ2 Alexandru Marginean — Automated Software Transplantation
f a c Empirical Study i t t r A * C o m p * l e t t n A e e * t s * E W i s n e C o l A l C D T * o * S c e u s S m RQ3 u e E e I R n * o t v t e d y s a * E a d l e u t a Timing Information Execution Time (minutes) Donor Host Average Std. Dev. Total 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 10 (Average) 72 (hours) 334 (min) RQ3 Alexandru Marginean — Automated Software Transplantation
f a c Case Study i t t r A * C o m p * l e t t n A e e * t s * E W i s n Second Annual MSU e C o l A l C D T * o * S c e u s S m RQ4 u MPEG-4 AVC/ H.264 e E e I R n * o t v t e d y s a * E a d l e u t a Codecs Comparison MSU Sixth MPEG-4 AVC/H.264 Transplant Time & Test Suites Video Codecs Comparison, with ~24% better encoding Time (hours) Regression Regression++ Acceptance than second place. H.264 26 100% 100% 100% Doom9's 2005 Codec Shoot-Out Alexandru Marginean — Automated Software Transplantation
Automated Software μ Trans Transplantation D ENTRY Host Manual Work: V Stage 2: Stage 3: Organ Entry Stage 1: O Genetic Organ Static Analysis Programming Implantation Donor Organ’s Organ’s Test Suite Test Suite H Implantation Point Organ’s Host Test Suite Beneficiary Alexandru Marginean — Automated Software Transplantation Alexandru Marginean — Automated Software Transplantation f a c i t t r A * C o m * p l e t t n e A e Validation Subjects t * s * E i W s n e C o l A l C D T * o * S e c u s S m u e E e I R n * o t t e v d y s a * E a d l e u t a Donor Regression Size Reg. Organ Acceptance Subjects Type • Minimal size: Tests KLOC Tests Test Suite Tests 0.4k; Idct Donor 2.3 - 3-5 Mytar Donor 0.4 - 4 Cflow Donor 25 - 6-20 • Max size: 422k; Augmented Acceptance Webserver Donor 1.7 - 3 Regression Tests TuxCrypt Donor 2.7 - 4-5 Tests RQ1.a • Average Donor: Pidgin Host 363 88 - Cflow Host 25 21 - RQ1.b RQ2 16k; SoX Host 43 157 - Case Study Host Manual • Average Host: Beneficiary Validation x264 Donor 63 - 5 VLC Host 422 27 - 213k; Alexandru Marginean — Automated Software Transplantation Alexandru Marginean — Automated Software Transplantation
Recommend
More recommend