Does Your Architecture Smell?

Does Your Architecture Smell?

Is the quality of your software architecture good? Does it allow you to introduce changes easily? Is it easy enough to understand and explain? To answer these questions and to know their underlying reasons, one needs to know the issues, or more specifically smells in this context, that may occur in a software at architecture granularity. Architecture smells impair quality of the software and make the software hard to maintain and evolve. In this talk, I present seven architecture smells including Feature concentration, God component, Cyclic dependency, Scattered Functionality, and Dense Structure along with their real-world examples. Further, I discuss their impact on various dimensions of software development and propose some pragmatic strategies to avoid, detect, refactor, and manage them.


Tushar Sharma

August 10, 2018


  1. Does Your Architecture Smell? Tushar Sharma

  2. Architecture smells Why to care? Types and granularities Examples How

    to detect Smells How to avoid

  4. • Continuing Growth • All in-use software systems will grow

    • Increasing Complexity • As a software system evolves, the complexity increases unless efforts are made to contain the complexity • Declining Quality • The quality of the software will decline unless it is rigorously maintained Lehman’s laws of software evolution
  5. Evolution of JUnit 3.7 4.0 4.5 4.11

  6. Which one is easy to work with?

  7. Code Quality: Why to care? Impacted Quality • Changeability •

    Understandability • Extensibility • … Product Quality Code/ Design Quality Quality issues or Smells • Time to market • Reliability: Impacted by poor understandability • … Indicators • Rigidity & Fragility • Immobility & Opacity • Needless complexity • Needless repetition • … Productivity
  8. 8

  9. “Jugaad is a colloquial Hindi word that can mean an

    innovative fix or a simple work-around, used for solutions that bend rules, or a resource that can be used as such, or a person who can solve a complicated issue.” … a work-around or hack जुगाड़ 9 “Jugaad”
  10. 10 “Jugaad”

  11. “Jugaad” 11

  12. “Jugaad” 12

  13. “Jugaad” 13

  14. “Jugaad” 14

  15. Smells are Jugaads in software 15

  16. None
  17. What is a smell? …certain structures in the code that

    suggest (sometimes they scream for) the possibility of refactoring. - Kent Beck 20 Definitions of smells:
  18. Types of smells • Code smells • Implementation smells •

    Architecture smells • Design smells • Test smells • Performance smells • Configuration smells • Database smells • Models smells • Usability smells • Web smells • …
  19. Smells: Types

  20. Granularity of code smells - Implementation - Design - Architecture

  21. Implementation smells

  22. Design Smells

  23. Architecture Smells

  24. Architecture smells: examples

  25. Demo

  26. Designite is a software design quality assessment tool for C#.

    Key features • Detects 7 architecture smells • Detects 19 design smells • Detects 11 implementation smells • Computes various object-oriented code metrics • Provides smell trend analysis of Git repositories • Many visualization aids including smell treemap, and smell sunburst • Detects code duplication • Allows customization of analysis • Smart tracking of detected smells Academic license is free!
  27. God Component when a component is excessively large either in

    the terms of LOC or number of classes.
  28. Cyclic Dependency When two or more architecture components depend on

    each other directly or indirectly
  29. Stable Dependencies Principle (SDP) dependencies between packages should be in

    the direction of the stability of the packages. = ( + ) Ca - afferent coupling (or incoming dependencies) Ce - efferent coupling (or outgoing dependencies)
  30. Unstable Dependencies when a component depends on other components that

    are less stable than itself. IA < IB A B
  31. Feature Concentration A1, A2 D1 C1, C2, C3, C4 when

    a component is realizing more than one architectural concern/feature. In other words, the component is not cohesive. B1
  32. Ambiguous interface when a component offers only a single, general

    entry-point into the component.
  33. Scattered functionality when multiple components are responsible for realizing the

    same high-level concern
  34. Dense Structure Average degree = 2 ∗|| || when components

    have excessive and dense dependencies without any particular structure.
  35. Architecture smells in open-source projects Arch smells #Instances Smell density

    Cyclic dependency 34,556 0.415 Feature concentration 17,420 0.209 Scattered functionality 11,623 0.139 Unstable dependency 10,195 0.122 God component 4,774 0.057 Ambiguous interface 852 0.010 Dense structure 302 0.003 Repositories: 3,209 containing > 83 MLOC (C#)
  36. Managing smells in practice

  37. Managing smells Prevent Detect and remove Awareness Processes Strategies

  38. Awareness Does the development team well aware about: • Smells

    and resultant technical debt • Their impact on their project • Code quality, clean code practices Train • Training • Books • Workshops/conferences • …
  39. Processes Employ pragmatic processes to bring discipline Review process •

    Code reviews Architecture governance • Adherence to collection of guidelines and controls People care about things that you measure and reward!
  40. Detecting and refactoring smells: Key strategies

  41. Detecting and refactoring smells: strategies 1. Identify and track 2.

    Prioritize 3. Refactoring installments 4. Follow the ‘Boy’s scout rule’ 5. Motivate 6. Periodically, aim for large-scale refactoring 7. Refactor, except
  42. Let us conclude

  43. A Hack

  44. J U G A A D Quality issues at architecture

  45. An architecture smell A R C H I T E

    C T U R E S M E L L S J U G A A D
  46. Tool to detect smells A R C H I T

    E C T U R E S M E L L S O D C O M P O N E N T J U G A A D
  47. A way to improve A R C H I T

    E C T U R E S M E L L S O D C O M P O N E N T J U G A A D D E S I G N I T E
  48. A W A R E E S S G O

    D C O M P O N E N T D S I G N I T E J U G A A D A R C H I T E C T U R E S M E L L S
  49. Tushar Sharma Thank you!! Courtesy: