using dna fingerprin ng techniques for the discovery of
play

Using DNA fingerprin.ng techniques for the discovery of - PowerPoint PPT Presentation

Using DNA fingerprin.ng techniques for the discovery of so9ware code clones/siblings Thomas Shippey, David Bowes and Bruce Chris2anson Science and Technology


  1. Using ¡DNA ¡fingerprin.ng ¡ techniques ¡for ¡the ¡discovery ¡of ¡ so9ware ¡code ¡clones/siblings ¡ Thomas ¡Shippey, ¡David ¡Bowes ¡and ¡ Bruce ¡Chris2anson ¡ Science ¡and ¡Technology ¡Research ¡Ins2tute ¡ University ¡of ¡Her>ordshire ¡ ¡

  2. Mo2va2on ¡ ① Hall ¡et ¡al ¡2011: ¡TSE ¡Systema2c ¡Literature ¡Review ¡of ¡defect ¡predic2on ¡studies ¡ ¡ ② Gray ¡et ¡al ¡2009,2011 ¡: ¡“There ¡are ¡not ¡enough ¡descrip2ve ¡SoNware ¡Code ¡Metrics ¡ (SCM) ¡for ¡defect ¡predic2on” ¡”Why ¡are ¡there ¡so ¡many ¡duplicate ¡instances?” ¡ ¡ ③ Shepperd ¡et ¡al ¡2011 ¡(in ¡review) ¡: ¡“Who ¡does ¡the ¡study ¡and ¡the ¡independent ¡variables ¡ are ¡the ¡key ¡to ¡the ¡variability ¡in ¡defect ¡predic2on ¡studies” ¡(~80% ¡of ¡variance) ¡ ¡ ④ Zhang ¡et ¡al ¡2008 ¡“Do ¡Bad ¡Smells ¡Indicate ¡‘Trouble’ ¡in ¡Code?” ¡ ¡ ⑤ Krinke ¡IWSC ¡2011:”Was ¡Fowler ¡right ¡in ¡saying ¡duplicate ¡code ¡is ¡the ¡number ¡one ¡bad ¡ thing ¡in ¡code?” ¡ ¡ ⑥ Zhang ¡et ¡al ¡2011 ¡(in ¡review) ¡“Bad ¡smells ¡are ¡not ¡always ¡bad!” ¡ ⑦ Weimer ¡et ¡al ¡2009: ¡ICSE ¡“Automa2cally ¡finding ¡patches ¡using ¡gene2c ¡programming” ¡

  3. DNA ¡Fingerprin2ng ¡ Jeffreys ¡A.J., ¡Wilson ¡V., ¡Thein ¡S.W. ¡(1984). ¡ ¡ "Hypervariable ¡'minisatellite' ¡regions ¡in ¡human ¡DNA". ¡ ¡ Nature ¡314: ¡67–73. ¡doi:10.1038/314067a0. ¡ Image ¡from ¡: ¡Nature ¡Protocols ¡ 1, ¡518 ¡-­‑ ¡525 ¡(2006) ¡ ¡ doi:10.1038/nprot.2006.73 ¡

  4. Proposi2on ¡ • The ¡long ¡term ¡aim ¡of ¡Thomas’s ¡thesis ¡is ¡to: ¡ – generate ¡another ¡Sta2c ¡Code ¡Metric ¡ ¡based ¡on ¡ code ¡clones ¡ ¡ • DNA ¡fingerprin2ng: ¡ ¡ – Understand ¡what ¡happens ¡to ¡code ¡when ¡it ¡is ¡ cloned ¡ • Answer ¡a ¡ques2on: ¡ ¡ ¡Are ¡code ¡clones ¡bad ¡(number ¡of ¡faults) ¡? ¡

  5. What ¡I ¡did ¡ • AST ¡Based ¡ • Method ¡Level ¡(restric2on ¡points) ¡ • Transformed ¡methods ¡in ¡to ¡‘KindSequences’ ¡ • Sequence ¡Alignment ¡used ¡to ¡compare ¡(Similar ¡ to ¡Greenan, ¡2005) ¡ • Compared ¡possible ¡clones ¡found ¡with ¡those ¡ found ¡by ¡CCFinder ¡(Kamiya ¡et ¡al. ¡2002) ¡ Datasets ¡: ¡BlueJ ¡3.0.4 ¡and ¡Eclipse ¡3.2 ¡and ¡Apache ¡Commons ¡ ¡

  6. What ¡I ¡did ¡ Method: ¡ • ¡ ¡ ¡ ¡ Becomes: ¡ ¡ • METHOD;MODIFIERS;PRIMITIVE ¡TYPE;BLOCK;VARIABLE; ¡ MODIFIERS;PRIMITIVE ¡TYPE; ¡INT ¡LITERAL;FOR ¡LOOP; ¡ VARIABLE;MODIFIERS;PRIMITIVE ¡TYPE; ¡INT ¡LITERAL; ¡ LESS ¡THAN; ¡IDENTIFIER; ¡IDENTIFIER;EXPRESSION ¡STATEMENT; ¡ POSTFIX ¡INCREMENT; ¡IDENTIFIER;BLOCK;EXPRESSION ¡STATEMENT; ¡ METHOD ¡INVOCATION;MEMBER ¡SELECT;MEMBER ¡ SELECT;IDENTIFIER;MULTIPLY; ¡IDENTIFIER; ¡IDENTIFIER; ¡ ¡

  7. What ¡I ¡did ¡ • AST ¡Based ¡ • Method ¡Level ¡(restric2on ¡points) ¡ • Transformed ¡methods ¡in ¡to ¡‘KindSequences’ ¡ • Sequence ¡Alignment ¡used ¡to ¡compare ¡(Similar ¡ to ¡Greenan, ¡2005) ¡ • Compared ¡possible ¡clones ¡found ¡with ¡those ¡ found ¡by ¡CCFinder ¡(Kamiya ¡et ¡al. ¡2002) ¡ Datasets ¡: ¡BlueJ ¡3.0.4 ¡and ¡Eclipse ¡3.2 ¡and ¡Apache ¡Commons ¡ ¡

  8. Sequence ¡Alignment ¡ Needleman-­‑Wunsch ¡algorithm ¡ ¡ (Needleman ¡and ¡Wunsch ¡1970) ¡ • Two ¡sequences ¡to ¡compare ¡– ¡ o AAGTC ¡ o AGTC ¡ ¡ • Similarity ¡Matrix: ¡ A ¡ G ¡ C ¡ T ¡ A ¡ 10 ¡ -­‑1 ¡ -­‑3 ¡ -­‑4 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ G ¡ -­‑1 ¡ 7 ¡ -­‑5 ¡ -­‑3 ¡ ¡ C ¡ -­‑3 ¡ -­‑5 ¡ 9 ¡ 0 ¡ T ¡ -­‑4 ¡ -­‑3 ¡ 0 ¡ 8 ¡ ¡

  9. Sequence ¡Alignment ¡ = ¡0 ¡+ ¡10 ¡= ¡10 ¡ The ¡completed ¡sequence ¡alignment ¡-­‑ ¡ ¡ = ¡-­‑10 ¡-­‑10 ¡= ¡-­‑20 ¡ = ¡-­‑10 ¡-­‑10 ¡= ¡-­‑20 ¡ A ¡ A ¡ G ¡ T ¡ C ¡ A ¡ -­‑ ¡ G ¡ T ¡ C ¡ A ¡ A ¡ A ¡ A ¡ A ¡ A ¡ G ¡ G ¡ G ¡ T ¡ T ¡ T ¡ C ¡ C ¡ C ¡ 0 ¡ 0 ¡ 0 ¡ -­‑10 ¡ -­‑10 ¡ -­‑10 ¡ -­‑20 ¡ -­‑20 ¡ -­‑20 ¡ -­‑30 ¡ -­‑30 ¡ -­‑30 ¡ -­‑40 ¡ -­‑40 ¡ -­‑40 ¡ -­‑50 ¡ -­‑50 ¡ -­‑50 ¡ A ¡ A ¡ A ¡ -­‑10 ¡ -­‑10 ¡ -­‑10 ¡ ? ¡ 10 ¡ 10 ¡ 0 ¡ 0 ¡ -­‑10 ¡ -­‑10 ¡ -­‑20 ¡ -­‑20 ¡ -­‑30 ¡ -­‑30 ¡ G ¡ G ¡ G ¡ -­‑20 ¡ -­‑20 ¡ -­‑20 ¡ 0 ¡ 0 ¡ 9 ¡ 9 ¡ 7 ¡ 7 ¡ -­‑3 ¡ -­‑3 ¡ -­‑13 ¡ -­‑13 ¡ T ¡ T ¡ T ¡ -­‑30 ¡ -­‑30 ¡ -­‑30 ¡ -­‑10 ¡ -­‑10 ¡ -­‑1 ¡ -­‑1 ¡ 6 ¡ 6 ¡ 15 ¡ 15 ¡ 5 ¡ 5 ¡ N.B. ¡Java ¡code ¡has ¡94 ¡Kinds ¡using ¡Javac.Tree. ¡ ¡ C ¡ C ¡ C ¡ -­‑40 ¡ -­‑40 ¡ -­‑40 ¡ -­‑20 ¡ -­‑20 ¡ -­‑11 ¡ -­‑11 ¡ -­‑4 ¡ -­‑4 ¡ 6 ¡ 6 ¡ 12 ¡ 12 ¡ Currently ¡the ¡Java ¡simularity ¡matrix ¡is ¡a ¡94x94 ¡iden2ty ¡matrix ¡

  10. Descrip2ve ¡Sta2s2cs ¡ Sta2s2c ¡ BlueJ ¡3.0.4 ¡ Eclipse ¡3.2 ¡ Apache ¡Commons ¡ Total ¡Source ¡Files ¡ 596 ¡ 660 ¡ 277 ¡ Total ¡Possible ¡CC ¡ 6,183 ¡ 7,861 ¡ 4,801 ¡ Max ¡KindSequence ¡length ¡ 437 ¡ 481 ¡ 416 ¡ Min ¡KindSequence ¡Length ¡ 3 ¡ 3 ¡ 3 ¡ No. ¡of ¡KindSequence ¡over ¡ 56 ¡ 93 ¡ 8* ¡ 100 ¡ Table ¡1 : ¡Descrip5ve ¡Sta5s5cs ¡for ¡the ¡possible ¡cloned ¡methods ¡in ¡the ¡selected ¡source ¡codes. ¡ ¡ ¡ ¡ ¡90% ¡match ¡and ¡above ¡only. ¡ ¡

  11. Checking ¡for ¡False ¡Posi2ves ¡ 100 ¡ 90 ¡ 80 ¡ 70 ¡ 60 ¡ 50 ¡ 40 ¡ 30 ¡ 20 ¡ 10 ¡ 0 ¡ <100 ¡ 100 ¡> ¡x ¡> ¡200 ¡ 200 ¡> ¡x ¡> ¡300 ¡ 300 ¡> ¡x ¡> ¡400 ¡ 400+ ¡ KindSequence ¡Length ¡(BlueJ ¡3.0.4 ¡results) ¡ % ¡Match ¡ N ¡-­‑ ¡Number ¡of ¡unique ¡matches ¡ Fig ¡1: ¡KindLists ¡over ¡300 ¡in ¡BlueJ ¡have ¡100% ¡match ¡rate ¡ ¡ (inter ¡rater ¡reliability ¡-­‑ ¡Kappa ¡sta2s2c ¡-­‑ ¡0.726 ¡ ¡Good ¡(86% ¡agreement)) ¡

  12. Results ¡ Source ¡Code ¡ Our ¡Method ¡ ¡ CCFinder ¡ (Over ¡100 ¡kind ¡lengths) ¡ Eclipse ¡3.2 ¡ 93 ¡ 417 ¡ BlueJ ¡3.0.4 ¡ 56 ¡ 370 ¡ Apache ¡Commons ¡ 8 ¡ 334 ¡ Table ¡2 : ¡Clones ¡found ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡CCFinder ¡finds ¡more ¡clones ¡ Code ¡Clone ¡ Our ¡method ¡ CCFinder ¡ % ¡ Type ¡ 1 ¡ 3 ¡ 3 ¡ 100 ¡ 2 ¡ 6 ¡ 6 ¡ 100 ¡ 3 ¡ 24 ¡ 14 ¡ 58 ¡ Table ¡3 : ¡Clones ¡found ¡by ¡type ¡on ¡the ¡BlueJ ¡source ¡code ¡ ¡CCFinder ¡does ¡not ¡find ¡all ¡the ¡type ¡3 ¡clones. ¡ ¡ ¡(UnitTest ¡files ¡removed ¡from ¡BlueJ ¡source ¡) ¡

  13. Conclusions ¡+ ¡Future ¡Work ¡ • Sequence ¡alignment ¡finds ¡code ¡clones ¡ • High ¡volume ¡of ¡small ¡sequences ¡ • Good ¡at ¡finding ¡type ¡3? ¡ ¡ ¡ • Open ¡out ¡restric2on ¡point ¡and ¡ profile ¡‘methods’ ¡ • Test ¡further ¡ • Improving ¡similarity ¡matrix ¡– ¡possible ¡use ¡to ¡find ¡ seman2c ¡clones ¡ • The ¡need ¡for ¡a ¡baseline ¡code ¡clone ¡dataset ¡for ¡ comparisons ¡

  14. Thank ¡you ¡for ¡listening ¡ Any ¡Ques2ons? ¡ ¡

  15. Points ¡to ¡Ponder ¡ • Manual ¡inspec2on: ¡ – Short ¡methods: ¡cloned ¡or ¡re-­‑typed? ¡ – Tests ¡files ¡follow ¡a ¡pa‚ern? ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend