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. @yuriy_tymchuk When QualityAssistant Meets Pharo Enforced Code Critiques Motivate More

    Valuable Rules , Mohammad Ghafari, Oscar Nierstrasz Software Composition Group @ University of Bern
  2. The Concept

  3. The Concept Rule

  4. The Concept Rule

  5. The Concept Rule Critique produces

  6. The Concept Rule Critique produces

  7. The Concept Rule Critique [|] Code produces improves

  8. The Concept Rule Critique [|] Code produces improves (feedback) improves

  9. The Concept Rule Critique [|] Code produces improves (feedback) improves

  10. The Concept Rule Critique [|] Code produces improves

  11. The Concept Rule Critique [|] Code produces improves

  12. The Existing CriticBrowser

  13. Newly Introduced QualityAssistant

  14. SmallLint Issues per Milestone 0 10 20 30 40 50

    Pharo 3 Pharo 4 Pharo 5 Pharo 6*
  15. Changes in Rules

  16. Changes in Rules Fixed

  17. Changes in Rules Fixed Removed

  18. Added Changes in Rules Fixed Removed

  19. Fixed

  20. Fixed (Collection>>#add:) protocol #adding

  21. Fixed (Collection>>#add:) protocol (ArrayedCollection>>#add:) protocol #adding #adding

  22. Fixed (Collection>>#add:) protocol (ArrayedCollection>>#add:) protocol #adding #accessing

  23. Fixed (Collection>>#add:) protocol (ArrayedCollection>>#add:) protocol #adding #accessing

  24. Fixed (Collection>>#add:) protocol #'as yet unclassified' (ArrayedCollection>>#add:) protocol #adding

  25. Fixed (Collection>>#add:) protocol #'as yet unclassified' (ArrayedCollection>>#add:) protocol #adding Trivial

    Bug
  26. Fixed

  27. Fixed RBModi!esCollectionRule

  28. Fixed RBModi!esCollectionRule Horrible Bug

  29. Removed

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

    an abstract class
  31. Removed Probably missing ‘; yourself’ Non-blocks in special messages References

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

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

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

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

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

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

    globals at: assert: a equals: b Migration Recipe: use rewrite rules
  38. Added

  39. Added BoxedFloat64 reference to

  40. Added BoxedFloat64 reference to Private Access

  41. Added BoxedFloat64 reference to Recipe: annotate/maintain a collection of system

    classes/methods Private Access
  42. Added

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

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

    nodes: RTShape withAllSubclasses. b := RTMondrian new. b edges connectFrom: #superclass. b nodes: RTShape withAllSubclasses.
  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.
  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.
  47. Added

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

    #checksNode
  49. Added ReAbstractRule class >> #checksPackage; >> #checksClass; >> #checksMethod; >>

    #checksNode true?
  50. Added ReAbstractRule class >> #checksPackage; >> #checksClass; >> #checksMethod; >>

    #checksNode true? Class Structure
  51. Added ReAbstractRule class >> #checksPackage; >> #checksClass; >> #checksMethod; >>

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

  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} ]
  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} ]
  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} ]
  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} ]
  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} ]
  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 ]
  59. Feedback

  60. Feedback http://renraku.inf.usi.ch/rules

  61. Feedback http://renraku.inf.usi.ch/rules

  62. Feedback http://renraku.inf.usi.ch/rules

  63. Feedback http://renraku.inf.usi.ch/rules

  64. Feedback http://renraku.inf.usi.ch/rules

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

    Valuable Rules , Mohammad Ghafari, Oscar Nierstrasz Software Composition Group @ University of Bern
  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
  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
  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
  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
  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
  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
  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
  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