ebook img

Test-Driven Development: An Empirical Evaluation of Agile Practice PDF

258 Pages·2010·4.89 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Test-Driven Development: An Empirical Evaluation of Agile Practice

Test-Driven Development Lech Madeyski Test-Driven Development An Empirical Evaluation of Agile Practice 123 LechMadeyski WrocławUniversityofTechnology InstituteofInformatics(I-32) SoftwareEngineeringDepartment Wybrzez˙eWyspian´skiego27 50-370Wrocław Poland [email protected] http://madeyski.e-informatyka.pl/ ISBN978-3-642-04287-4 e-ISBN978-3-642-04288-1 DOI10.1007/978-3-642-04288-1 SpringerHeidelbergDordrechtLondonNewYork LibraryofCongressControlNumber:2009939143 ACMComputingClassification(1998):D.2,K.6 (cid:2)c Springer-VerlagBerlinHeidelberg2010 Thisworkissubjecttocopyright.Allrightsarereserved,whetherthewholeorpartofthematerialis concerned,specificallytherightsoftranslation,reprinting,reuseofillustrations,recitation,broadcasting, reproductiononmicrofilmorinanyotherway,andstorageindatabanks.Duplicationofthispublication orpartsthereofispermittedonlyundertheprovisionsoftheGermanCopyrightLawofSeptember9, 1965,initscurrentversion,andpermissionforusemustalwaysbeobtainedfromSpringer.Violations areliabletoprosecutionundertheGermanCopyrightLaw. Theuseofgeneraldescriptivenames,registerednames,trademarks,etc.inthispublicationdoesnot imply,evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfromtherelevantprotective lawsandregulationsandthereforefreeforgeneraluse. Coverdesign:KuenkelLopkaGmbH Printedonacid-freepaper SpringerispartofSpringerScience+BusinessMedia(www.springer.com) ToIwona,Lech,Natalia,JudytaandMałgorzata Foreword Thisbookmakesanimportantandtimelycontribution.Agilemethodsaregaining more and more interest both in industry and research. Many industries transform theirwayofworkingfromtraditionalwaterfallprojectswithlongdurationtomore incremental,iterativeandagilepractices.Furthermore,theneedtoevaluateandto obtainevidencefordifferentprocesses,methodsandtoolshasbeenemphasizedin researchinparticularoverthelastdecade.Themaincontributioncomesprimarily from combining agile methods (or more precisely XP and test-first programming) withempiricalevaluation. The book’s contribution is important since it evaluates empirically a way of working which is more and more embraced by companies developing software or software-intensive systems. Thus, it evaluates new way of working which is a challenge given the pace in which new technologies evolve, and in particular it providesevidenceinrelationtotest-firstprogrammingortest-drivendevelopment. However, this is not the sole contribution. The book presents three experiments in much more depth than normally is possible in a research article. This means that itprovidesreaderswithin-depthinsightsintoexperimentalmethodsinthecontext ofagiledevelopment.Thisincludespresentationofstatisticalmethodshavingcon- creteexamplesofhowtoconductthestatisticalanalysiswithSPSSandathorough discussionaboutthedifferentvaliditythreatsinempiricalstudies.Furthermore,the book presents how meta-analysis can be conducted when having several separate experiments. In summary the book provides many valuable insights both to practitioners in terms of the evidence for test-first programming and to researchers in terms of clear illustrations of how new processes, methods and tools can be evaluated using experimentation in software engineering. It is pleasure to recommend this booktopractitionersandresearchersbeinginterestedinagilemethodsorempirical evaluationorbothofthem. Karlskrona,Sweden ProfessorClaesWohlin BlekingeInstituteofTechnology vii Preface Thereisstrongshadowwherethereismuchlight. –JohannWolfgangvonGoethe Followingtherecentrecommendationsinmedicineandpsychology[21,98],aswell as the guidelines offered by the empirical software engineering community [109, 127, 140, 141, 227], this preface takes the form of a structured abstract.1 For the sakeofclarity,statisticalresultsarenotincludedintheprefaceitselfbuttheymay befoundinAppendix. Background Thequalityofthemethodsusedtoevaluatenewsoftwaredevelopmenttechniques, practices,processes,technologies,tools,etc.,indicatesthematurityofthesoftware engineering research discipline. Consequently, experimentation, as a systematic, disciplined, quantifiable and controlled way of evaluation becomes a fundamen- tal part of both research and practice in software engineering. The importance of properlyconductedandreplicatedexperimentshasbecomewidelyacceptedinthe softwareengineeringcommunity.Owingtotheempiricalstudiesandtheiranalysis or meta-analysis, industry may take advantage of the already accumulated knowl- edge. The roots of that fundamental shift in software engineering research can, to alargeextent,befoundinevidence-basedmedicine.Controlledexperiments,quasi- experiments and case studies become the primary research methods by which the choiceofsoftwaredevelopmenttechniquesshouldbejustified.Systematicreviews andmeta-analysesaregainingincreasingacceptanceasthemethodsofsummarizing 1Structuredabstractsorganizethesummariesofpublicationswiththefollowingcommonhead- ings:backgroundorcontext,objectiveoraim,method,results,limitationsandconclusions[127]. Several researchers who compared structured abstracts with traditional ones support the claim thatstructuredabstractsareanimprovementovertraditionalones.Notonlyismoreinformation presented,whichishelpfulforthereader,butalsotheformatrequiresthattheauthorsorganizeand presenttheirfindingsinasystematicway,easiertoread[109]. ix x Preface theresultsofanumber ofempiricalstudies.Evidence-based softwareengineering (EBSE) undermines anecdotal evidence and unsystematic experience as sufficient grounds for decision making while stressing instead the empirical evidence from softwareengineeringresearch. Another interesting shift in software engineering has been created by the agile movement in general, and eXtreme Programming (XP) in particular. Agile teams shapesoftwaresystemsusingacollaborativeprocess,withexecutablesoftwareand automatedtestsatitsheart,whilstmarginalisingthedocuments.Thatcreatesashift awayfromtoolsformanagingrequirementstotools(originatingfromtheXPval- ues, principles and practices) supporting collaboration and the gradual distillation of requirements into automated test suites [58]. The Test-First Programming (TF) practice,alsocalledTest-DrivenDevelopment,isconsideredtheflagshipandoneof the most influential practices of the XP methodology [15, 23, 144], as well as the oneofthemostcontroversialones[179]. Boththeexperimentationinsoftwareengineeringandtheagilemovementinflu- encedthisbook.Thelatterattractedtheattentionoftheauthortotheagilemethod- ologies,XPandthentheflagshipXPpractice,i.e.TF.Theformerinfluencedtheway theresearchwasconductedandreported(e.g.thestressontheeffectsizeestimates andmeta-analysis). Objective The purpose of this book was to evaluate the effects of the TF agile software developmentpracticewithrespecttothepercentageofacceptancetestspassed(con- sideredanexternalcodequalityindicator[87,88]),designcomplexitymetrics(that have been found significant for assessing fault proneness by several researchers [19, 32, 33, 95, 200, 238]) and the number of acceptance tests passed per devel- opmenthour(whichisanindicatorofdevelopmentspeed).Moreover,theaimisto presentthepreliminaryevaluationoftheimpactoftheTFpracticeonmutationscore indicatorandbranchcoverage,theindicatorsofthefaultdetectioneffectivenessand thethoroughnessofunittests,respectively. Anadditional(butauxiliary)objectiveofthebookwastopresenthowtoperform an analysis of experiments in software engineering using the Statistical Package fortheSocialSciences(SPSS).Conferenceorevenjournalpapersusuallypresent shortandthussuperficialdescriptionsoftheperformedanalyses,whiletheexisting excellent books [131, 227, 259] cover a wide range of topics related to Empirical Software Engineering (ESE) and, therefore, do not focus on the joint analysis of closelyrelatedexperiments. Method The effects of the TF programming practice were evaluated by conducting three experimentsnamedACCOUNTING(experimentonthedevelopmentofanaccounting system), SUBMISSION (experimentonthedevelopmentofapapersubmissionand Preface xi review system), and SMELLS&LIBRARY (experiment on the development of both a tool for identifying bad smells in Java source code through the use of a set of software metrics and a library application). Those experiments, described in Chap.4,werecarriedoutinacademicsettingwithover200graduateMScstudents, usingbothbetween-groups(inExperiments ACCOUNTINGand SUBMISSION)and repeated measures (in Experiment SMELLS&LIBRARY) experimental designs. Furthermore, the Pair Programming (PP) practice was used along with the TF programming practice in the first experiment to check whether there is a synergy betweenbothXPpractices.Thedatawerecollectedwiththehelpofdifferentmea- surementtools.Someofthem(Judy,Aopmetrics,ActivitySensorandSmartSensor Eclipseplugins)havebeendevelopedespeciallyforthesakeoftheexperiments.The statisticalanalysisofexperimentshasbeendescribedinChaps.5,6and7,whilethe meta-analysis has been performed in Chap. 9. A selective analysis and selective meta-analysishavebeencarriedouttominimizethreatstothevalidity(e.g.process conformancethreat).Effectsizeswerereportedandinterpretedwithrespecttotheir practicalimportance. Results The main result observed on the basis of the meta-analysis of Experiments ACCOUNTING, SUBMISSION and SMELLS&LIBRARY is that programmers using Test-FirstSoloProgramming(TFSP)techniqueproduceacodethatissignificantly lesscoupledthanthatproducedbyprogrammersusingTest-LastSoloProgramming (TLSP)technique.Thisfindinghasalsobeenconfirmedbytheselectiveanalysisof Experiments SUBMISSIONand SMELLS&LIBRARY.Furthermore,themeaneffect sizerepresentsamedium(butclosetolarge)effectonthebasisofmeta-analysisof alltheexperiments,aswellasselectivemeta-analysis,whichisasubstantialfinding. It suggests a better modularization (i.e. a more modular design), easier reuse and testingofthedevelopedsoftwareproducts[43]duetotheTFprogrammingpractice. However, the superiority of the TF practice in the investigated context was not confirmedwithrespecttothetworemainingareasofinvestigation.Themeanvalue of weighted methods per class (WMC ) was not significantly affected by the Mean TFprogrammingpracticeaccordingtothemeta-analysis,aswellasselectivemeta- analysis,whilethemeaneffectsizerepresentsasmalleffectaccordingtothemeta- analysis,aswellastheselectivemeta-analysis. Themeanvalueofresponseforaclass(RFC )wasnotsignificantlyaffected Mean by the TF practice based on Fisher’s method of combining p-values. The mean effectsizerepresentsasmalleffectaccordingtometa-analysisaswellasselective meta-analysis. Moreover, the results revealed that the TF practice does not have a statistically significant impact, neither on the percentage of acceptance tests passed (PATP), which is an indicator of external code quality, nor on the number of acceptance testspassedperdevelopmenthour(NATPPH),whichisanindicatorofdevelopment xii Preface speed. The mean effect size of TF on the percentage of acceptance tests passed (PATP) represents a small effect. The mean effect size of TF on the number of acceptancetestspassedperhour(NATPPH)representsasmalleffect,too. Furthermore,theeffectoftheTFpracticeonunittestswasmeasuredbybranch coverage(BC)andmutationscoreindicator(MSI),whichareindicatorsofthethor- oughness and the fault detection effectiveness of unit tests, respectively. Relying onthepreliminaryresults,BCwasnotsignificantlyhigherintheTFSPthaninthe TLSPgroup.However,theeffectsizewasmediuminsizeandthereforetheeffectof TFonbranchcoverageisasubstantiveeffect.TLSPandTFSPdidnotsignificantly differinMSIandtheeffectsizewassmall. Limitations Thethreatstothevalidityoftheconductedexperiments(e.g.relevancetoindustry) arethoroughlydiscussedinSect.10.5.Thegeneralizationofresultsislimited,since theanalysedTFpracticewasappliedtodevelopsystemssmallerthan10,000lines of code. Further experimentation (e.g. in industrial context) is needed to establish evidence. Conclusions The results reinforced the evidence regarding the superiority of the TF practice over the Test-Last Programming (TL) practice, with respect to the lower coupling betweenobjects(CBO ).However,thesuperiorityoftheTFprogrammingprac- Mean ticeintheinvestigatedcontextwasnotsupportedwithrespecttothepercentageof acceptancetestspassed(PATP),thenumberofacceptancetestspassedperdevelop- ment hour (NATPPH), weighted methods per class WMC , and response for a Mean class(RFC ). Mean Wroclaw,Poland LechMadeyski Acknowledgements ThemovementcalledExtremeProgrammingistomymindthe mostencouragingtrendinsoftwaredevelopmenttoday.It focusesusallontherealessentials:talent,disciplinewithout dogma,teamwork,risk-taking,andlightprocess.Itposesa particularchallengetothemanager,sinceitpushescontrol downward(managingpeoplewhoareempoweredtomake decisionsandevenmaketheirownmistakesisalotharder thanmanagingpeoplewhoareobligedtoshutupanddowhat youtellthemto).IthinkXPwillbeanewgeneration’sanswer tothemindlessregimentationembodiedintheC.M.M.and otherfat-bookmethodologies. TomDeMarco First of all, I would like to thank the head of my institute, Prof. Zbigniew Huzar, for a friendly atmosphere, making an excellent environment to work in, and for supportingmeduringmypost-doctoralresearch.In2007Iwasinvitedtotakepart in XP, PROFES, ENASE, EuroSPI and CEE-SET conferences, either to present acceptedpapersorasaninvitedspeaker.Withouthissupportandencouragement,I wouldnothavebeenabletomanagethat.IwouldalsoliketothankmyPh.Dsuper- visor,Prof.ZygmuntMazur,especiallyforintroducingmetothePolishInformation ProcessingSociety,andProf.AdamGrzechforhisencouragementtostartmyPh.D attheWrocławUniversityofTechnology.Also,IwouldliketothankProf.Janusz Go´rski, who confirmed my intuition about the importance of experimentation for softwareengineeringresearchduringourshort,butfruitfuldiscussionin2003.That conversation had serious consequences and this book is one of them. I would also like to thank Prof. Jerzy Nawrocki, who taught me that valuable research results should be presented at major international conferences and published in recog- nized international journals. I hope I followed his advice. Furthermore, I would like to thank Prof. Leszek Maciaszek with whom I had an opportunity to come up with the idea of a new series of ENASE (Evaluation of Novel Approaches to Software Engineering) conferences. He encouraged me to play the role of devil’s advocateatENASEconferencesin2006and2007,alongwithtop-rankedsoftware engineering researchers (e.g. Prof. Mehmet Aksit, Prof. Brian Henderson-Sellers, Prof.UlrichEisenecker,DrGiuseppeBerio,Prof.StefanKirn).Infact,challenging xiii

Description:
Agile methods are gaining more and more interest both in industry and in research. Many industries are transforming their way of working from traditional waterfall projects with long duration to more incremental, iterative and agile practices. At the same time, the need to evaluate and to obtain evi
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.