Introduction of Continuous Integration (CI)
* Try to answer questions from developers, testers, team leaders, and managers.
* The topology and features of CI.
* How can CI reduce risks?
2. Questions
• To developers: Do all the software components
work together if you commit this code?
• To testers: Were all the tests successful after
the latest change? How long did you spend on
those tests?
• To team leader: Were there any problems with
the last development? When did you get the
report?
• To managers: What’s the level of confidence in
your team's capability to deliver working
software.
3. What’s
Continuous Integration (CI)
• A software development practice where
members of a team integrate their work
frequently.
• Each integration is verified by an automated
build to detect integration errors as quickly as
possible.
• This approach leads to significantly reduced
integration problems and allows a team to
develop cohesive software more rapidly.
5. Features of CI
• By performing automated and continuous
compilation, database integration, testing,
inspection, deployment, and feedback, your CI
system can reduce common risks on your project,
thus leading to better confidence and improved
communication.
• “Build” is a set of activities performed to generate,
test, inspect, and deploy software.
• Private/system build
• Integration build
• Release build
6. Testing (Dynamic Analysis)
• Automate unit tests
• Automate component tests
• Automate system tests
• Automate functional tests
• Categorize developer tests
• Run faster tests first
• Write tests for defects
• Make component tests repeatable
• Limit test cases to one assert
13. Deployment
• Produce a clean environment
• Release working software any time, any place
• Run all tests
• Possess capability to roll back release
• Label a repository's assets
• Label each build
• Create build feedback reports
14. Feedback
• Getting the right information to the right
people at the right time and in the right way.
• Right Information - Build Status, Inspection
Reports, Test Results.
• Right People - Project Manager, Build Master,
Technical Lead, Developer, Business Analyst.
• Right Time - When Problem Occurs Daily,
Weekly.
• Right Way - E-mail, SMS, RSS, Sound/Light,
Browser plug-in, Instant Messenger, Widgets.
15. Practices of CI
• Write automated developer tests
• Run private builds
• Commit code frequently
• Don’t commit broken code
• Avoid getting broken code
• Fix broken builds immediately
• All tests and inspections must pass
16. CI Tools
• CI tools/product
• Build scripting
• Version control
• Database
• Testing
• Automated inspection
• Deployment
• Feedback
• Documentation
17. Reducing Risks Using CI
• Risk is the potential for a problem to occur.
• Lack of Deployable Software
• Late Discovery of Defects
• Low-quality Software
• Lack of Project Visibility
18. “It Works on My Machine”
• Eliminating tight coupling between IDE and
build processes
• Use a separate machine solely for integration.
• Ensure that everything to build the software is
contained in the version control repository.
• Create a CI system to run the project build
script when it detects a change to the
repository.
19. Not Synching with Database
• Database is not a separate entity from
development
• Place all database artifacts in your version
control repository.
• Rebuild the database and data from the build
script.
• Test (and inspect) database with database-
specific tests.
20. A Missing Click on Deployment
• Automate deployment process
• Add deployment steps in the build scripts.
• Run the build script continuously whenever a
change to the version control repository is
applied.
21. Part-Regression Testing
• Automate regression testing
• Write unit and component tests.
• Write unit tests for the code that was changed,
based on defects.
• Configure the build script to run all the unit
tests and publish a report for every build.
• Tests are executed at every checkin to the
version control repository.
22. “Oops!
Something Is Not Tested”
• Adopt Code coverage tools
• Run a code coverage tool as a part of CI build
script when there is a change of version
control repository.
23. “Did You Get the Memo?”
• Automatic communication
• Configure CI server with the automated
mechanism that notify affected parties when a
build fails.
24. Inability to Visualize Software
• Always have an up-to-date view
• Generate UML diagrams of the design
automatically.
• Generator documents of source code
automatically.
25. Coding Standard Not Followed
• Find out any violations of the coding standard
• A one-page annotated class that contained all
of the coding standards.
• Enforce the coding standard by using
automated inspection tools as a part of the
build scripts.
26. Project Becomes a “Big Ball of Mud”
• Continually monitor the software architecture
• Add automated inspection tools to assess
adherence to the project’s architectural
standards.
• Run a tool such as this with every integration
build.
27. Duplicate Code
• Continually monitor and reduce code
duplication
• Analyze the code using a code duplication
analyzer.
• Reduce the duplicated code by refactoring the
code into a single method or component.
• Run code duplication inspections continuously
in CI system.
28. Value of CI
• Reduce risks
• Reduce repetitive manual processes
• Generate deployable software at any time and
at any place
• Enable better project visibility
• Establish greater confidence in the software
product from the development team