code smells in open source projects • Confirms and quanIfies what many assume to be true • Corrects some misconcepIons • Adds new details about how designs degrade July 15, 2016 1
nor compiler warnings. • Bad program design or bad coding pracIce. • Duplicate code • High CyclomaIc complexity • Code smells are associated with • Maintainability [Fowler 2002] • Bugs [Oliva et al. 2013] • Design debt [Izurieta & Bieman 2007] October 22,2015
number of code smells Number of core developers Increased number of code smells Frequency of code changes Increased number of code smells Number of files in code base Increased number of code smells October 22,2015 Previous studies have shown relaIonships like:
findings hold over a large sample of projects? Project characteris-cs Code smell Longevity of project Decreased number of code smells Number of core developers Increased number of code smells Frequency of code changes Increased number of code smells Number of files in code base Increased number of code smells October 22,2015 Previous studies have shown relaIonships like:
wrt. code smells? • Who addresses technical debt (code smells)? • Is there a correlaIon between testedness and smellyness? • Are we focusing on the smells coders struggle with? 5 October 22,2015
33,070 commits 3,426 smells Analysis Randomly selected top 500 Java projects using Maven from Github • 10+ weeks of history • 500+ lines of code • 10+ files • Could be successfully built
33,070 commits 3,426 smells Analysis For each commit to each project • Calculate # of code smells at that point in Ime • Calculate test coverage metrics (statement, branch & path) Within project metrics
20 Data Clumps Data Class Cyclic Dependencies Blob OperaIon DuplicaIon Feature Envy SAP Breakers God Class Intensive Coupling Schizophrenic Class Blob Class Unstable Dependencies TradiIon Breaker Refused Parent Bequest Message Chains Shotgun Surgery Distorted Hierarchy UnnecessaryCoupling Rank From Literature From Projects More Important (Practitioner)
all smells created equal? • Is this true for non open source projects as well? • A small set of core contributors responsible for fixing smells, but not keeping up • TesIng and refactoring do not go hand in hand • Though coverage and some smells correlated • Is it done by the same people though? • PotenIal mismatch between interesIng smells and common smells • May hinder interest and adopIon of code smell tools 21 October 22,2015