SlideShare a Scribd company logo
1 of 14
Download to read offline
Source / Version Control:
Best Practices in Agile
© 2015 Intelliware Development Inc.
Introduction
As the Agile Alliance states, “Version control is not strictly speaking an Agile "practice", insofar
as it is now (fortunately) widespread in the industry as a whole. It must however be
mentioned…for several reasons:
• Though they are rare, one still occasionally stumbles across teams with outdated version
control tools or practices, and even teams who haven't adopted version control tools at all
• Version control is not merely "good practice" but an enabler of a number of Agile practices,
such as continuous integration
• The Agile community leans toward particular types of tools and practices, namely the same
as the Open Source community: systems that afford concurrent work ("merge" model rather
than "lock"), and more recently favoring distributed over centralized models
• It is therefore beneficial for an Agile team to explicitly reflect on its version control policies
and infrastructure, and ensure that they and its engineering practices work harmoniously
together
Here are our top 10 best practices for Source Control.
2See more at: http://guide.agilealliance.org/guide/versioncontrol.html#sthash.Zh3h1ijE.dpuf© 2015 Intelliware Development Inc.
© 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 3
If it’s not in source
control, it doesn’t exist!
• Code sitting on your machine is of no
value to anyone else.
• Code sitting on your machine can be
lost.
• It is typically recommended to always
push your code before the end of your
work day.
© 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 4
Commit often
• A commit, or "revision", is an individual
change to a file (or set of files).
• Commits should be a logical – usually small
– grouping of changes.
• Every commit is ideally a viable rollback
position.
• With a good branching strategy, this is
less important as each branch creates
an ideal rollback position.
• Frequent commits keeps merges small and
manageable.
© 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 5
Verify your changes
before committing
• Use a different tool to inspect all
your changes to make sure you
are only committing what you
intend.
• Verifying your changes before
committing also helps to avoid
accidentally checking in changes
you meant to revert.
© 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 6
Build and test before every
commit
• It should be reasonably safe to rollback
to any commit, so ensure it builds and
tests pass.
• Thus a commit should not have code in
an incomplete state.
• While unit tests should be run constantly,
you should only need to run integration /
end-to-end tests before a push.
© 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 7
Branch.. Branch.. Branch..
• Most features – or important bug fixes – should be their own branch.
• You should NEVER work on the default / head / master branch.
• Branching isolates and insulates your work into clean, manageable
sections.
© 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 8
Commit messages are
your friend
• Always describe in detail what
changes you have made in a commit.
• Prefix every commit with a reference
to the story / bug ID.
• Commit messages allow everyone to
see at a glance what work has been
done, and is invaluable for historical
lookups.
© 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 9
Do not commit
generated artifacts
• Generated artifacts such as:
generated classes,
generated docs, compilation
output, etc.
• Use an ignore file to ensure
that these files are not
included.
© 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 10
Do commit dependencies
where applicable*
• Other developers should not have to
manually install dependencies to get your
code to run.
• The build machine also needs access to
the dependencies.
*Unless your system uses a dependency
management system (such as Maven or
Bower).
© 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 11
Version your database
• Whatever commit someone is at, their
database should be in sync with those
code changes.
• e.g. The code you pull references
a new column in the database;
this code will fail if the database
schema hasn’t been updated with
that new column.
• Automate revisions, “revision” table to
track DB state, etc.
© 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 12
Source control is your safety
net. Use it!
• You always have a place to revert to, so
don’t be afraid to play around with an idea.
• You always have the code history so never
comment out code you don’t need – just
delete it.
• Always use the repository tools for
moving/renaming/etc.; otherwise, you risk
losing the history.
© 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc.
About Intelliware Development Inc.
Intelliware is a custom software, mobile solutions and product development
company headquartered in Toronto, Canada. Intelliware is a leader in Agile
software development practices which ensure the delivery of timely high quality
solutions for clients. Intelliware is engaged as a technical partner by a wide
range of organizations in sectors that span Financial Services, Healthcare, ICT,
Retail, Manufacturing and Government.
/company/intelliware-development-inc-
/intelliware.inc
/intelliware_inc
/GooglePlusIntelliware
/www.intelliware.com
13
© 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc.
Learn more about Agile in our Agile Methodology Series
14

More Related Content

More from Intelliware Development Inc.

The HL7 Games: Catching FHIR - Healthcare Standards after v3
The HL7 Games: Catching FHIR - Healthcare Standards after v3The HL7 Games: Catching FHIR - Healthcare Standards after v3
The HL7 Games: Catching FHIR - Healthcare Standards after v3
Intelliware Development Inc.
 

More from Intelliware Development Inc. (16)

Agile Story Writing
Agile Story WritingAgile Story Writing
Agile Story Writing
 
7 Myths of Agile Development
7 Myths of Agile Development7 Myths of Agile Development
7 Myths of Agile Development
 
What is Agile Development?
What is Agile Development?What is Agile Development?
What is Agile Development?
 
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...
Enterprise Wearables: Wearing Our Parts On Our Sleeves - How Wearable Technol...
 
Agile Testing
Agile Testing  Agile Testing
Agile Testing
 
UX – A Way of Thinking, Lessons from the Real World
UX – A Way of Thinking, Lessons from the Real WorldUX – A Way of Thinking, Lessons from the Real World
UX – A Way of Thinking, Lessons from the Real World
 
Everyone can learn to code: a starter's guide to software development
Everyone can learn to code: a starter's guide to software developmentEveryone can learn to code: a starter's guide to software development
Everyone can learn to code: a starter's guide to software development
 
The HL7 Games: Catching FHIR - Healthcare Standards after v3
The HL7 Games: Catching FHIR - Healthcare Standards after v3The HL7 Games: Catching FHIR - Healthcare Standards after v3
The HL7 Games: Catching FHIR - Healthcare Standards after v3
 
