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).
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Paving the Way for Agile Engineering Practices
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
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!!!
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
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!!!
54. Smelly Code
Tests for
Smelly Code
Tests for
new Feature
Manual
Refactor to
Less Smelly
Code
Add to
Smelly Code
Smellier
Code
55.
56. Smelly Code
Tests for
Smelly Code
Tests for
new Feature
Manual
Refactor to
Less Smelly
Code
Add to
Smelly Code
Smellier
Code
57.
58. 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
59.
60. 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
61.
62.
63.
64. 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
65. 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!!!
66. 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!!!
70. 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!!!
105. 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
106. 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
109. 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
110. 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
111. 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
112. 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
113. 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