Skip to Content
テスト駆動開発を学ぶ
book

テスト駆動開発を学ぶ

by Saleem Siddiqui
May 2025
Intermediate to advanced
280 pages
3h 35m
Japanese
O'Reilly Media, Inc.
Content preview from テスト駆動開発を学ぶ

第13章 継続的インテグレーション 継続的インテグレーション

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

継続的インテグレーションの原則は、テストにも適用される。テストもまた、開発プロセスにおける継続的な活動であるべきだ。

グレイディ・ブーチ他『オブジェクト指向分析と設計と応用』(アディソン・ウェスリー、2007年)

継続的インテグレーションによって、あなたのソフトウェアは、(十分に包括的な自動テストセットを前提として)新しい変更のたびに動作することが証明される。

Jez Humble and David Farley,Continuous Delivery(Addison-Wesley, 2010).

ソフトウェア・エントロピーとは、熱力学におけるエントロピーと同様、あるシステムにおける無秩序の度合いが時間とともに増加する傾向にあるという原則である。 熱力学の第二法則がそれを禁じている。ソフトウェアのエントロピーを食い止める方法はあるのだろうか?

コード・カオスの破滅的影響に対する現在の最善の防御策は、継続的デリバリ(CD)である。この言葉はアジャイルマニフェストの最初の原則に由来しており、「価値あるソフトウェアの早期かつ継続的デリバリ」による顧客満足を最優先事項としている。

アジャイルマニフェストより10年ほど前に作られた関連用語に、継続的インテグレーション(CI)がある。複数の開発者がいるチームでは、コードの確実な統合はさらに不可欠であり、したがって頻繁に行われるべきである。1

継続的インテグレーションが存在するためには、自動テストがなければならない。 そうでなければ、新しい変更が既存のコードと「継続的インテグレーション」されたことをどうやって知ることができるだろうか?この点は、繰り返し強調すべき重要な点である。

重要

自動テストなくして継続的インテグレーションはありえない。

これまで書いてきた単体テストからさらに価値を引き出すために、継続的インテグレーション・ビルド・プロセスの一部として実行することができる。これには、さまざまなツールを使うことができる。この最終章では、GitHub Actions を使って継続的インテグレーションサーバーをセットアップする。

コア概念

継続的インテグレーションは、継続的デプロイへと進化し、継続的デリバリで頂点に達する、ソフトウェア成熟度( )連続体における最初のフェーズである。 したがって、CIは継続的デリバリへの最初の進化ステップである。

図13-1に継続的インテグレーション、デプロイ、デリバリ(CI/CD)の一般化の概要を示す。

This is a detailed diagram showing continuous integration, continuous deployment, and continuous delivery as three different evolutionary layers. Continuous integration is the top layer. It includes steps such as checking out source code from the version control system; compiling it once; running the tests; creating artifacts such as binary files, documentation, and seed data; storing these artifacts in an artifact repository; and generating reports on the success or failure of each step. Since multiple developers commit code regularly to the version control system, the build server polls the version control system more or less continuously (in practice, once every few minutes or so). Any changes in the version control system trigger the CI steps. The next evolutionary layer is continuous deployment. Its steps include validating deployment environments; validating, approving, and deploying artifacts; updating data; running post-deployment tests; and reporting on the success or failures of each step. In continuous deployment, the target is one or more non-production environments. The last evolutionary layer is continuous delivery. Its steps include validating the production environment; validating and deploying artifacts; updating data; running tests in production; switching over users, including live sessions, by using strategies like blue-green deployments or canary releases; and reporting on the success or failure of each step. The primary difference between continuous deployment and continuous delivery is that the latter targets the production environment.
図13-1. 継続的インテグレーションと継続的デプロイは、継続的デリバリの進化的前駆体である。

バージョン管理

継続的インテグレーションでは、ソフトウェアのビルドに必要なすべてのコードをバージョン管理システムに保存する必要がある。

バージョン管理システムは、少なくとも以下の機能を提供しなければならない:

  1. ファイルやフォルダの現在(最新)のリビジョンを、任意の構造と深さで保存する。

  2. これらのファイルやフォルダを、単にバラバラの要素としてではなく、統一された「リポジトリ」の下に保管する。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

はじめての知識グラフ構築ガイド

はじめての知識グラフ構築ガイド

Jesus Barrasa, Jim Webber
エンジニアが学ぶ会計システムの「知識」と「技術」

エンジニアが学ぶ会計システムの「知識」と「技術」

広川 敬祐, 五島 伸二, 小田 恭彦, 大塚 晃, 川勝 健司
ユーザーストーリーマッピング

ユーザーストーリーマッピング

Jeff Patton, 川口 恭伸, 長尾 高弘
初めてのGraphQL ―Webサービスを作って学ぶ新世代API

初めてのGraphQL ―Webサービスを作って学ぶ新世代API

Eve Porcello, Alex Banks, 尾崎 沙耶, あんどうやすし

Publisher Resources

ISBN: 9798341650992