7/17/2012




                                                     Writing High Quality Code
                                                             Agile 2012
                            www.ToBeAgile.com
                                                          © Copyright 2009-2012 To Be Agile   DB20120717
                               info@ToBeAgile.com
                       www.techniquesofdesign.com
                       info@techniquesofdesign.com        COPYRIGHT © TECHNIQUES OF DESIGN        DB20111207




                                 Thank you for being here




                                                                                                           2




http://ToBeAgile.com                                                                                                  1
7/17/2012




                       I am David Bernstein




                                                             3




                       Standing on the shoulders of giants




                                                             4




http://ToBeAgile.com                                                    2
7/17/2012




                       What is quality?




                           Service        Products
                                                     ?
                                                     Software




                                                                5




                       What makes software good?




                                                                6




http://ToBeAgile.com                                                       3
7/17/2012




                       Correctness is not enough




                                                   7




                       Remember when?




                                                   8




http://ToBeAgile.com                                          4
7/17/2012




                       Things change




                                             9




                       Dealing with change




                                             10




http://ToBeAgile.com                                     5
7/17/2012




                       What makes code easy to change?




                                                              11




                       What makes code difficult to change?




                                                              12




http://ToBeAgile.com                                                      6
7/17/2012




                       Code pathologies




                                                      13




                       Rigidity – hard to repurpose




                                                      14




http://ToBeAgile.com                                              7
7/17/2012




                       Viscosity – difficult to change




                                                           15




                       Complexity – unsure how to change




                                                           16




http://ToBeAgile.com                                                   8
7/17/2012




                       Opaque – difficult to understand




                                                           17




                       Brittleness – expensive to change




                                                           18




http://ToBeAgile.com                                                   9
7/17/2012




                       Pathologies scare us




                                                        19




                       It’s harder on larger projects




                                                        20




http://ToBeAgile.com                                               10
7/17/2012




                       Quality in software




                                              21




                       6 software qualities




                                              22




http://ToBeAgile.com                                     11
7/17/2012




                       Cohesive




                                               1




                                                   23




                       Language and software




                                                   24




http://ToBeAgile.com                                          12
7/17/2012




                       Class cohesion




                                         25




                       Method cohesion




                                         26




http://ToBeAgile.com                                13
7/17/2012




                       Pathologies of poor cohesion




                                                          27




                       Non-redundant




                                                      2




                                                          28




http://ToBeAgile.com                                                 14
7/17/2012




                       Finding redundancy




                                             29




                       Types of redundancy




                                             30




http://ToBeAgile.com                                    15
7/17/2012




                       Can non-identical code be redundant?




                                                              31




                       Can identical code be non-redundant?




                                                              32




http://ToBeAgile.com                                                     16
7/17/2012




                       Redundant intent




                                                 33




                       Code investment or debt




                                                 34




http://ToBeAgile.com                                        17
7/17/2012




                       Pathologies of redundancy




                                                       35




                       Encapsulated




                                                   3




                                                       36




http://ToBeAgile.com                                              18
7/17/2012




                       What can be encapsulated?




                                                   37




                       What you don’t know…




                                                   38




http://ToBeAgile.com                                          19
7/17/2012




                       …can’t hurt you




                                               39




                       Encapsulate by policy




                                               40




http://ToBeAgile.com                                      20
7/17/2012




                       Optimization




                                                 41




                       Can you encapsulate it?




                                                 42




http://ToBeAgile.com                                        21
7/17/2012




                       Many ways to encapsulate




                                                           43




                       Pathologies of poor encapsulation




                                                           44




http://ToBeAgile.com                                                  22
7/17/2012




                       Assertive




                                                   4




                                                       45




                       Assertive or inquisitive?




                                                       46




http://ToBeAgile.com                                              23
7/17/2012




                       Object therapy




                                                                       47




                       “With great state comes great responsibility”




                                                                       48




http://ToBeAgile.com                                                              24
7/17/2012




                       Winston Churchill, Spiderman’s Uncle




                                                              49




                       Pathologies of inquisitiveness




                                                              50




http://ToBeAgile.com                                                     25
7/17/2012




                       Testable




                                                   5




                                                       51




                       Testability guides design




                                                       52




http://ToBeAgile.com                                              26
7/17/2012




                       Pathologies of poor testability




                                                             53




                       Explicit




                                                         6




                                                             54




http://ToBeAgile.com                                                    27
7/17/2012




                       Good and bad coupling




                                               55




                       Bad coupling




                                               56




http://ToBeAgile.com                                      28
7/17/2012




                       Coupling


                           Type

                           Interface

                           Abstract

                           Concrete




                                                                       57




                       Coupling example


                                                 Abstract Coupling



                             Type Coupling
                           Interface Coupling




                                                No Concrete Coupling



                                                                       58




http://ToBeAgile.com                                                              29
7/17/2012




                       Pathologies of bad coupling




                                                     59




                       The six code qualities…




                                                     60




http://ToBeAgile.com                                            30
7/17/2012




                        – Cohesive
                        – non-Redundant
                        – Encapsulated
                        – Assertive
                        – Testable
                        – Explicit




                                          61




                       …spells CREATE




                                          62




