代写代考 Software Engineering I

Software Engineering I
Continuous Integration
Miguel Morales – Computer Science and Software Engineering Department

Copyright By PowCoder代写 加微信 powcoder

• Understand and remember the concept of continuous integration.
• Know some of the continuous integration best practices.
• Identify the most common issues in industry.

Continuous Integration is

Continuous Integration is
– …asoftwaredevelopmentpracticewheremembersofateamintegrate their work frequently.
– …eachintegrationisverifiedbyanautomatedbuild,includingtest,to detect integration errors as quickly as possible.
– …CIisnotautomatingthebuildandrunningtests.

Continuous Integration is
• A developer’s practice…
• … that requires a code repository
• … that keeps a working system growing
• … by small changes
• … by integrating at least daily
• … on the mainline
• … supported by a CI system
• … with lots of automated tests
https://insights.sei.cmu.edu/sei_blog/2014/12/security-in-continuous-integration.html

CI is a must
• Fixed length iterations
• Frequent feedback
• Adaptive planning
• Value-driven releases
• Continuous improvement
• Small teams
• Face-to-face communication
• Collaborative
• SCRUM, XP, TDD, …
https://insights.sei.cmu.edu/devops/2015/01/continuous-integration-in-devops-1.html

CI best practices in practice
1. Maintain a code repository.
2. Make it easy to get the latest deliverables.
– There should be a version control system for the project’s source code.
– All artifacts required to build the project should be placed in the repository.
– The system should be buildable from a fresh checkout and should not require additional dependencies.
http://rogerdudler.github.io/git-guide/

CI best practices in practice
3. Everyone commits to the baseline every day.
4. Every commit to baseline should be built.
– By committing, conflicts are quickly discovered and typically focus on a limited part of the system.
– Long-delayed integration may hide problems.
Doing daily builds is just like the most painful thing in the world. But it is the greatest thing in the world, because you get instant feedback [Cusumano, 1995].

CI best practices in practice
5. Keep the build fast.
6. Automate the build.
7. Make the build self-testing.
– A single command should have the capability of building the system.
– Running “all tests” in all builds is impractical.
http://galilsoftware.com/wp-content/uploads/2014/08/DilbertBIG.jpg
TDD cannot be taken seriously. Industry has made its choice: it is not broadly practicing this technique [Meyer, 2014].

CI best practices in practice
8. Everyone can see the results of the latest build.
9. Automate deployment.
– The build script is expected to run all tests automatically.
– The team gradually learn to adapt work processes to the feedback received from the build system.

CI best practices in practice 10. Test in a clone of the production environment.
– However, building a replica of a production environment is cost prohibitive.

CI best practices in practice 11. Branching should be minimized.
– All changes should preferably be integrated on trunk.
– Customers will typically demand that you support and fix bugs for old versions of the software.
https://backlogtool.com/git-guide/en/stepup/stepup1_5.html

Problems in CI and CD
Integration
http://www.sciencedirect.com/science/article/pii/S0950584916302324
• Large commits
• Long-running branches • Merge conflicts
• System modularization
• Unsuitable architecture
• Database schema changes
Ambiguous test results Time-consuming testing Flaky tests
Untestable code
• Customer data preservation
• Documentation
• Third party integration
• Deployment downtime Resources
• Lack of discipline
• Lack of motivation • Lack of experience • More pressure
• Insufficient hardware • Network latencies
• Complex build • Inflexible build
Which areas do you think reported more problems? Which are not so problematic?

Problems in CI and CD
Major failures are not often reported because of publication bias [Kitchenham, 2007].
http://www.sciencedirect.com/science/article/pii/S0950584916302324

Problems in CI and CD
http://www.sciencedirect.com/science/article/pii/S0950584916302324

CI best practices in practice At the beginning
18 months later…
1. Maintain a code repository
2. Make it easy to get the latest deliverables
3. Everyone commits to the baseline every day
4. Every commit to baseline should be built
5. Keep the build fast
6. Automate the build
7. Make the build self-testing
8. Everyone can see the results of the latest build
9. Automate deployment
10. Test in a clone of the production environment
11. Branching should be minimized
of the project…
B B A A C A F A+ A+
 A+  A – B
 C  B – C – A – F

Continuous integration is a practice — it is about what people do, not about what tools they use [ ].

Try & Avoid
– There is no “user guide” to continuously and effectively integrate software.
– In 2010, Larman and Vodde proposed several suggestions known as “Try and Avoid”.
– Let’s classify those suggestions into Try or Avoid.

What to avoid?
• ‘Solving’ organizational problems with technical solutions.
• Believing CI is a tool.
• Branching during development.
• Large batches of changes.
• Process preventing developers
from checking in.
• Treating test code differently than production code.
What to try?
• A mix between feature and component CI systems.
• CI in “one repository” across sites. • Cross-pollination.
• Every commit should build the mainline on an integration machine.
• Test in a clone of the production environment.
• Visual management with CI.

Conclusions
• CI is a developer’s practice.
• CI gives us frequent and valuable feedback.
• CI requires a lot of automatization.
• CI requires effort, experience and discipline.
• CI must be present in every project.
• CI is a “no pain, no gain”.
At least every competently managed project, has turned away from older “big bang” practices, and will never go back [Meyer, 2014].

Conclusions
The brilliant about agile… CI is an effective and truly inspiring practice [Meyer, 2014].

• Understand and remember the concept of continuous integration.
• Know some of the continuous integration best practices.
• Identify the most common issues in industry.

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com