Blog on Dan North & Associates Limited 10月02日
自动化构建与持续集成
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

自动化构建已成为敏捷开发的核心。每次开发者提交变更时,工具如Cruise Control会检出所有源代码,执行构建、运行所有单元测试并立即反馈。这一循环被称为持续集成,但更准确地说是持续构建。交付应用程序不仅是编写和测试软件,还包括在容器或应用服务器中运行代码,涉及操作系统、硬件、网络、防火墙等复杂集成。自动化集成测试能早期发现风险,减少部署生产环境时的意外。将生产环境部署自动化,能显著降低风险,提高部署质量,使发布日变得轻松。

🔧 自动化构建是敏捷开发的基础,每次提交代码都会自动构建和测试,确保代码质量,减少集成问题。

🛠️ 持续集成(CI)强调的是持续构建,而非仅仅集成代码,因为现代开发实践中,如结对编程已大大减少了传统集成带来的挑战。

🌐 应用级集成测试涉及将数据库、消息基础设施、外部服务等多种组件集成,是软件开发中风险较高的环节,需早期自动化测试。

📈 自动化集成测试能早期发现问题,随着项目演进逐步完善,降低生产环境部署风险,提高部署信心。

🚀 将生产环境部署自动化,能显著降低部署风险,提高部署质量,使发布日变得轻松,类似开发环境的部署流程。

Automated builds have become a cornerstone of agile development. Every time a developer checks in a change, a tool like Cruise Control checks out all the sources, builds everything, runs all the unit tests and reports back with immediate feedback. This cycle has become known as Continuous Integration, due to the seminal paper by Martin Fowler and Matt Foemmel, but this is something of a misnomer. It is better described as Continuous Build. (Their use of “integration” was about integrating all the bits of software that the various programmers in a team would traditionally be working on in isolation from one another, only to bring together and spend days or weeks getting to work. Practices such as pairing and automated builds have all but eliminated this form of integration hell, at least on agile projects.)

However, delivering an application is more than just writing and testing software. The code lives in a container or application server, which runs in an operating system, on hardware, on a network, behind a firewall, connected to other machines, services and components, which may themselves be inside containers or application servers, and so on across your application, across your enterprise and maybe out into the wide world to other enterprises and other servers.

Application-level integration is a complex beast. It involves gluing together all the components of an application such as databases, messaging infrastructure, external services, upstream and downstream feeds and third party dependencies.

Integration testing can be automated too#

This is where most of the risk and most of the surprises are as you move from development towards deployment into production. If you can test this integration early in your project and revisit it incrementally as your requirements and system evolve you will be in a much better position later on. Firstly you have proven that the pieces all fit together. Additionally you have now practiced integration and deployment a number of times, and automated the boring/repetitive/error-prone parts so you will be less fearful of it.

It is a testament to the success of automated builds that we even get to consider automatically verifying these infrastructure pieces. Of course there is independent value in having a continuous, automated build that assembles your code and tests it in isolation, as countless agile projects will attest. But don’t let the term “continuous integration” blind you to the fact that you can also automate integration proper and address one of the biggest risk areas in a software project early and incrementally.

Deploy to production like you deploy to development#

A nice corollary to automating integration and deployment of your application into a development environment is that it suddenly becomes much easier to deploy it into any environment. So why not share the love? My experiences in putting an application live and verifying that it is correctly deployed and working have traditionally been high-risk, high-stress, fingers-crossed occasions with heroic Ops guys working late into the night to fix the firewall / server / permissions / JDK version / DNS / user account / port numbers / router / you-name-it.

Imagine the quality of life and subsequent showering of small gifts that would accompany a fully-automated, fully-tested deployment process. To be fair, it does make release day something of an anticlimax, and you feel that you hardly deserve the curry or pizza for pitching up on a Saturday. (Let’s face it, you could have pressed the button from home; you know it’s going to work because you already validated the environment and you’ve deployed the app literally hundreds of times before.)


Colophon#

This article has been translated into Russian by Denis Oleynik.

Check out

Goalwards®

, our new business agility practice!

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

自动化构建 持续集成 集成测试 敏捷开发 生产部署
相关文章