http://ToBeAgile.com                                 31
7/17/2012




                       Code qualities guide us




                                                                                          63




                       Thank You!

                          We have just scratched the surface, to learn more:
                           – Read my blog: http://ToBeAgile.com/blog
                           – Follow me on Twitter (@ToBeAgile)
                           – Attend my one of my Certified Scrum Developer trainings
                          Public Certified Scrum Developer Essentials classes:
                           – October 15 – 19, 2012 in Redwood City, CA
                          Public Agile Software Developer Essentials classes:
                           – December 10 – 14, 2012 Online (8:00 am-12:00 pm PT)
                          Private classes available for groups of 8 or more developers
                           – Learn more at http://ToBeAgile.com


                                                                                          64




http://ToBeAgile.com                                                                                 32

More Related Content

PDF
低功耗服务器定制与绿色计算——章文嵩(淘宝)
PDF
How & Why of Agile
PDF
BA Stands for Being Agile
KEY
My Case for Agile
PDF
Agile presentation ONA12
PDF
Agile 2012 the 0-page agile test plan - paul carvalho
PDF
Being Agile ! - by Ashish Dhoke (projectingIT)
PDF
Agile in a Nutshell - Portia Tung
低功耗服务器定制与绿色计算——章文嵩(淘宝)
How & Why of Agile
BA Stands for Being Agile
My Case for Agile
Agile presentation ONA12
Agile 2012 the 0-page agile test plan - paul carvalho
Being Agile ! - by Ashish Dhoke (projectingIT)
Agile in a Nutshell - Portia Tung

Similar to Writing high quality code for agile2012 (20)

PDF
Software development is hard
PDF
Practices of an agile developer
PDF
Testing in an Agile Context 2011
PDF
Agile Business Analysis - The Key to Effective Requirements on Agile Projects
PDF
Agile tour 2011 ralph jocham
PDF
Mastering scrum
PDF
A simple formula for becoming Lean, Agile and unlocking high performance teams
PDF
Introduction into Agile & Scrum
PDF
Hands onagile2012shared
PDF
Creating High Performing Teams
PDF
Rally Fream Work
PDF
Introduction to agility
PPTX
Introduction to Agile for Digital Stakeholders
PPT
STC Summit 2012 - How Writers Can Thrive in Agile Software Development
KEY
Take your clients into your UX team & let them design
PDF
Itag Jan09 Agile Coclarity
PPTX
SITA agile transformation
PDF
The 90 minute Guide to Agile – What, Why, How by Allan Kelly
PDF
Agile in 90minutes
PPT
The Cornerstone of Agile: Why it works, Why it hurts
Software development is hard
Practices of an agile developer
Testing in an Agile Context 2011
Agile Business Analysis - The Key to Effective Requirements on Agile Projects
Agile tour 2011 ralph jocham
Mastering scrum
A simple formula for becoming Lean, Agile and unlocking high performance teams
Introduction into Agile & Scrum
Hands onagile2012shared
Creating High Performing Teams
Rally Fream Work
Introduction to agility
Introduction to Agile for Digital Stakeholders
STC Summit 2012 - How Writers Can Thrive in Agile Software Development
Take your clients into your UX team & let them design
Itag Jan09 Agile Coclarity
SITA agile transformation
The 90 minute Guide to Agile – What, Why, How by Allan Kelly
Agile in 90minutes
The Cornerstone of Agile: Why it works, Why it hurts
Ad

More from drewz lin (20)

PPTX
Web security-–-everything-we-know-is-wrong-eoin-keary
PDF
Via forensics appsecusa-nov-2013
PPTX
Phu appsec13
PPTX
Owasp2013 johannesullrich
PDF
Owasp advanced mobile-application-code-review-techniques-v0.2
PPTX
I mas appsecusa-nov13-v2
PDF
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
ODP
Csrf not-all-defenses-are-created-equal
PPTX
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
PPTX
Appsec usa roberthansen
PDF
Appsec usa2013 js_libinsecurity_stefanodipaola
PPT
Appsec2013 presentation-dickson final-with_all_final_edits
PPTX
Appsec2013 presentation
PPTX
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
PPTX
Appsec2013 assurance tagging-robert martin
PPTX
Amol scadaowasp
PPTX
Agile sdlc-v1.1-owasp-app sec-usa
PPTX
Vulnex app secusa2013
PDF
基于虚拟化技术的分布式软件测试框架
PPTX
新浪微博稳定性经验谈
Web security-–-everything-we-know-is-wrong-eoin-keary
Via forensics appsecusa-nov-2013
Phu appsec13
Owasp2013 johannesullrich
Owasp advanced mobile-application-code-review-techniques-v0.2
I mas appsecusa-nov13-v2
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Csrf not-all-defenses-are-created-equal
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
Appsec usa roberthansen
Appsec usa2013 js_libinsecurity_stefanodipaola
Appsec2013 presentation-dickson final-with_all_final_edits
Appsec2013 presentation
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec2013 assurance tagging-robert martin
Amol scadaowasp
Agile sdlc-v1.1-owasp-app sec-usa
Vulnex app secusa2013
基于虚拟化技术的分布式软件测试框架
新浪微博稳定性经验谈
Ad

