Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Heuristics for Discovering Architectural Violations (WCRE 2013)

Heuristics for Discovering Architectural Violations (WCRE 2013)

Software architecture conformance is a key software quality control activity that aims to reveal the progressive gap normally observed between concrete and planned software architectures. In this paper, we present ArchLint, a lightweight approach for architecture conformance based on a combination of static and historical source code analysis. For this purpose, ArchLint relies on four heuristics for detecting both absences and divergences in source code based architectures. We applied ArchLint in an industrial-strength system and as a result we detected 119 architectural violations, with an overall precision of 46.7% and a recall of 96.2%, for divergences. We also evaluated ArchLint with four open-source systems, used in an independent study on reflexion models. In this second study, ArchLint achieved precision results ranging from 57.1% to 89.4%.

ASERG, DCC, UFMG

October 14, 2013
Tweet

More Decks by ASERG, DCC, UFMG

Other Decks in Research

Transcript

  1. Heuristics for Discovering
    Architectural Violations
    Cristiano Maffort, Marco Tulio Valente,
    Mariza Bigonha, Nicolas Anquetil, Andre Hora
    1
    WCRE, Koblenz, Germany, October 2013

    View Slide

  2. Software Architectures
    2
    Idealized

    View Slide

  3. Software Architectures
    3
    Idealized Concrete

    View Slide

  4. Architecture Conformance
     Goal: expose architectural violations
     Implementation decisions not following the planned
    architecture
    4

    View Slide

  5. Architecture Conformance
     Goal: expose architectural violations
     Implementation decisions not following the planned
    architecture
     Two techniques:
     Domain-specific languages
     Model-based techniques
    5

    View Slide

  6. Domain-Specific Languages
    6
    .QL DCL

    View Slide

  7. Domain-Specific Languages
    7
    .QL DCL
    Problem: detailed definitions of constraints

    View Slide

  8. Model-based Techniques
    8
    Reflexion Model

    View Slide

  9. Model-based Techniques
    9
    Reflexion Model
    Problem: successive model refinements

    View Slide

  10. Our Goal
    10
     Lightweight approach for conformance:
     Without constraints
     Without model refinements
     Minimal input information:
     Just a high-level component model (HLM)

    View Slide

  11. ArchLint
     Our inspiration:
    11
    Bug Finding Tools
    (Lint, FindBugs, PMD,
    FxCop, etc)
    Warnings

    View Slide

  12. ArchLint
     Our inspiration:
     Our approach:
    12
    Bug Finding Tools
    (Lint, FindBugs, PMD,
    FxCop, etc)
    Warnings

    View Slide

  13. ArchLint
     Heuristics to detect absences and divergences
     Absences: dependencies prescribed by the HLM
     But that are not present in the concrete model
     Divergences: dependencies not prescribed by the HLM
     But that are present in the concrete model
     Heuristics:
     False positives are expected
    13

    View Slide

  14. Heuristics
    14

    View Slide

  15. Heuristics for Detecting Absences
    15
    Evidence #1: 4 classes dependend on TargetClass

    View Slide

  16. Heuristics for Detecting Absences
    16
    Evidence #1: 4 classes dependend on TargetClass
    Evidence #2: 3 classes initially created without this
    dependency, but inserted it later

    View Slide

  17. Heuristics for Detecting Absences
    17
    Evidence #1: 4 classes dependend on TargetClass
    Evidence #2: 3 classes initially created without this
    dependency, but inserted it later
    Evidence #1 && Evidence #2  architectural warning
    C2 missing a dependency with TargetClass

    View Slide

  18. Heuristics #1 for Divergences
    18
    Evidence #1: cp2 is a heavy-user of TargetModule

    View Slide

  19. Heuristics #1 for Divergences
    19
    Evidence #1: cp2 is a heavy-user of TargetModule
    Evidence #2: c2 is the only class in cp1 that depends on TargetModule

    View Slide

  20. Heuristics #1 for Divergences
    20
    Evidence #1: cp2 is a heavy-user of TargetModule
    Evidence #2: c2 is the only class in cp1 that depends on TargetModule
    Evidence #3: dependency to TargetModule were removed from Cp1

    View Slide

  21. Heuristics #1 for Divergences
    21
    Evidence #1: cp2 is a heavy-user of TargetModule
    Evidence #2: c2 is the only class in cp1 that depends on TargetModule
    Evidence #3: dependency to TargetModule were removed from Cp1
    Evidence #1 && Evidence #2 && Evidence #3  architectural warning
    C2 should not depend on TargetModule

    View Slide

  22. Evaluation #1
    22

    View Slide

  23. Evaluation
    23
     SGA System:
     EJB-based information system
     4,923 revisions
     March, 2009 to September, 2011
     1,852 classes and interfaces
     127 KLOC

    View Slide

  24. Thresholds
     Absences:
     Asca
    = 0.9 -- 90% of the classes have dependency
     Ains
    = 0.35 -- 35% inserted the dependency
     Divergences
     Dsca
    = 0.05
     Ddel
    = 0.65
     Ddir
    = 0.05
    24

    View Slide

  25. Precision and Recall
    25
     Classification made by the system’s architect
     For absences, architect classified each warning
     For divergences, architect classified existing
    dependencies

    View Slide

  26. Precision and Recall
    26
     Classification made by the system’s architect
     For absences, architect classified each warning
     For divergences, architect classified existing
    dependencies

    View Slide

  27. Precision and Recall
    27
     Classification made by the system’s architect
     For absences, architect classified each warning
     For divergences, architect classified existing
    dependencies

    View Slide

  28. Evaluation #2
    28

    View Slide

  29. RM Dataset
     RMs independently proposed by Bittencourt et al.
     Ant
     ArgoUML
     Lucene
     SweetHome3D
     False positives/negatives regarding such models
     Same thresholds from the 1st evaluation
    29

    View Slide

  30.  Precision
    Results for Divergences
    30

    View Slide

  31.  Precision
     Recall
    Results for Divergences
    31

    View Slide

  32. Conclusion
     ArchLint:
     Lighweighted approach for architetcure conformance
     Minimal input
     Static and historical analysis
     Architetcural warnings
     Future work: heuristics based on data mining techniques
    (association rules)
    32

    View Slide

  33. Thanks!
    Heuristics for Discovering Architectural Violations
    Cristiano Maffort, Marco Tulio Valente,
    Mariza Bigonha, Nicolas Anquetil, Andre Hora
    33
    WCRE, Koblenz, Germany, October 2013

    View Slide