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

When QualityAssistant Meets Pharo [Enforced Cod...

When QualityAssistant Meets Pharo [Enforced Code Critiques Motivate More Valuable Rules] (iwst2016)

Static analysis tools can aid in software quality assessment, but are rarely used by software developers. Poor usage of quality analysis tools not only means missed opportunities for the quality of software systems, but also results in little feedback, which in turn slows the improvements of the quality rules themselves.

We introduced a set of intrusive quality plugins and integrated them into the Pharo IDE. This not only triggered a feedback loop that led to improvements of the existing rules, but also encouraged removal of some rules and integration of new ones. Our analysis of changes to the rules suggests that precise rules capturing a domain-specific logic are more valuable than general ones.

Yuriy Tymchuk

August 23, 2016
Tweet

More Decks by Yuriy Tymchuk

Other Decks in Programming

Transcript

  1. @yuriy_tymchuk When QualityAssistant Meets Pharo Enforced Code Critiques Motivate More

    Valuable Rules , Mohammad Ghafari, Oscar Nierstrasz Software Composition Group @ University of Bern
  2. SmallLint Issues per Milestone 0 10 20 30 40 50

    Pharo 3 Pharo 4 Pharo 5 Pharo 6*
  3. Removed Probably missing ‘; yourself’ Non-blocks in special messages References

    an abstract class size = 1 ifTrue: ’:’ ifFalse: ’s:’
  4. Removed Probably missing ‘; yourself’ Non-blocks in special messages References

    an abstract class String new size = 1 ifTrue: ’:’ ifFalse: ’s:’
  5. Removed Probably missing ‘; yourself’ Non-blocks in special messages References

    an abstract class String new size = 1 ifTrue: ’:’ ifFalse: ’s:’ Educational
  6. Added assert: a = b ifNotNilDo: ifNotNil: Smalltalk at: Smalltalk

    globals at: assert: a equals: b Migration
  7. Added assert: a = b ifNotNilDo: ifNotNil: Smalltalk at: Smalltalk

    globals at: assert: a equals: b Migration Recipe: use rewrite rules
  8. Added b := RTMondrian new. b edges connectFrom: #superclass. b

    nodes: RTShape withAllSubclasses. b := RTMondrian new. b edges connectFrom: #superclass. b nodes: RTShape withAllSubclasses.
  9. Added b := RTMondrian new. b edges connectFrom: #superclass. b

    nodes: RTShape withAllSubclasses. Invocation order b := RTMondrian new. b edges connectFrom: #superclass. b nodes: RTShape withAllSubclasses.
  10. Added b := RTMondrian new. b edges connectFrom: #superclass. b

    nodes: RTShape withAllSubclasses. Recipe: initialize super initialize. self add: #edges requiresPreSend: #nodes:. Invocation Order b := RTMondrian new. b edges connectFrom: #superclass. b nodes: RTShape withAllSubclasses.
  11. Added ReAbstractRule class >> #checksPackage; >> #checksClass; >> #checksMethod; >>

    #checksNode true? Recipe: (aClass inheritsFrom: ReAbstractRule) and: [ selectors anySatisfy: [ :s | aClass perform: s ] ] Class Structure
  12. Added gtInspectorMethodsIn: composite <gtInspectorPresentationOrder: 20> | methods | methods :=

    (self methods collect: #asRingDefinition) sorted: [ :x :y | x selector < y selector ] composite list title: 'Methods'; display: methods; format: #selector; tags: [ :each | {each methodClass name} ]
  13. Added gtInspectorMethodsIn: composite <gtInspectorPresentationOrder: 20> | methods | methods :=

    (self methods collect: #asRingDefinition) sorted: [ :x :y | x selector < y selector ] composite list title: 'Methods'; display: methods; format: #selector; tags: [ :each | {each methodClass name} ]
  14. Added gtInspectorMethodsIn: composite <gtInspectorPresentationOrder: 20> composite list title: 'Methods'; display:

    ((self methods collect: #asRingDefinition) sorted: [ :x :y | x selector < y selector ]); format: #selector; tags: [ :each | {each methodClass name} ]
  15. Added gtInspectorMethodsIn: composite <gtInspectorPresentationOrder: 20> composite list title: 'Methods'; display:

    [ (self methods collect: #asRingDefinition) sorted: [ :x :y | x selector < y selector ] ]; format: #selector; tags: [ :each | {each methodClass name} ]
  16. Added Lazy evaluation gtInspectorMethodsIn: composite <gtInspectorPresentationOrder: 20> composite list title:

    'Methods'; display: [ (self methods collect: #asRingDefinition) sorted: [ :x :y | x selector < y selector ] ]; format: #selector; tags: [ :each | {each methodClass name} ]
  17. gtInspectorMethodsIn: composite <gtInspectorPresentationOrder: 20> composite list title: 'Methods'; display: [

    (self methods collect: #asRingDefinition) sorted: [ :x :y | x selector < y selector ] ]; format: #selector; tags: [ :each | {each methodClass name} ] Added Lazy evaluation Recipe: presentation: aPresentation isTheLeftmostRecepientIn: aStatement ^ (aStatement isMessage or: [ aStatement isCascade ]) and: [ aStatement leftmostChainReceiver = aPresentation ]
  18. @yuriy_tymchuk When QualityAssistant Meets Pharo Enforced Code Critiques Motivate More

    Valuable Rules , Mohammad Ghafari, Oscar Nierstrasz Software Composition Group @ University of Bern
  19. @yuriy_tymchuk When QualityAssistant Meets Pharo Enforced Code Critiques Motivate More

    Valuable Rules , Mohammad Ghafari, Oscar Nierstrasz Software Composition Group @ University of Bern Important Fixes
  20. @yuriy_tymchuk When QualityAssistant Meets Pharo Enforced Code Critiques Motivate More

    Valuable Rules , Mohammad Ghafari, Oscar Nierstrasz Software Composition Group @ University of Bern Important Fixes Educational Rules Removed
  21. @yuriy_tymchuk When QualityAssistant Meets Pharo Enforced Code Critiques Motivate More

    Valuable Rules , Mohammad Ghafari, Oscar Nierstrasz Software Composition Group @ University of Bern Important Fixes Educational Rules Removed Domain Rules Added
  22. @yuriy_tymchuk When QualityAssistant Meets Pharo Enforced Code Critiques Motivate More

    Valuable Rules , Mohammad Ghafari, Oscar Nierstrasz Software Composition Group @ University of Bern Important Fixes Educational Rules Removed Domain Rules Added Migration
  23. @yuriy_tymchuk When QualityAssistant Meets Pharo Enforced Code Critiques Motivate More

    Valuable Rules , Mohammad Ghafari, Oscar Nierstrasz Software Composition Group @ University of Bern Important Fixes Educational Rules Removed Domain Rules Added Migration Private access
  24. @yuriy_tymchuk When QualityAssistant Meets Pharo Enforced Code Critiques Motivate More

    Valuable Rules , Mohammad Ghafari, Oscar Nierstrasz Software Composition Group @ University of Bern Important Fixes Educational Rules Removed Domain Rules Added Migration Private access Invocation order
  25. @yuriy_tymchuk When QualityAssistant Meets Pharo Enforced Code Critiques Motivate More

    Valuable Rules , Mohammad Ghafari, Oscar Nierstrasz Software Composition Group @ University of Bern Important Fixes Educational Rules Removed Domain Rules Added Migration Private access Invocation order Class structure
  26. @yuriy_tymchuk When QualityAssistant Meets Pharo Enforced Code Critiques Motivate More

    Valuable Rules , Mohammad Ghafari, Oscar Nierstrasz Software Composition Group @ University of Bern Important Fixes Educational Rules Removed Domain Rules Added Migration Private access Invocation order Class structure Lazy evaluation