Writing high quality code for agile2012

  • 1. 7/17/2012 Writing High Quality Code Agile 2012 www.ToBeAgile.com © Copyright 2009-2012 To Be Agile DB20120717 info@ToBeAgile.com www.techniquesofdesign.com info@techniquesofdesign.com COPYRIGHT © TECHNIQUES OF DESIGN DB20111207 Thank you for being here 2 http://ToBeAgile.com 1
  • 2. 7/17/2012 I am David Bernstein 3 Standing on the shoulders of giants 4 http://ToBeAgile.com 2
  • 3. 7/17/2012 What is quality? Service Products ? Software 5 What makes software good? 6 http://ToBeAgile.com 3
  • 4. 7/17/2012 Correctness is not enough 7 Remember when? 8 http://ToBeAgile.com 4
  • 5. 7/17/2012 Things change 9 Dealing with change 10 http://ToBeAgile.com 5
  • 6. 7/17/2012 What makes code easy to change? 11 What makes code difficult to change? 12 http://ToBeAgile.com 6
  • 7. 7/17/2012 Code pathologies 13 Rigidity – hard to repurpose 14 http://ToBeAgile.com 7
  • 8. 7/17/2012 Viscosity – difficult to change 15 Complexity – unsure how to change 16 http://ToBeAgile.com 8
  • 9. 7/17/2012 Opaque – difficult to understand 17 Brittleness – expensive to change 18 http://ToBeAgile.com 9
  • 10. 7/17/2012 Pathologies scare us 19 It’s harder on larger projects 20 http://ToBeAgile.com 10
  • 11. 7/17/2012 Quality in software 21 6 software qualities 22 http://ToBeAgile.com 11
  • 12. 7/17/2012 Cohesive 1 23 Language and software 24 http://ToBeAgile.com 12
  • 13. 7/17/2012 Class cohesion 25 Method cohesion 26 http://ToBeAgile.com 13
  • 14. 7/17/2012 Pathologies of poor cohesion 27 Non-redundant 2 28 http://ToBeAgile.com 14
  • 15. 7/17/2012 Finding redundancy 29 Types of redundancy 30 http://ToBeAgile.com 15
  • 16. 7/17/2012 Can non-identical code be redundant? 31 Can identical code be non-redundant? 32 http://ToBeAgile.com 16
  • 17. 7/17/2012 Redundant intent 33 Code investment or debt 34 http://ToBeAgile.com 17
  • 18. 7/17/2012 Pathologies of redundancy 35 Encapsulated 3 36 http://ToBeAgile.com 18
  • 19. 7/17/2012 What can be encapsulated? 37 What you don’t know… 38 http://ToBeAgile.com 19
  • 20. 7/17/2012 …can’t hurt you 39 Encapsulate by policy 40 http://ToBeAgile.com 20
  • 21. 7/17/2012 Optimization 41 Can you encapsulate it? 42 http://ToBeAgile.com 21
  • 22. 7/17/2012 Many ways to encapsulate 43 Pathologies of poor encapsulation 44 http://ToBeAgile.com 22
  • 23. 7/17/2012 Assertive 4 45 Assertive or inquisitive? 46 http://ToBeAgile.com 23
  • 24. 7/17/2012 Object therapy 47 “With great state comes great responsibility” 48 http://ToBeAgile.com 24
  • 25. 7/17/2012 Winston Churchill, Spiderman’s Uncle 49 Pathologies of inquisitiveness 50 http://ToBeAgile.com 25
  • 26. 7/17/2012 Testable 5 51 Testability guides design 52 http://ToBeAgile.com 26
  • 27. 7/17/2012 Pathologies of poor testability 53 Explicit 6 54 http://ToBeAgile.com 27
  • 28. 7/17/2012 Good and bad coupling 55 Bad coupling 56 http://ToBeAgile.com 28
  • 29. 7/17/2012 Coupling  Type  Interface  Abstract  Concrete 57 Coupling example Abstract Coupling Type Coupling Interface Coupling No Concrete Coupling 58 http://ToBeAgile.com 29
  • 30. 7/17/2012 Pathologies of bad coupling 59 The six code qualities… 60 http://ToBeAgile.com 30
  • 31. 7/17/2012 – Cohesive – non-Redundant – Encapsulated – Assertive – Testable – Explicit 61 …spells CREATE 62 http://ToBeAgile.com 31
  • 32. 7/17/2012 Code qualities guide us 63 Thank You!  We have just scratched the surface, to learn more: – Read my blog: http://ToBeAgile.com/blog – Follow me on Twitter (@ToBeAgile) – Attend my one of my Certified Scrum Developer trainings  Public Certified Scrum Developer Essentials classes: – October 15 – 19, 2012 in Redwood City, CA  Public Agile Software Developer Essentials classes: – December 10 – 14, 2012 Online (8:00 am-12:00 pm PT)  Private classes available for groups of 8 or more developers – Learn more at http://ToBeAgile.com 64 http://ToBeAgile.com 32