alm: continuous integrationdownload.microsoft.com/.../continuous_integration_v21.pdfwhat is...
TRANSCRIPT
ALM: Continuous Integration
José Almeida, Microsoft
Agenda
What is CI?
Issues Addressed
CI Practices
Getting Started
About Continuous Integration
CI is the thread that ties development
practices together
What is Continuous Integration?
What is Continuous Integration?
GOAL:
Find errors as quickly as possible
And fix them as quickly as possible
It’s a software development pratice
Team members integrate frequently
Each integration is fully automated and verifiable
Automation
The CI Cycle
Publish
results Monitor Repository
Get latest changes
Validate
product
Build product
How Does CI Help SW Development?
How Does It Help?
By leveraging other development best practices:
• Correct source code management
• Self-validating code
• Adherence to coding standards
Common Issues in SW Development
Dependency issues
Code was built on a developer’s machine without the
latest version of it’s dependencies
Common Issues in SW Development
Dependency issues
Code traceability
It’s difficult to track the code that corresponds to the
binary currently deployed in the production environment
Common Issues in SW Development
Dependency issues
Code traceability
Regressions
A commit causes an error in a previously
working functionality
Common Issues in SW Development
Dependency issues
Code traceability
Regressions
Low coverage
All our tests pass but we’re still finding lots of
defects!
Common Issues in SW Development
Dependency issues
Code traceability
Regressions
Low coverage
Adherence to best-practicesWe found some issues with the version of
the code currently in production and it turns
out they’re documented best practices.
CI Practices
CI Practice
• Maintain a Single Source Repository
• Automate the Build
• Make Your Build Self-Testing
• Everyone Commits Every Day
• Every Commit Should Build the Mainline on an Integration Machine
• Keep the Build Fast
• Test in a Clone of the Production Environment
• Make it Easy For Anyone To Get The Latest Executable
• Everyone Can See What’s Happening
• Automate Deployment
Martin Fowler, “Continuous Integration”
The Repository
Single repository for all artifacts
• Code
• Scripts
• DB schemas
• Install scripts
Basic rule of thumb:
• Get a clean machine, plug it to the network,
download the latest sources and build the
product
The Build
Requires a degree of automation
VS project files are MSBuild scripts
Team Build wraps all project build scripts within a master script file
Advantages:
• Reduce/eliminate repetitive, manual and error-prone
tasks
• Free people for value-added tasks
• Increase integration frequency
Self-Validating Code
Unit Tests:
• Test specific aspects of a functionality
• Execute rapidly
• Independent of each other
• Independent of the surrounding environment
• Independent of execution order
• Automated
Ideal to be integrated into an automated Build
Self-Validating Code
Make your code self-validating by writing Unit Tests
Self-Validating Code
Don’t have the time?
Self-Validating Code
• Do you write a console or winforms app that
calls your methods?
• That’s a unit test!
• Place that code in a method decorated with
the [TestMethod] attribute in a test project
Getting Started
Getting Started With CI
Decide to add CI to your product
development
Establish a consistent use of a
single source repository
Setup your CI platform
Add other practices to your product
development (unit testing, code
analysis, etc.)
Summing Up
CI
Continuous Improvement
Quality
improvement
Automate integration
tasks
Reduce integration
time
Fewer errors
Integrate
more oftenContinuous
Improvement
Conclusion
CI is not only about integrating source code...
Conclusion
It’s about integrating best practices