refactoring for software architecture smells - international workshop on refactoring - sept 2016
TRANSCRIPT
![Page 1: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/1.jpg)
Refactoring for Software Architecture Smells
International Workshop on Refactoring Singapore, Sept. 4 2016
Ganesh Samarthyam CodeOps [email protected]
www.codeops.tech
Refactoring for Software Architecture Smells
![Page 2: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/2.jpg)
“Functional Chaos!”
![Page 3: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/3.jpg)
City Metaphor for Refactoring
“Cities grow, cities evolve, cities have parts that simply die while other
parts flourish; each city has to be renewed in order to meet the needs of its populace… Software-intensive systems
are like that. They grow, they evolve, sometimes they wither away, and
sometimes they flourish…”
Grady Booch in the foreword for “Refactoring for Software Design Smells: Managing Technical Debt”, Girish Suryanarayana, Ganesh Samarthyam, Tushar Sharma, Morgan Kaufmann/Elsevier, 2014.
![Page 4: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/4.jpg)
Code refactoring
margin = c.getMargin();
if (c instanceof AbstractButton) {
margin = ((AbstractButton)c).getMargin();
} else if (c instanceof JToolBar) {
margin = ((JToolBar)c).getMargin();
} else if (c instanceof JTextComponent) {
margin = ((JTextComponent)c).getMargin();
}
![Page 5: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/5.jpg)
Refactoring design smells
![Page 6: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/6.jpg)
Earlier (relatively) mature work
![Page 7: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/7.jpg)
Tangles in JDK
![Page 8: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/8.jpg)
Refactoring for Architecture Smells
Remove one of the dependencies
Change dependency direction Move one of the dependencies
![Page 9: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/9.jpg)
Architectural refactoring
![Page 10: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/10.jpg)
Architectural refactoring …
![Page 11: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/11.jpg)
Key reasons for architecture refactoring
Business needs
Increase feature velocity
Address architecture
decay
Realizing NFRs
Modernize
Reduce costs
![Page 12: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/12.jpg)
Increase feature velocity
![Page 13: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/13.jpg)
Reduce costs
![Page 14: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/14.jpg)
Address architecture decay
![Page 15: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/15.jpg)
Modernize
![Page 16: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/16.jpg)
Refactoring Windows
![Page 17: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/17.jpg)
Refactoring Windows
![Page 18: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/18.jpg)
Refactoring Windows
“A large number of dependencies at the module level could be reduced and optimized to: * make modular reasoning of the system more efficient* maximize parallel development efficiency* avoid unwanted parallel change interference* selectively rebuild and retest subsystems effectively”
Refactoring performed to reduce and optimize dependencies - by creating and enforcing layering
Source: Kim, Miryung, Thomas Zimmermann, and Nachiappan Nagappan. "An Empirical Study of RefactoringChallenges and Benefits at Microsoft." IEEE Transactions on Software Engineering 7 (2014): 1-1.
![Page 19: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/19.jpg)
Refactoring Windows: Significant Characteristics
Refactoring decisions made after substantial analysis of existing dependency structure
Refactoring effort was centralized and top down with designated team for refactoring
Use of custom refactoring tools (MaX) and processes (quality gate check)
Source: Kim, Miryung, Thomas Zimmermann, and Nachiappan Nagappan. "An Empirical Study of RefactoringChallenges and Benefits at Microsoft." IEEE Transactions on Software Engineering 7 (2014): 1-1.
![Page 20: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/20.jpg)
Refactoring Windows
Source: Kim, Miryung, Thomas Zimmermann, and Nachiappan Nagappan. "An Empirical Study of RefactoringChallenges and Benefits at Microsoft." IEEE Transactions on Software Engineering 7 (2014): 1-1.
![Page 21: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/21.jpg)
Refactoring JDK
![Page 22: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/22.jpg)
Tangles in JDK
![Page 23: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/23.jpg)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
![Page 24: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/24.jpg)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
![Page 25: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/25.jpg)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
![Page 26: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/26.jpg)
Project Jigsaw in Java 9
Modularize JDK & JRE
Hide platform internal details such as sun.misc
Provide a module system for Java developers
![Page 27: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/27.jpg)
Related work
"architectural bad smells" "architecture smells"
"anti-patterns" "architecturally-relevant code smells"
"contra-indicated patterns" "architectural defects"
"[accidental] architectural anti-patterns"
![Page 28: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/28.jpg)
Related work
"high-impact refactorings" "architecture transformation"
"large refactorings" "architecture-oriented refactorings"
![Page 29: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/29.jpg)
Related work
• Catalog architecture smells or refactorings • Architecture smell catalog by Garcia et al. • Catalog of smells and refactoring by M. Stal (2007)
• Specific categories of architecture smells • Ouni et al. “web service antipatterns" in the context of Service Oriented Architectures
• Rama et al. discusses “modularity smells”
![Page 30: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/30.jpg)
Related work
•Architecture refactoring case studies performed on industrial projects
• Exploratory studies on emerging topics in architecture refactoring
• Architecture refactoring in software product lines • Architecture technical debt
• …
![Page 31: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/31.jpg)
Potential Research Directions
Catalog of architecture smells and refactoring
Tool support
Economics of architecture refactoring (quantifying
architecture technical debt)
Refactoring and emerging architecture styles
and patterns
![Page 32: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/32.jpg)
Example: Lack of tool support
Unlike code refactoring, most architectural refactoring is manual
due to lack of tool support!
![Page 33: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/33.jpg)
Automated code smell detection and refactoring
![Page 34: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/34.jpg)
![Page 35: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/35.jpg)
![Page 36: Refactoring for Software Architecture Smells - International Workshop on Refactoring - Sept 2016](https://reader031.vdocuments.mx/reader031/viewer/2022021814/58f29a4c1a28ab490f8b4577/html5/thumbnails/36.jpg)
[email protected] @GSamarthyam
www.codeops.tech slideshare.net/sgganesh
+91 98801 64463 bit.ly/ganeshsg