How Google Tests Software - Part Threeを訳してみた

How Google Tests Software - Part Three
Wednesday, February 16, 2011 2:47 AM

By James Whittaker

Lots of questions in the comments to the last two posts. I am not ignoring them. Hopefully many of them will be answered here and in following posts. I am just getting started on this topic.

Google Testing Blog: How Google Tests Software - Part Three

(略)

At Google, quality is not equal to test. Yes I am sure that is true elsewhere too. “Quality cannot be tested in” is so cliché it has to be true. From automobiles to software if it isn’t built right in the first place then it is never going to be right. Ask any car company that has ever had to do a mass recall how expensive it is to bolt on quality after-the-fact.

Googleでは、品質はテストとイコールではない。それは、他のどこへいっても同じはずだ。“品質はテストに依るべきではない”は古い決まり文句だが、今でもそうであるべきだ。自動車からソフトウェアまで、もし最初に間違って組み立ててしまえば、もう正しい形になることはないだろう。事後に品質を組み込むことがどれだけ高くつくかは、過去大量のリコールを出したことのある自動車会社に聞いてみるといいだろう。

However, this is neither as simple nor as accurate as it sounds. While it is true that quality cannot be tested in, it is equally evident that without testing it is impossible to develop anything of quality. How does one decide if what you built is high quality without testing it?

けれども、これはそんな単純なものでもないし、そのまま適用できるものでもない。品質はテストに依るものではない、というのは正しいが、テストすることなしに品質を作りこむことはできないということも同様に明らかでだろう。あなたが作ったものは高品質であると、誰がテストせずに言い切れるでしょうか?

The simple solution to this conundrum is to stop treating development and test as separate disciplines. Testing and development go hand in hand. Code a little and test what you built. Then code some more and test some more. Better yet, plan the tests while you code or even before. Test isn’t a separate practice, it’s part and parcel of the development process itself. Quality is not equal to test; it is achieved by putting development and testing into a blender and mixing them until one is indistinguishable from the other.

この難問に対するシンプルな解決策は、開発とテストを別々の分野として扱うことをやめることです。テストと開発が手をつないで行く。少しコーディングしたら、少しテストする。もう少しコードを書いたら、もう少しテストする。いっそのこと、コードを書きながらか、または書く前にテストを計画してしまいます。テストはプラクティスから分離したものではなく、開発プロセスの一部なのです。品質は、テストをすることではない、これは、開発とテストをミキサーにかけて、区別がつかないまで混ぜ込むことで、ようやく達成できます。

At Google this is exactly our goal: to merge development and testing so that you cannot do one without the other. Build a little and then test it. Build some more and test some more. The key here is who is doing the testing. Since the number of actual dedicated testers at Google is so disproportionately low, the only possible answer has to be the developer. Who better to do all that testing than the people doing the actual coding? Who better to find the bug than the person who wrote it? Who is more incentivized to avoid writing the bug in the first place? The reason Google can get by with so few dedicated testers is because developers own quality. In fact, teams that insist on having a large testing presence are generally assumed to be doing something wrong. Having too large a test team is a very strong sign that the code/test mix is out of balance. Adding more testers is not going to solve anything.

開発とテストが、お互いがなきゃならない状態になるまで融合すること。それはまさにGoogleにおけるゴールです。少し作って、すぐテストする。もう少し作って、またテストする。ここでのポイントは、誰がテストするか、です。Googleでは、純粋なテスターの人数は、不釣り合いなほど少ない。だから、唯一の選択肢は、開発者がテスターになることです。コードを書いた本人よりも良いテストを誰ができるかい?誰がコードを書いたやつよりもバグを見つけられるかい?バグを入れ込むことを防ぐのに、もっともいい位置にいるのは誰だい?Googleが少ないテスターでやっていけているのは、開発者自身の品質によります。もっと言えば、大規模なテストチームの存在を主張する場合は、大抵は何か間違ったことをしているでしょう。大規模なテストチームの存在自体が、コードとテストのバランスが崩れているという、とても大きなサインです。テスターを投入しても、何も解決しないのです。

This means that quality is more an act of prevention than it is detection. Quality is a development issue, not a testing issue. To the extent that we are able to embed testing practice inside development, we have created a process that is hyper incremental where mistakes can be rolled back if any one increment turns out to be too buggy. We’ve not only prevented a lot of customer issues, we have greatly reduced the number of testers necessary to ensure the absence of recall-class bugs. At Google, testing is aimed at determining how well this prevention method is working. TEs are constantly on the lookout for evidence that the SWE-SET combination of bug writers/preventers are screwed toward the latter and TEs raise alarms when that process seems out of whack.

これは、品質とは、検出よりも予防行為によってより保たれることを示している。開発にテストのプラクティスを持ち込める範囲においては、我々は、ハイパーインクリメンタルプロセスを作りました。そこでは、あるイテレーションの成果物が超buggyであった場合に、ロールバックすることができます。我々は、顧客の問題を避けるためだけをやっているわけではないので、リコールクラスのバグがないことだけを保証するようなテスターをかなり減らしてきた。Googleにおいては、テストの目的は、予防機能がちゃんと機能しているかを測ることへ向かっています。TEチームは、バグの埋め込み・予防のSWE-SETコンビネーションが、予防に向かってねじ込まれているか常に目を光らせて、プロセスの調子が悪そうならアラームを上げています。

Manifestations of this blending of development and testing are all over the place from code review notes asking ‘where are your tests?’ to posters in the bathrooms reminding developers about best testing practices, our infamous Testing On The Toilet guides. Testing must be an unavoidable aspect of development and the marriage of development and testing is where quality is achieved. SWEs are testers, SETs are testers and TEs are testers.

「where are your tests?」この開発とテストのブレンドというマニュフェストは、コードレビューのノートからトイレのポスターへ超えて、開発者に最適なテストプラクティスをリマインドしてくれる。私たちの忌まわしき「Testing On The Toilet guides」テストは開発の避けられない側面であり、開発との結婚でなければならず、そしてテストは品質が実現される場です。SWEはテスターであり、SETも、TEもはテスターなのです。

If your organization is also doing this blending, please share your successes and challenges with the rest of us. If not, then here is a change you can help your organization make: get developers fully vested in the quality equation. You know the old saying that chickens are happy to contribute to a bacon and egg breakfast but the pig is fully committed? Well, it's true...go oink at one of your developer and see if they oink back. If they start clucking, you have a problem.

あたなの組織が、すでにこのブレンドを実現しているなら、その成功と、私たちの残りの課題を共有させてください。もしそうでなくても、これは分岐点です。絶対的な品質の教育を受けた開発者を取得できるような・・・組織へとあなたが手助けできるはずです。
こんな古い話がありますね。「鶏たちは朝食のベーコン&エッグに喜んで卵を提供するだろうけど、はたして豚は納得するだろうか?」確かに、そうですね。あなたの開発者の一人にブーブー言ってみて、ブーブー返ってくるかやってみてください。もし彼らが鳴きはじめたら、何か問題があるのかもしれません。