2015-FSE-Suggesting accurate method and class names(8)

2020-12-24 16:46

Figureofgetter/settingsetters4:Aand2Dlinearprojection,usingPCA,oftheembeddings

beddingsseempairsgetterstoseparateareforconnectednettymethodsettersfromwithdeclarations.theadottedgetters.

line.MatchedTheem-Tableforvariable2:Examplesnamesofinnearestclojure.neighborsOrderedbyinhigherthecontinuousinnerproductspaceqt 1qt2

wheret1isinthe rstcolumnandt2inthesecond.Identi er

NearestNeighbors(orderedbydistance)

methods

,,,,returnTypekeyvalssbparamsitems,typ,type,methodName,t

paramType,seq,form,rest,valOrNode

,ctor,methodName,args,arg

however,thisanalysisprovidesvisualinsight,gainedfromlookingattheembeddingvectors.Thus,wecomplementthisqualitativeanalysiswithamorequantitativeone,inthenextsection.

5.EVALUATION

Inthissection,wequantitativelyevaluatetheperformanceoftheneuralmodelonthedataset(Table1)answeringalltheRQs.VariableNamingRenamingvariablesandmethodinvocationshasbeenpreviouslyshown[2]toachievegoodperformanceusingn-gramLMs.Figure6showstheperformanceofthebaselinen-grammodelalongwiththeperformanceoftheotherneuralmodelsforvariablenames.Forlowfrequencyofsuggestions(highcon dencedecisions),theneuralmodelsoverperformthen-gram-basedsug-gestions.Thisisexpectedsincesuchmodelsperformbetterthanplainn-grammodelsinNLP[39].Additionally,thefeaturesgiveasubstantialperformanceincreaseoverthemodelsthatlackfeatures.Thesubtokenmodelperformsworsecomparedtothetoken-levelmodelforsuggestionfrequencieshigherthan6%.Thisistobeexpected,sincethesubtokenmodelhastomakeasequenceofincreasinglyuncertaindecisions,predictingeachsubtokensequen-tially,increasingthepossibilityofmakingamistakeatsomepoint.Forsuggestionfrequencieslowerthan6%theperformanceofthesubtokenmodelisslightlybettercomparedtothetoken-levelmodel,thankstoitsabilitytogeneratenovelidenti ers.Thus,wepositivelyanswerRQ1andRQ2.

WecomputedTable4overonlythreeclassesbecauseofthecostofretrainingthemodelonefeatureatatime.LookingatTable4forvariablenamesonemayseehoweachfeatureaffectstheperformanceofthemodelsoverthebaselineneuralmodelwithnofeaturesatrankk=52.First,weobservethatthefeatures

2We

chose vebecausesubitizing,theabilitytocountataglance,

Figureof5:A2Dlinearprojection,usingPCA,oftheembeddings

withsingularandaandpluralnamesinlibgdx.PairsareconnectedfertopluraldottedCollectionsnames.line.WeTheofexpectembeddingsmostlyseparatesingularobjectsmostwhoseofnamesthepluralappearvariablesinsingular.tore-Table3:Closelyrelated(sub-)tokensforlibgdxvariables.Thetop10pairsthathavethehighestqpairs(t 1qtareshown.Forthesubtokenmodelsomenumerale.g.2

9–8)areomitted.

FeatureModel

Subtoken

padBottom–dataOut–padLeftHeight–localAnchorA–dataIn

swig–WidthbodyA–localAnchorBMin–classframebuffers–bodyB

shape–Max

worldWidth–buffersLeft–collisionpadRight–worldHeightcamera–Rightjarg7–padLeftTOUCH–camend–KEYspriteBatch–jarg6_

–batchloc–start–location

helpmostlyathighsuggestionfrequencies.Thisisduetothefactthatforhigh-con dence(lowsuggestionfrequency)decisionthemodelsarealreadygoodatpredictingthosenames.Additionally,combiningallthefeaturesyieldsaperformanceincrease,suggestingthatforvariablenames,onlythecombinationofthefeaturesgivessuf cientlybetterinformationaboutvariablenaming.

MethodDeclarationNamingAccuracyWenowattempttousetheneuralmodelforsuggestingmethodnames,usingonlyfeaturesavailableduringthedeclarationofamethod.Surprisingly,theneuralmodelisexceptionallygoodatpredictingmethoddeclarationnames.Figure7ashowstheperformanceofthemodelsonallmethoddeclarationsexcludinganymethoddeclarationsthataremethodoverrides.WeexcludeoverridessoastoavoidgivingthemodelscreditforpredictingeasynamesliketoString.Whenweincludeoverrides,theperformanceofallmodelsimproves.Toexcludemethodoverrides,weremovemethodsthatcontainthe@Overrideannotationaswellasthosemethodsthatwecanstaticallydetermineasmethodoverrides.

ThegraphsinFigures7ashowthattheneuralmodelsaresubstan-tiallybetteratsuggestingmethodnames,comparedtothen-gramlanguagemodel.Addingfeaturesincreasestheperformanceofthemodels,indicatingthatthemodelisabletousenon-localcontexttomakebetterpredictions.Naturally,theperformancedegradeshandlesthesize5ofobjectshumanandshortbecausetermmemory.

shorttermmemoryisusually7±2is


2015-FSE-Suggesting accurate method and class names(8).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:我国四大商业银行企业文化建设的问题及对策分析

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: