Skip to Content
Pythonによるテスト駆動開発, 3rd Edition
book

Pythonによるテスト駆動開発, 3rd Edition

by Harry Percival
October 2025
Intermediate to advanced
712 pages
9h 46m
Japanese
O'Reilly Media, Inc.
Content preview from Pythonによるテスト駆動開発, 3rd Edition

第4部 テストのより 高度な話題

「えっ、また別のセクション?ハリー、もう疲れたよ。 もう400ページも読んだんだ。本の別のセクションなんて 到底無理だ。特に『上級』という呼び出しならなおさらだ… もしかして飛ばしちゃっても大丈夫かな?」

いや、飛ばせないぞ!これは「上級」セクションという呼び出しはされているが、テスト駆動開発(TDD)とウェブ開発にとって本当に重要なトピックが詰まっている。絶対に飛ばせない。むしろ、最初の二つのセクションよりもさらに重要性が高い

まず最初に、ウェブ開発の必要不可欠な要素であるJavaScriptについて掘り下げる。 別の言語でTDDがどう機能するかを見ることで、全く新しい視点が得られる。

ここで重要なテクニック「スパイク」について話す。 これはTDDの厳格な規則を緩め、探索的なハックを許容するテクニックだ。

ヒント

TDDへのよくある反論は「何をするかも分からないのに、どうやってテストを書けというのか?」だ。 スパイク作業こそが、試行錯誤して理解を深める段階だ。 そうすれば後でテストファーストに戻って実行できる。

サードパーティシステムの統合方法とテスト手法について議論する。Pythonテストの世界では避けがたいモックについても扱う。1

テストフィクスチャやサーバ側デバッグ、継続的インテグレーション(CI)環境の構築についても説明する。 これらはどれも、プロジェクトにとって「あれば便利」なオプション機能や贅沢品ではない。 どれも不可欠なものだ!

このセクションでは、どうしても学習曲線が少し急になる。 内容を理解するまでに何度か読み取り直す必要があるかもしれないし、 最初はうまくいかず、自分でデバッグする必要があるかもしれない。 あるいは、発見として、内容が最初の読み取りで理解できないまま、 二度目の読み取りでようやく理解できるということもあるかもしれない。

でも、どうか諦めずに続けてほしい! 難しいほどやりがいがあるだろ? それに、行き詰まったらいつでも助けるからな。 obeythetestinggoat@gmail.com までメールをくれ。

さあ、これからが本番だ。最高の体験が待っているぞ!

1不可能ではない!『Cosmic Python』という本にはモックを使わないテストのコツが載っている。著者の少なくとも一人は非常に賢い人物だと私は知っている。

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

イーサリアムをマスターする, 2nd Edition

イーサリアムをマスターする, 2nd Edition

Carlo Parisi, Alessandro Mazza, Niccolo Pozzolini, Gavin Wood, Andreas M. Antonopoulos
Excel用Python

Excel用Python

Felix Zumstein

Publisher Resources

ISBN: 0642572274771