• Save
Paving the Way for Agile Engineering Practices
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Paving the Way for Agile Engineering Practices

on

  • 461 views

Talk focused on preparing to apply Agile Engineering Practices on an existing code base. Most existing projects differ in structure and quality compared to greenfield Agile projects. They often suffer ...

Talk focused on preparing to apply Agile Engineering Practices on an existing code base. Most existing projects differ in structure and quality compared to greenfield Agile projects. They often suffer from Code Smells, Architectural Smells, and Deployment Smells. Overcoming these in an evolutionary manner is key to paving the way for successful application of Agile Engineering Practices. Failure to do so could lead to stress and counterproductive results. This presentation covers why, what, and how of some useful techniques.

Presented at Agile in Business conference at Pune, India, during India Agile Week (Oct 2013).

Statistics

Views

Total Views
461
Views on SlideShare
446
Embed Views
15

Actions

Likes
2
Downloads
0
Comments
1

4 Embeds 15

http://www.linkedin.com 6
http://www.amanking.com 5
https://www.linkedin.com 3
http://localhost 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Credits:http://shop.oreilly.com/product/0636920020271.do
  • Credits:http://shop.oreilly.com/product/0636920020271.dohttp://www.cs.ox.ac.uk/softeng/subjects/APE.html
  • Credits:http://shop.oreilly.com/product/0636920020271.dohttp://www.cs.ox.ac.uk/softeng/subjects/APE.htmlhttp://www.scrumalliance.org/courses-events/courses/csd/united-states/new-jersey/princeton/2013/august/20132307-certified-scrumdeveloper-track
  • Credits:http://shop.oreilly.com/product/0636920020271.dohttp://www.cs.ox.ac.uk/softeng/subjects/APE.htmlhttp://www.scrumalliance.org/courses-events/courses/csd/united-states/new-jersey/princeton/2013/august/20132307-certified-scrumdeveloper-trackhttp://www.agileinbusiness.com/pune/program

