22
継続的テスト入門 株式会社アイテマン 久保敦啓 [email protected] 2011/07/22 1 回 関西 PHP 勉強会

Introduction to Continuous Testing

Embed Size (px)

DESCRIPTION

This presentation describes introduction to Continuous Testing for PHP.

Citation preview

Page 1: Introduction to Continuous Testing

継続的テスト入門

株式会社アイテマン久保敦啓[email protected]

2011/07/22第 1回 関西 PHP勉強会

Page 2: Introduction to Continuous Testing

iteman

株式会社アイテマン 代表取締役

Piece Projectプロジェクトリード

Twitter @iteman

師匠承ります オブジェクト指向 テスト駆動開発 継続的テスト DSL

Page 3: Introduction to Continuous Testing

Piece Framework

PHPのアプリケーションフレームワーク

オープンソースソフトウェア New BSD License Eclipse Public License

Piece Project 開発者募集中 スポンサー募集中

Page 4: Introduction to Continuous Testing

Piece Frameworkの歴史

2005 Stagehand_TestRunner

2006 Piece_Unity, Piece_Flow

2009 MakeGood

2011 ???

Page 5: Introduction to Continuous Testing

アジェンダ

継続的テストとは?

継続的テストをサポートするツール

デモ

質疑応答

Page 6: Introduction to Continuous Testing

継続的テスト

Continuous  Testing

Day 61 ­ Watering tulips By Mournehttp://www.flickr.com/photos/mourner/3552724584

Page 7: Introduction to Continuous Testing

継続的テストとは?

バックグラウンドで継続的にテストを実行する。

ファイルを変更するたびにテストを実行する。

素早いフィードバック!

Page 8: Introduction to Continuous Testing

初出

2004年 MITの David Saff氏らによる

継続的テストの対照実験に基づく論文

継続的コンパイルにインスパイア

(Continuous Compilation)

Page 9: Introduction to Continuous Testing

実験結果は…

継続的テストを行なった開発者はそうで

ない開発者よりも、期限の前にタスクを

完了した人が3 倍多かった。

継続的テストはテストに関連する

92­98% の無駄な時間を削減した。

Page 10: Introduction to Continuous Testing

継続的テストの効果

少ないオーバーヘッド

不具合の早期発見

テスト駆動開発の良い習慣の促進

Page 11: Introduction to Continuous Testing

少ないオーバーヘッド

継続的テストの最も明らかな効果

手動によるテスト実行時間を節約!

ツールが非常に重要な役割を果たす。

Page 12: Introduction to Continuous Testing

手動でテストを実行すると…

テスト実行の準備に数秒 テスト実行に数秒 結果の確認に数秒 失敗箇所の特定に数秒 エディタを開くまでに数秒

Galley Slaves By ChibiJoshhttp://www.flickr.com/photos/chibijosh/17867308

Page 13: Introduction to Continuous Testing

手動でテストを実行すると…

実行に10 秒かかり、

1時間に50 回テストを実行し、

年1000 時間プログラミングすると、

年間139 時間が無駄に費やされる。

Page 14: Introduction to Continuous Testing

不具合の早期発見

継続的テストはエラーの混入と検出の間

の間隔を短くさせる。

予期しない失敗は解決に時間がかかる。

継続的テストは予期しない失敗をすぐに

見つける。

Page 15: Introduction to Continuous Testing

テスト駆動開発の良い習慣の促進

ファイルを変更するたびにテストを実行

すると TDDの道から逸れにくくなる。

デバッグに頼らずに、動作するコードを

書きやすくなる。 (自然な TDDの導入 )

エラーの範囲が明確なので理解が簡単に

なる。 (遅いテストの対策にもなる。 )

インクリメンタル開発のメリットの享受

Page 16: Introduction to Continuous Testing

ツール

toolbox By dipster1http://www.flickr.com/photos/dipster1/1403240351

Page 17: Introduction to Continuous Testing

継続的テストをサポートするツール

Infinitest ­ Java

JUnit Max – Java, Kent Beck

autotest(ZenTest) – Ruby

Stagehand_TestRunner – PHP MakeGood – PHP

Page 18: Introduction to Continuous Testing

Stagehand_TestRunner

Page 19: Introduction to Continuous Testing

MakeGood

Page 20: Introduction to Continuous Testing

継続的インテグレーションツールは?

Page 21: Introduction to Continuous Testing

まとめ

継続的テストは開発速度を向上させる。

良いツールを使うことが重要である。 MakeGood, Stagehand_TestRunner 新プロダクトを計画中!

継続的テストを日常とし、より良い

プログラマーを目指すべし。

Page 22: Introduction to Continuous Testing

David Saff, Michael D. Ernst, An experimental evaluation of continuous testing during development, In ISSTA 2004, Proceedings of the 2004 International Symposium on Software Testing and Analysis, (Boston, MA, USA), July 12­14, 2004, pp. 76­85.

http://groups.csail.mit.edu/pag/pubs/David­Saff.html

Ben Rady, Continuous Testing Explained, 2007, Object Mentor Blog,

http://blog.objectmentor.com/articles/2007/09/20/continuous­testing­explained

Kent Beck, The Economic Case for JUnit Max, 2010, Three Rivers Institute,

http://www.threeriversinstitute.org/blog/?p=553

参考