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

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.

9847702de1f7f19db8c3e158325baa8e?s=128

Yuriy Tymchuk

August 23, 2016
Tweet

Transcript

  1. 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. 14.

    SmallLint Issues per Milestone 0 10 20 30 40 50

    Pharo 3 Pharo 4 Pharo 5 Pharo 6*
  3. 19.
  4. 26.
  5. 29.
  6. 31.

    Removed Probably missing ‘; yourself’ Non-blocks in special messages References

    an abstract class size = 1 ifTrue: ’:’ ifFalse: ’s:’
  7. 32.

    Removed Probably missing ‘; yourself’ Non-blocks in special messages References

    an abstract class String new size = 1 ifTrue: ’:’ ifFalse: ’s:’
  8. 33.

    Removed Probably missing ‘; yourself’ Non-blocks in special messages References

    an abstract class String new size = 1 ifTrue: ’:’ ifFalse: ’s:’ Educational
  9. 34.
  10. 36.

    Added assert: a = b ifNotNilDo: ifNotNil: Smalltalk at: Smalltalk

    globals at: assert: a equals: b Migration
  11. 37.

    Added assert: a = b ifNotNilDo: ifNotNil: Smalltalk at: Smalltalk

    globals at: assert: a equals: b Migration Recipe: use rewrite rules
  12. 38.
  13. 42.
  14. 44.

    Added b := RTMondrian new. b edges connectFrom: #superclass. b

    nodes: RTShape withAllSubclasses. b := RTMondrian new. b edges connectFrom: #superclass. b nodes: RTShape withAllSubclasses.
  15. 45.

    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.
  16. 46.

    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.
  17. 47.
  18. 51.

    Added ReAbstractRule class >> #checksPackage; >> #checksClass; >> #checksMethod; >>

    #checksNode true? Recipe: (aClass inheritsFrom: ReAbstractRule) and: [ selectors anySatisfy: [ :s | aClass perform: s ] ] Class Structure
  19. 52.
  20. 53.

    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} ]
  21. 54.

    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} ]
  22. 55.

    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} ]
  23. 56.

    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} ]
  24. 57.

    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} ]
  25. 58.

    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 ]
  26. 59.
  27. 65.

    @yuriy_tymchuk When QualityAssistant Meets Pharo Enforced Code Critiques Motivate More

    Valuable Rules , Mohammad Ghafari, Oscar Nierstrasz Software Composition Group @ University of Bern
  28. 66.

    @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
  29. 67.

    @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
  30. 68.

    @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
  31. 69.

    @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
  32. 70.

    @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
  33. 71.

    @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
  34. 72.

    @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
  35. 73.

    @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