1. Recommendation Systems for Code Reuse Tao Xie Department of Computer Science North Carolina State University Raleigh, USA
2.
3. Example Task from Eclipse Programming Task: How to parse code in a dirty editor of Eclipse? ? Query: “ IEditorPart -> ICompilationUnit ” Open Source Projects 1 2 N … … Extract MIS 1 MIS 2 ... … MIS k *MIS: Method-Invocation sequence, FMIS: Frequent MIS FMIS 1 FMIS 2 … FMIS n Recommend Mine PARSEWeb [Thummalapenta&Xie ASE 07]
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14. What are Developers Searching for? Assieme [Hoffmann et al. UIST 07] 339 sessions related to Java programming 15 million queries of Windows Live Search from May 2006. 117 API sessions (34.2%); 70 trouble-shooting sessions (20.6%)
34. #include <abcdef.h> void p ( ) { b ( ) ; c ( ) ; } void q ( ) { c ( ) ; b ( ) ; } void r ( ) { e ( ) ; f ( ) ; } void s ( ) { f ( ) ; e ( ) ; } int main ( ) { int i, j, k; a ( ); if ( i == 1) { f ( ) ; e ( ) ; c ( ) ; exit ( ); } else { if ( j == 1 ) p ( ); else q ( ); d ( ) ; if ( k == 1 ) r ( ); else s ( ); } } Frequent SubSeq/Partial Order Consider APIs a, b, c, d, e, and f Apiator [ Acharya et al. FSE 07 ]
35. #include <abcdef.h> void p ( ) { b ( ) ; c ( ) ; } void q ( ) { c ( ) ; b ( ) ; } void r ( ) { e ( ) ; f ( ) ; } void s ( ) { f ( ) ; e ( ) ; } int main ( ) { int i, j, k; a ( ); if ( i == 1) { f ( ) ; e ( ) ; c ( ) ; exit ( ); } else { if ( j == 1 ) p ( ); else q ( ); d ( ) ; if ( k == 1 ) r ( ); else s ( ); } } 1 a f e c 2 a b c d e f 3 a c b d e f 4 a b c d f e 5 a c b d f e a d c e b f a b d e a b d f a c d e a c d f (b) Static program traces (c) Frequent sequential patterns Support 4/5 (d) Frequent partial order R (a) Example code Consider APIs a, b, c, d, e, and f Frequent SubSeq/Partial Order Apiator [ Acharya et al. FSE 07 ]
36. #include <abcdef.h> void p ( ) { b ( ) ; c ( ) ; } void q ( ) { c ( ) ; b ( ) ; } void r ( ) { e ( ) ; f ( ) ; } void s ( ) { f ( ) ; e ( ) ; } int main ( ) { int i, j, k; a ( ); if ( i == 1) { f ( ); e ( ); c ( ); exit ( ); } else { if ( j == 1 ) p ( ); else q ( ); d ( ) ; if ( k == 1 ) r ( ); else s ( ); } } 1 a f e c 2 a b c d e f 3 a c b d e f 4 a b c d f e 5 a c b d f e a d c e b f a b d e a b d f a c d e a c d f (b) Static program traces (c) Frequent sequential patterns support, 4/5 (d) Frequent partial order R (a) Example code Frequent SubSeq/Partial Order Consider APIs a, b, c, d, e, and f Apiator [ Acharya et al. FSE 07 ]
37. 1 a f e c 2 a b c d e f 3 a c b d e f 4 a b c d f e 5 a c b d f e a d c e b f a b d e a b d f a c d e a c d f (b) Static program traces (c) Frequent sequential patterns support, 4/5 (d) Frequent partial order R (a) Example code #include <abcdef.h> void p ( ) { b ( ) ; c ( ) ; } void q ( ) { c ( ) ; b ( ) ; } void r ( ) { e ( ) ; f ( ) ; } void s ( ) { f ( ) ; e ( ) ; } int main ( ) { int i, j, k; a ( ); if ( i == 1) { f ( ); e ( ); c ( ); exit ( ); } else { if ( j == 1 ) p ( ); else q ( ); d ( ) ; if ( k == 1 ) r ( ); else s ( ); } } Frequent SubSeq/Partial Order Apiator [ Acharya et al. FSE 07 ] MAPO [Xie&Pei MSR 05] MAPO Apiator
56. Assieme Assieme [Hoffmann et al. UIST 07] links to pages with snippets group pages with similar snippets links to required libraries
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68. Comparison with Other Tools Percentage of tasks successfully completed by PARSEWeb, Prospector, and XSnippet
69. Significance of Internal Techniques *Legend: Method inline: Method inlining Post Process: Sequence Post Processor Query Split: Query Splitter
70.
71. Mining Partial Orders Consider APIs a, b, c, d, e, and f Partial Order Partial Order with Transitive Reduction The extracted scenarios are fed to a partial order miner The partial order miner mines frequent closed partial order Closed Partial Order Apiator [ Acharya et al. FSE 07 ]
72. XOpenDisplay XCloseDisplay XCreateWindow XGetWindowAttributes XCreateGC XSetForeground XGetBackground XMapWindow XChageWindowAttributes XMapWindow XSelectInput XGetAtomName XFreeGC XNextEvent Example Partial Order A usage scenario around XOpenDisplay API as a partial order. Specifications are shown with dotted lines. Apiator [ Acharya et al. FSE 07 ]
Editor's Notes
The frequency domain equalizer is just a complex division per subchannel Channel shortening equalizer is an 20-30 tap FIR filter My focus is on channel shortening