Paving the Way for Agile Engineering Practices Presentation Transcript

  • 1. www.unicomlearning.com India Agile Week-2013 26 October 2013 | Pune Paving the Way for Agile Engineering Practices Aman King Agile Technologist | Agile Coach ThoughtWorks India | Bangalore www.agileinbusiness.com
  • 2. www.unicomlearning.com Paving the Way for Agile Engineering Practices UNICOM Presents India Agile Week-2013
  • 3. www.unicomlearning.com Paving the Way for Agile Engineering Practices UNICOM Presents India Agile Week-2013
  • 4. www.unicomlearning.com Paving the Way for Agile Engineering Practices UNICOM Presents India Agile Week-2013
  • 5. www.unicomlearning.com Paving the Way for Agile Engineering Practices UNICOM Presents India Agile Week-2013
  • 6. Exploring Agile Engineering Practices…
  • 7. Exploring Agile Engineering Practices…
  • 8. Exploring Agile Engineering Practices…
  • 9. Exploring Agile Engineering Practices…
  • 10. Exploring Agile Engineering Practices…
  • 11. Agile Engineering Practices
  • 12. Paving the Way for Agile Engineering Practices
  • 13. Paving the Way for Agile Engineering Practices Why?
  • 14. Observations as Agile Practitioner & Agile Coach
  • 15. Most code bases are inherited by teams
  • 16. Most teams starting Agile adoption have an existing code base
  • 17. Existing code bases differ from “Agile” code bases
  • 18. Agile Engineering Practices cannot be applied as-is to existing code bases
  • 19. Result?
  • 20. Technical improvements cannot keep up with Agile planning, time-boxes & frequent delivery
  • 21. Everyone stresses out! Code base worsens with every iteration! Agile deemed a failure!
  • 22. Paving the Way for Agile Engineering Practices What?
  • 23. Removing common roadblocks
  • 24. Code smells Architectural smells Deployment smells
  • 25. Code smells
  • 26. Most common, most offending! • • • • • • • • • • Long methods Long class Static method calls Lot of if-else’s, including null checks Primitive obsession Multiple assignments to a local variable Temporal coupling Fields as temporary variables Out parameters Setters!!!
  • 27. Hurt Matrix Smell TDD Refactoring Pair Programming Continuous Integration Long methods/class X X X - Statics X X - X Conditionals X X X - Primitive obsession X X - - Multiple assignments X X X - Methods with side-effects X X X - Setters X X X -
  • 28. Architectural smells
  • 29. Most common, most offending! • • • • • • • • Incorrect responsibility-split across layers Confusing or inconsistent module structure Missing Dependency Injection Abused Dependency Injection No componentization Over-componentization Rewrites: big-bang, either-or, long-lived Mixed tech stack
  • 30. Hurt Matrix Smell TDD Refactoring Pair Programming Continuous Integration Layering X X X X Module structure X X X - Missing or abused DI X X X X Componentization X X X X Rewrites X X X X Mixed tech stack X X X X
  • 31. Deployment smells
  • 32. Most common, most offending! • • • • • • Branching based on release / feature / team Dependencies not version controlled Database changes not version controlled Deployment scripts not version controlled Shared non-isolated environments Infrastructure access highly restricted
  • 33. Hurt Matrix Smell TDD Refactoring Pair Programming Continuous Integration Branching strategy - X X X Untracked dependencies - - X X Untracked DB changes X X X X Untracked deployment scripts - - X X Shared environments X X X X Restricted infrastructure access - - X X
  • 34. Paving the Way for Agile Engineering Practices How?
  • 35. Let’s look at examples…
  • 36. Code smells
  • 37. Most common, most offending! • • • • • • • • • • Long methods Long class Static method calls Lot of if-else’s, including null checks Primitive obsession Multiple assignments to a local variable Temporal coupling Fields as temporary variables Out parameters Setters!!!
  • 38. Most common, most offending! • • • • • • • • • • Long methods Long class Static method calls Lot of if-else’s, including null checks Primitive obsession Multiple assignments to a local variable Temporal coupling Fields as temporary variables Out parameters Setters!!!
  • 39. Smelly!
  • 40. TDD Hurt: Hard to test for one thing at a time!
  • 41. Refactoring Hurt: Hard to safely refactor!
  • 42. Failed attempt at IDE refactoring!
  • 43. Pair Programming Hurt: Hard to quickly understand! Hard to quickly debug!
  • 44. What to do? Smelly Code
  • 45. Smelly Code Tests for Smelly Code
  • 46. Smelly Code Tests for Smelly Code Tests for new Feature
  • 47. Smelly Code Tests for Smelly Code Tests for new Feature Add to Smelly Code
  • 48. Smelly Code Tests for Smelly Code Tests for new Feature Add to Smelly Code Smellier Code
  • 49. Let’s back up a bit…
  • 50. Smelly Code Tests for Smelly Code Tests for new Feature Add to Smelly Code Smellier Code
  • 51. Smelly Code Tests for Smelly Code Tests for new Feature Manual Refactor to Less Smelly Code Add to Smelly Code Smellier Code
  • 52. Smelly Code Tests for Smelly Code Tests for new Feature Manual Refactor to Less Smelly Code Add to Smelly Code Smellier Code
  • 53. Smelly Code Tests for Smelly Code Tests for new Feature Manual Refactor to Less Smelly Code Add to Smelly Code Add to Refactored Code Smellier Code
  • 54. Smelly Code Tests for Smelly Code Tests for new Feature Manual Refactor to Less Smelly Code Add to Smelly Code Add to Refactored Code Refactor to Less Smelly Code Smellier Code Cleaner Code
  • 55. Smelly Code Tests for Smelly Code Tests for new Feature Manual Refactor to Less Smelly Code Pave! Add to Smelly Code Add to Refactored Code Refactor to Less Smelly Code Smellier Code Cleaner Code
  • 56. Most common, most offending! • • • • • • • • • • Long methods Long class Static method calls Lot of if-else’s, including null checks Primitive obsession Multiple assignments to a local variable Temporal coupling Fields as temporary variables Out parameters Setters!!!
  • 57. Most common, most offending! • • • • • • • • • • Long methods Long class Static method calls Lot of if-else’s, including null checks Primitive obsession Multiple assignments to a local variable Temporal coupling Fields as temporary variables Out parameters Setters!!!
  • 58. Smelly!
  • 59. Pave!
  • 60. Most common, most offending! • • • • • • • • • • Long methods Long class Static method calls Lot of if-else’s, including null checks Primitive obsession Multiple assignments to a local variable Temporal coupling Fields as temporary variables Out parameters Setters!!!
  • 61. Smelly!
  • 62. How to test different outcomes?
  • 63. Pave!
  • 64. Architectural smells
  • 65. Most common, most offending! • • • • • • • • Incorrect responsibility-split across layers Confusing or inconsistent module structure Missing Dependency Injection Abused Dependency Injection No componentization Over-componentization Rewrites: big-bang, either-or, long-lived Mixed tech stack
  • 66. Most common, most offending! • • • • • • • • Incorrect responsibility-split across layers Confusing or inconsistent module structure Missing Dependency Injection Abused Dependency Injection No componentization Over-componentization Rewrites: big-bang, either-or, long-lived Mixed tech stack
  • 67. Smelly!
  • 68. Pave!
  • 69. Smelly!
  • 70. Two database hits!
  • 71. Pave!
  • 72. More domain driven
  • 73. Most common, most offending! • • • • • • • • Incorrect responsibility-split across layers Confusing or inconsistent module structure Missing Dependency Injection Abused Dependency Injection No componentization Over-componentization Rewrites: big-bang, either-or, long-lived Mixed tech stack
  • 74. Smelly!
  • 75. Field-based injection
  • 76. How to inject the mock?
  • 77. Pave!
  • 78. A B C Spring IoC D
  • 79. A B C Spring IoC D E
  • 80. A B C E Spring IoC D
  • 81. A B C E Spring IoC D Is E really “cross-cutting” or is it just too easy to inject?
  • 82. A High coupling B C E Spring IoC D Smelly!
  • 83. A B C E Spring IoC D Solution?
  • 84. A B C D E Pave! Spring IoC
  • 85. Deployment smells
  • 86. Most common, most offending! • • • • • • Branching based on release / feature / team Dependencies not version controlled Database changes not version controlled Deployment scripts not version controlled Shared non-isolated environments Infrastructure access highly restricted
  • 87. Most common, most offending! • • • • • • Branching based on release / feature / team Dependencies not version controlled Database changes not version controlled Deployment scripts not version controlled Shared non-isolated environments Infrastructure access highly restricted
  • 88. Smelly! http://martinfowler.com/bliki/FeatureBranch.html
  • 89. Pave! http://martinfowler.com/bliki/FeatureToggle.html http://paulhammant.com/blog/branch_by_abstraction.html
  • 90. Most common, most offending! • • • • • • Branching based on release / feature / team Dependencies not version controlled Database changes not version controlled Deployment scripts not version controlled Shared non-isolated environments Infrastructure access highly restricted
  • 91. Pave! Dump current schema DDL Introduce a tool like Liquibase/ dbdeploy & commit initial DDL script Similarly for DML http://www.liquibase.org http://dbdeploy.com Further changes made only via Liquibase/ dbdeploy scripts Test the Liquibase/ dbdeploy scripts Commit the Liquibase/ dbdeploy scripts
  • 92. Most common, most offending! • • • • • • Branching based on release / feature / team Dependencies not version controlled Database changes not version controlled Deployment scripts not version controlled Shared non-isolated environments Infrastructure access highly restricted
  • 93. Pave! Automate deployment steps with bash scripts Commit the scripts into a versioncontrolled repository http://rubygems.org/gems/chef http://rubygems.org/gems/puppet Automate invoking the scripts via a CI tool like Jenkins/Go Build confidence with automated smoke tests Replace scripts with a tool like Chef/ Puppet
  • 94. Most common, most offending! • • • • • • Branching based on release / feature / team Dependencies not version controlled Database changes not version controlled Deployment scripts not version controlled Shared non-isolated environments Infrastructure access highly restricted
  • 95. Pave! Identify volatile shared resources Deploy/ install local version of identified resources Create stubs as local version of identified resources Develop against local version of identified resources Regularly update/sync local version of identified resources Test end-toend on a true integrated environment
  • 96. Paving the Way for Agile Engineering Practices…
  • 97. Is difficult but doable! Needs some upfront thinking, planning & implementation. Can be done alongside business functionality.
  • 98. Just be alert & prepared… to pave the way!
  • 99. www.unicomlearning.com amanking.com king@thoughtworks.com India Agile Week-2013 Organized by UNICOM Trainings & Seminars Pvt. Ltd. contact@unicomlearning.com Example code available at https://github.com/amanking/paving_the_way_talk_companion