21 Compelling Software Development Facts & Figures: Software Stats
21 Compelling Software Development Facts & Figures: Software Stats21 Compelling Software Development Facts & Figures: Software Stats
21 Compelling Software Development Facts & Figures: Software Stats
 
Agile Room Dynamics
Agile Room Dynamics   Agile Room Dynamics
Agile Room Dynamics
 
Canadian Healthcare Codes and Terminology Standards
Canadian Healthcare Codes and Terminology StandardsCanadian Healthcare Codes and Terminology Standards
Canadian Healthcare Codes and Terminology Standards
 
Agile Story Writing
Agile Story WritingAgile Story Writing
Agile Story Writing
 
Agile Release & Iteration Planning
Agile Release & Iteration Planning   Agile Release & Iteration Planning
Agile Release & Iteration Planning
 
Agile Estimating
Agile Estimating Agile Estimating
Agile Estimating
 
2012 Toronto Liferay Roadshow - Mobilizing Your Enterprise
2012 Toronto Liferay Roadshow - Mobilizing Your Enterprise2012 Toronto Liferay Roadshow - Mobilizing Your Enterprise
2012 Toronto Liferay Roadshow - Mobilizing Your Enterprise
 
Web accessibility for municipalities - How to meet compliance requirements an...
Web accessibility for municipalities - How to meet compliance requirements an...Web accessibility for municipalities - How to meet compliance requirements an...
Web accessibility for municipalities - How to meet compliance requirements an...
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Source/Version Control: Best Practices in Agile

  • 1. Source / Version Control: Best Practices in Agile © 2015 Intelliware Development Inc.
  • 2. Introduction As the Agile Alliance states, “Version control is not strictly speaking an Agile "practice", insofar as it is now (fortunately) widespread in the industry as a whole. It must however be mentioned…for several reasons: • Though they are rare, one still occasionally stumbles across teams with outdated version control tools or practices, and even teams who haven't adopted version control tools at all • Version control is not merely "good practice" but an enabler of a number of Agile practices, such as continuous integration • The Agile community leans toward particular types of tools and practices, namely the same as the Open Source community: systems that afford concurrent work ("merge" model rather than "lock"), and more recently favoring distributed over centralized models • It is therefore beneficial for an Agile team to explicitly reflect on its version control policies and infrastructure, and ensure that they and its engineering practices work harmoniously together Here are our top 10 best practices for Source Control. 2See more at: http://guide.agilealliance.org/guide/versioncontrol.html#sthash.Zh3h1ijE.dpuf© 2015 Intelliware Development Inc.
  • 3. © 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 3 If it’s not in source control, it doesn’t exist! • Code sitting on your machine is of no value to anyone else. • Code sitting on your machine can be lost. • It is typically recommended to always push your code before the end of your work day.
  • 4. © 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 4 Commit often • A commit, or "revision", is an individual change to a file (or set of files). • Commits should be a logical – usually small – grouping of changes. • Every commit is ideally a viable rollback position. • With a good branching strategy, this is less important as each branch creates an ideal rollback position. • Frequent commits keeps merges small and manageable.
  • 5. © 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 5 Verify your changes before committing • Use a different tool to inspect all your changes to make sure you are only committing what you intend. • Verifying your changes before committing also helps to avoid accidentally checking in changes you meant to revert.
  • 6. © 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 6 Build and test before every commit • It should be reasonably safe to rollback to any commit, so ensure it builds and tests pass. • Thus a commit should not have code in an incomplete state. • While unit tests should be run constantly, you should only need to run integration / end-to-end tests before a push.
  • 7. © 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 7 Branch.. Branch.. Branch.. • Most features – or important bug fixes – should be their own branch. • You should NEVER work on the default / head / master branch. • Branching isolates and insulates your work into clean, manageable sections.
  • 8. © 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 8 Commit messages are your friend • Always describe in detail what changes you have made in a commit. • Prefix every commit with a reference to the story / bug ID. • Commit messages allow everyone to see at a glance what work has been done, and is invaluable for historical lookups.
  • 9. © 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 9 Do not commit generated artifacts • Generated artifacts such as: generated classes, generated docs, compilation output, etc. • Use an ignore file to ensure that these files are not included.
  • 10. © 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 10 Do commit dependencies where applicable* • Other developers should not have to manually install dependencies to get your code to run. • The build machine also needs access to the dependencies. *Unless your system uses a dependency management system (such as Maven or Bower).
  • 11. © 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 11 Version your database • Whatever commit someone is at, their database should be in sync with those code changes. • e.g. The code you pull references a new column in the database; this code will fail if the database schema hasn’t been updated with that new column. • Automate revisions, “revision” table to track DB state, etc.
  • 12. © 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. 12 Source control is your safety net. Use it! • You always have a place to revert to, so don’t be afraid to play around with an idea. • You always have the code history so never comment out code you don’t need – just delete it. • Always use the repository tools for moving/renaming/etc.; otherwise, you risk losing the history.
  • 13. © 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. About Intelliware Development Inc. Intelliware is a custom software, mobile solutions and product development company headquartered in Toronto, Canada. Intelliware is a leader in Agile software development practices which ensure the delivery of timely high quality solutions for clients. Intelliware is engaged as a technical partner by a wide range of organizations in sectors that span Financial Services, Healthcare, ICT, Retail, Manufacturing and Government. /company/intelliware-development-inc- /intelliware.inc /intelliware_inc /GooglePlusIntelliware /www.intelliware.com 13
  • 14. © 2013 Intelliware Development Inc.© 2015 Intelliware Development Inc. Learn more about Agile in our Agile Methodology Series 14