Skip to Content
Googleのソフトウェアエンジニアリング ―持続可能なプログラミングを支える技術、文化、プロセス
book

Googleのソフトウェアエンジニアリング ―持続可能なプログラミングを支える技術、文化、プロセス

by Titus Winters, Tom Manshreck, Hyrum Wright, 竹辺 靖昭, 久富木 隆一
November 2021
Intermediate to advanced
684 pages
10h 37m
Japanese
O'Reilly Japan, Inc.
Content preview from Googleのソフトウェアエンジニアリング ―持続可能なプログラミングを支える技術、文化、プロセス

12章ユニットテスト

Erik Kuefler 著

Tom Manshreck 編

 前章では、Googleがテストを分類する際に沿う2つの主要な軸としての規模範囲を紹介した。要点を繰り返すと、規模が指すのは、テストにより消費されるリソースならびにテストが実行を許可されている内容であり、範囲が指すのは、テストが検証を意図するコードの量である。テスト規模についてはGoogleは明確な基準を持つが、それに比べテスト範囲はやや曖昧となりがちである。我々はユニットテストという用語を、単一のクラスまたはメソッドのような相対的に狭い範囲のテストを指すのに用いる。通常ユニットテストは小規模だが、そうでないこともある。

 バグの防止に続く、テストの最重要目的は、エンジニアの生産性の改善である。より範囲の広いテストに比べ、ユニットテストは、生産性の最適化のための優れた手段となるのに適した属性を多く備える。

  • Googleのテスト規模の定義によれば、ユニットテストは規模が小さい傾向がある。小テストは高速で決定性であり、開発者が自分のワークフローの一部として頻繁に実行でき、フィードバックを直ちに得られる。
  • ユニットテストは、テスト対象コードと同時に書くのが容易な傾向がある。それによりエンジニアは、より大規模なシステムを構成して理解する必要なしに、作業中のコードにテスト対象を絞れる。
  • ユニットテストは素早く簡単に書けるので、テストカバレッジが高水準となることが促進される。テストカバレッジが高いと、エンジニアは、自分のコード変更により壊れるものはないという自信を持って変更を行える。
  • ユニットテストは、テスト失敗時に何が間違っていたかを理解しやすい傾向がある。それは、各テストの内容であるコードが、ユニットテストという概念に内在する性質上、単純であり、かつシステムの特定部分に対象を絞っているからである。 ...
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

サイトリライアビリティワークブック ―SREの実践方法

サイトリライアビリティワークブック ―SREの実践方法

Betsy Beyer, Niall Richard Murphy, David K. Rensin, Kent Kawahara, Stephen Thorne, 澤田 武男, 関根 達夫, 細川 一茂, 矢吹 大輔, 玉川 竜司
初めてのSQL 第3版

初めてのSQL 第3版

Alan Beaulieu, 株式会社クイープ
プログラミングRust

プログラミングRust

Jim Blandy, Jason Orendorff, 中田 秀基
仕事ではじめる機械学習 第2版

仕事ではじめる機械学習 第2版

有賀 康顕, 中山 心太, 西林 孝

Publisher Resources

ISBN: 9784873119656Other