Re: Refactoring and Dynamic Analysis
swati kumar <[email protected]> Mon, 25 Nov 2013 12:39:41 +0530
| Newsgroups | gmane.comp.programming.refactoring |
|---|---|
| Message-ID | <CA+LZdW1rxaoBQwAmUzJhQgpRnaD=acwi44xw0SQeDHSpNraYnA@mail.gmail.com> |
--047d7b16348d399d4304ebfb0c15 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Thank You Sir...... On Mon, Nov 25, 2013 at 3:00 AM, John Carter <john.ca= [email protected]>wrote: > > > I haven't seen any academic papers on the = subject, but I can related a > couple of examples from industry.... > > * L= eak analysis. In a Domain Specific Language Interpretor I wrote, I had > a = memory leak. Tracing the leak (annotating the malloc and free calls) > resu= lted in me rethinking the ownership policies for the heap allocated > strin= gs created by lexical analysis. > > * Evaluation Order. In the evaluation o= f a very complex recursively > defined formula, it was suggested I used mem= oization to speed it up. This > did indeed work. However, having done the w= ork to add memoization I also > logged the order in which things we evaluat= ed (after memoization). Analysis > of this revealed a simple, direct order = of evaluation that simplified the > code immensely, and gained massive perf= ormance boost _without_ the need for > memoization. > > * JIT compilers. (F= or example java and valgrind) are effectively > refactorings after dynamic = analysis. > > * Profiling - Optimization is often presented as a trade off = between clean > straight forward code and complexity. Yet my experience has= often (but not > always) been the opposite. Often profiling hotspots are t= he consequences of > very bad design decisions. Often the act of profiling = a code base that > hasn't been profiled for a long time reveals code stench= es, which when > removed results in cleaner faster code. The rule "No code = is faster than no > code" is very applicable. > > > > On Sat, Nov 23, 2013 = at 5:33 AM, swati kumar <[email protected]> wrote: > >> >> >> Namaskar, = >> >> I am Swati. A Master of Technology student from India. I am doing my = >> dissertation on Code smells and Refactoring. >> >> I am not able to find= work done in refactoring using dynamic analysis or >> dynamic metrics. >> = >> Please suggest me some work done in this direction. >> >> Thanking You!!= ! >> >> > > > -- > John Carter > Phone : (64)(3) 358 6639 > Tait Electronic= s > PO Box 1645 Christchurch > New Zealand > > > --------------------------= ---- > This email, including any attachments, is only for the intended reci= pient. > It is subject to copyright, is confidential and may be the subject= of legal > or other privilege, none of which is waived or lost by reason o= f this > transmission. > If you are not an intended recipient, you may not = use, disseminate, > distribute or reproduce such email, any attachments, or= any part thereof. > If you have received a message in error, please notify= the sender > immediately and erase all copies of the message and any attac= hments. > Unfortunately, we cannot warrant that the email has not been alte= red or > corrupted during transmission nor can we guarantee that any email = or any > attachments are free from computer viruses or other conditions whi= ch may > damage or interfere with recipient data, hardware or software. The= > recipient relies upon its own procedures and assumes all risk of use and= of > opening any attachments. > ------------------------------ > > > --047d7b16348d399d4304ebfb0c15 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable <head> <style type=3D"text/css"> <!-- /* start of attachment style */ .ygrp-photo-title{ clear: both; font-size: smaller; height: 15px; overflow: hidden; text-align: center; width: 75px; } div.ygrp-photo{ background-position: center; background-repeat: no-repeat; background-color: white; border: 1px solid black; height: 62px; width: 62px; } div.photo-title=20 a, div.photo-title a:active, div.photo-title a:hover, div.photo-title a:visited { text-decoration: none;=20 } div.attach-table div.attach-row { clear: both; } div.attach-table div.attach-row div { float: left; /* margin: 2px;*/ } p { clear: both; padding: 15px 0 3px 0; overflow: hidden; } div.ygrp-file { width: 30px; valign: middle; } div.attach-table div.attach-row div div a { text-decoration: none; } div.attach-table div.attach-row div div span { font-weight: normal; } div.ygrp-file-title { font-weight: bold; } /* end of attachment style */ --> </style> </head> <html> <head> <style type=3D"text/css"> <!-- #ygrp-mkp { border: 1px solid #d8d8d8; font-family: Arial; margin: 10px 0; padding: 0 10px; } #ygrp-mkp hr { border: 1px solid #d8d8d8; } #ygrp-mkp #hd { color: #628c2a; font-size: 85%; font-weight: 700; line-height: 122%; margin: 10px 0; } #ygrp-mkp #ads { margin-bottom: 10px; } #ygrp-mkp .ad { padding: 0 0; } #ygrp-mkp .ad p { margin: 0; } #ygrp-mkp .ad a { color: #0000ff; text-decoration: none; } --> </style> </head> <body> <!-- |**|begin egp html banner|**| --> <br><br> <!-- |**|end egp html banner|**| --> <div dir=3D"ltr">Thank You Sir......</div><div class=3D"gmail_extra"><br><b= r><div class=3D"gmail_quote">On Mon, Nov 25, 2013 at 3:00 AM, John Carter <= span dir=3D"ltr"><<a href=3D"mailto:[email protected]" target=3D= "_blank">[email protected]</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> <u></u> <div style> <span>=A0</span> <div> <div> <div> =20=20=20=20=20=20 =20=20=20=20=20=20 <p></p><div dir=3D"ltr"><div><div><div><div>I haven't seen any ac= ademic papers on the subject, but I can related a couple of examples from i= ndustry....<br><br></div>* Leak analysis. In a Domain Specific Language Int= erpretor I wrote, I had a memory leak. Tracing the leak (annotating the mal= loc and free calls) resulted in me rethinking the ownership policies for th= e heap allocated strings created by lexical analysis.<br> <br></div>* Evaluation Order. In the evaluation of a very complex recursive= ly defined formula, it was suggested I used memoization to speed it up. Thi= s did indeed work. However, having done the work to add memoization I also = logged the order in which things we evaluated (after memoization). Analysis= of this revealed a simple, direct order of evaluation that simplified the = code immensely, and gained massive performance boost _without_ the need for= memoization.<br> <br></div>* JIT compilers. (For example java and valgrind) are effectively = refactorings after dynamic analysis.<br><br></div>* Profiling - Optimizatio= n is often presented as a trade off between clean straight forward code and= complexity. Yet my experience has often (but not always) been the opposite= . Often profiling hotspots are the consequences of very bad design decision= s. Often the act of profiling a code base that hasn't been profiled for= a long time reveals code stenches, which when removed results in cleaner f= aster code. The rule "No code is faster than no code" is very app= licable.<br> <div><div><div><br></div></div></div></div><div class=3D"gmail_extra"><div>= <div class=3D"h5"><br><br><div class=3D"gmail_quote">On Sat, Nov 23, 2013 a= t 5:33 AM, swati kumar <span dir=3D"ltr"><<a href=3D"mailto:swati1222k@g= mail.com" target=3D"_blank">[email protected]</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"border-left:1px #ccc solid"> <u></u> <div> <span>=A0</span> <div> <div> <div> =20=20=20=20=20=20 =20=20=20=20=20=20 <p></p><div dir=3D"ltr">Namaskar,<div><br></div><div>I am Swati. A Ma= ster of Technology student from India. I am doing my dissertation on Code s= mells and Refactoring.</div><div><br></div><div>I am not able to find work = done in refactoring using dynamic analysis or dynamic metrics.</div> <div><br></div><div>Please suggest me some work done in this direction.</di= v><div><br></div><div>Thanking You!!!=A0<br></div></div> <p></p> </div> =20=20=20=20=20 =20=20=20=20 <div style=3D"color:#fff"></div> </div> =20=20 </div></div></blockquote></div><br><br clear=3D"all"><br></div></div>-- <br= ><div dir=3D"ltr">John Carter<br>Phone : (64)(3) 358 6639<br>Tait Electroni= cs=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 =A0 =A0=A0=A0 <br>PO Box 1645 Chri= stchurch<br>New Zealand<br> <br></div> </div> <br> <hr><font color=3D"#808080">This email, including any attachments, is only for the intended recipient. It is subject to copyright, is confidential and may be the subject of legal or other privilege, none of which is=20 waived or lost by reason of this transmission.</font><div><font color=3D"#8= 08080">If you are not an intended recipient, you may not use, disseminate,=20 distribute or reproduce such email, any attachments, or any part=20 thereof. If you have received a message in error, please notify the=20 sender immediately and erase all copies of the message and any=20 attachments.</font></div><div><font color=3D"#808080">Unfortunately, we=20 cannot warrant that the email has not been altered or corrupted during=20 transmission nor can we guarantee that any email or any attachments are=20 free from computer viruses or other conditions which may damage or=20 interfere with recipient data, hardware or software. The recipient=20 relies upon its own procedures and assumes all risk of use and of=20 opening any attachments.</font></div><div><hr></div><p></p> </div> =20=20=20=20=20 =20=20=20=20 <div style=3D"color:#fff;min-height:0"></div> </div> =20=20 </blockquote></div><br></div> <!-- |**|begin egp html banner|**| --> <br> <br> <!-- |**|end egp html banner|**| --> <div width=3D"1" style=3D"color: white; clear: both;"/>__._,_.___</div> =20=20=20=20=20=20 =20=20=20=20=20=20 <!-- Start Recommendations --> <!-- End Recommendations --> <!-- |**|begin egp html banner|**| --> <img src=3D"http://geo.yahoo.com/serv?s=3D97476590/grpId=3D3975602/grpspI= d=3D1707276718/msgId=3D10705/stime=3D1385389086" width=3D"1" height=3D"1"> = <br> <!-- |**|end egp html banner|**| --> =20=20 <!-- |**|begin egp html banner|**| --> <br> <div style=3D"font-family: verdana; font-size: 77%; border-top: 1px s= olid #666; padding: 5px 0;" > Your email settings: Individual Email|Traditional <br> <a href=3D"http://groups.yahoo.com/group/refactoring/join;_ylc=3DX3oD= MTJmYWppbGM2BF9TAzk3NDc2NTkwBGdycElkAzM5NzU2MDIEZ3Jwc3BJZAMxNzA3Mjc2NzE4BHN= lYwNmdHIEc2xrA3N0bmdzBHN0aW1lAzEzODUzODkwODY-">Change settings via the Web<= /a> (Yahoo! ID required) <br> Change settings via email: <a href=3D"mailto:refactoring-digest@yahoo= groups.com?subject=3DEmail Delivery: Digest">Switch delivery to Daily Diges= t</a> | <a href =3D "mailto:[email protected]?subjec= t=3DChange Delivery Format: Fully Featured">Switch to Fully Featured</a> <b= r> <a href=3D"http://groups.yahoo.com/group/refactoring;_ylc=3DX3oD= MTJkZmIwOG1pBF9TAzk3NDc2NTkwBGdycElkAzM5NzU2MDIEZ3Jwc3BJZAMxNzA3Mjc2NzE4BHN= lYwNmdHIEc2xrA2hwZgRzdGltZQMxMzg1Mzg5MDg2"> Visit Your Group=20 </a> | <a href=3D"http://info.yahoo.com/legal/us/yahoo/utos/terms/"> Yahoo! Groups Terms of Use </a> | <a href=3D"mailto:[email protected]?subject=3DU= nsubscribe"> Unsubscribe=20 </a>=20 <br> </div> <br> <!-- |**|end egp html banner|**| --> <div style=3D"color: white; clear: both;"/>__,_._,___</div> </body> </html> --047d7b16348d399d4304ebfb0c15--