Code Smells Funded by SENECA project under Marie-Skłodowska Curie Actions Innovative Training Networks ITN-EID. Grant agreement number 642954. May 2, 2019
- Hosted by SIG and TU Delft - 3 PhD students Process quality - Hosted by URJC and Bitergia - 3 PhD students Operation quality - Hosted by AUEB and Singular Logic - 3 PhD students including me 38 publications and counting…
method to propose a catalog of configuration smells, detect them, and investigate intra- and inter-category relationships. 2. Maintainability analysis for database schema smells • A mechanism to collate, evaluate, and detect database smells • A method to investigate code quality of embedded SQL statements and understand their impact on database and production code properties. 3. Maintainability analysis for production code • Smells at different granularities • Honoring scale and breadth 4. Smell detection using deep learning • Feasibility to detect smells without extensive feature engineering • Explore transfer-learning applicability 11
Puppet repositories Detected configuration smells Analyze smells to provide answers to the research questions Tools (Puppeteer and PuppetLint) Taxonomy of configuration smells
distribution of maintainability smells in configuration code? 2. What is the relationship between the occurrence of design configuration smells and implementation configuration smells? 3. Is the principle of coexistence applicable to smells in configuration projects? 4. Does smell density depend on the size of the configuration project? Research questions
design and implementation configuration smells (⍴ = 0.66) Intra-category correlation analysis – whenever a duplicate entity smell is found, it is likely to find other smells from the same category
Detected database schema smells Analyze smells to provide answers to the research questions DbDeo – SQL statement extractor and database smell detector Catalog of database schema smells 2568 open-source and 357 industrial repositories Developers’ survey
45 50 CA AL SK MC MD PA MA CT VA IA GT MN OA Respondents Don’t know Recommended practice Neither a smell nor a recommended practice Database schema smell Both a smell and a recommended practice depending on the context Clearly marked smells More context- sensitive
2. Does the size of the project or the database play a role in smell density? 3. Does the nature of code (type of the application, or usage of ORM frameworks) affect the smell density? 4. What is the degree of co-occurrence among database smells? Research questions Maintainability analysis on database code
• 19 well-known frameworks identified 0 0.5 1 1.5 2 2.5 3 Projects using ORM (681, 238) Rest of the projects (1887, 199) Average smell density Open-source Industrial The difference is not statistically significant! Thus, ORM frameworks do not bring immunity from database smells.
distribution of implementation, design, and architecture smells in C# code? 2. Do the detected smell instances belonging to different granularities correlate? 3. Is the principle of coexistence applicable to smells in C# projects? 4. Does smell density depend on the size of the C# repository? 5. Are architecture smells collocated with design smells? 6. Can the refactoring of design smells lead to fewer architecture smells? Research questions
design smell instance D and architecture smell instance A are considered to be “collocated” if a class reported by the instance D participates in the A instance. • Proposed a mechanism to infer participating classes for an architecture smell • Compute contingency matrix and phi-coefficient Very selective collocation
design smell refactoring on architecture smells • Refactored state of the project required after the design smells are refactored • A mapping of potential influence of design smells refactoring on architecture smells • Simulated the refactored state Some architecture smells disappear but a large number of architecture smells remained after design smell refactoring. Therefore, refactoring smells is important at all granularities.
methods to detect code smells? RQ2: Is transfer-learning feasible in the context of detecting smells? Transfer-learning refers to the technique where a learning algorithm exploits the commonalities between different learning tasks to enable knowledge transfer across the tasks Research questions Detecting smells using deep learning
0.29 0.35 0.68 0.09 0.06 0.02 0 0.2 0.4 0.6 0.8 CNN-1D CNN-2D RNN CNN-1D CNN-2D RNN CNN-1D CNN-2D RNN CNN-1D CNN-2D RNN CM ECB MN MA F1 Deep learning models can detect smells without extensive feature engineering, though their performance is smell-specific. Detecting smells using deep learning
Apart from production code, subdomains of software systems such as configuration code may also suffer from code quality issues and hence must be treated similar to as production code • IDEs, configuration language, and external tools may help avoid many of the configuration smells • Database smells – its not black and white • Developers perceive smells with context and hence not all smells are equally quality problems • ORM and database schema quality • Though Object-Relational Mapping framework make programming easier with database, they do not bring immunity from database smells 36
granularities and they are correlated • Development teams must identify and refactor smells for all granularities • Even if all design smells are refactored, a significant number of architecture smells remain • Attention on code quality when size increases • Higher attention required on code quality (specifically, at architecture granularity) as the size of a software grows 37
demonstrate the feasibility of applying deep learning to detect smells without extensive feature engineering • It may motivate researchers and developers to explore this direction and build over it. • Make once, use repeatedly • The shown feasibility of transfer-learning leads to reusing existing smell detection tools for other programming languages. • No silver-bullet • We observed there is no optimal universal model; performance of the models depends highly on the smell at hand 38
http://www.designite-tools.com • DesigniteJava – https://github.com/tushartushar/DesigniteJava • Puppeteer – https://github.com/tushartushar/Puppeteer • DbDeo – https://github.com/tushartushar/dbdeo • Smell catalog • Documented smells: 263 • Leading a way for a new category of tools based on transfer-learning 41
• Exploiting the power of deep learning • Automated refactoring support for architecture smells • Scaling refactoring to large-scale potentially by using/developing bottom- up refactoring support • Software data analytics • Software development generates data representing different aspects that can be combined for better analysis and actionable insights 42
and Diomidis Spinellis. 2016. Does your configuration code smell?. In Proceedings of the 13th International Conference on Mining Software Repositories (MSR '16). 189-200. 2. Tushar Sharma, Diomidis Spinellis. “A survey on software smells”, Journal of Systems and Software, Volume 138, 2018, Pages 158-173, ISSN 0164-1212. 3. Tushar Sharma, Marios Fragkoulis and Diomidis Spinellis, "House of Cards: Code Smells in Open-Source C# Repositories," 2017 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM), Toronto, ON, 2017, pp. 424-429. 4. Tushar Sharma, Marios Fragkoulis, Stamatia Rizou, Magiel Bruntink, and Diomidis Spinellis. ``Smelly relations: measuring and understanding database schema quality'', In Proceedings of the 40th International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP '18). pp 55-64. 5. Tushar Sharma. 2018. Detecting and managing code smells: research and practice. In Proceedings of the 40th International Conference on Software Engineering: Companion Proceeedings (ICSE '18). ACM, New York, NY, USA, 546-547. 43
Is the Mud: Fathoming Architecture Technical Debt Using Designite. To appear in International Conference of Technical Debt (TechDebt'19), Tools track. Submitted 7. Tushar Sharma, Paramvir Singh, Diomidis Spinellis, "An Empirical Investigation on the Relationship between Design and Architecture Smells” under review in Journal of Software and Systems (JSS). Apr 2018. 8. Tushar Sharma, Vasiliki Efstathiou, Panos Louridas, and Diomidis Spinellis. On the Feasibility of Transfer-learning Code Smells using Deep Learning. April 2019. Eprint available at: https://arxiv.org/abs/1904.03031 (To be submitted at TOSEM) 44