Application Testing
アプリケーションのテスト

These samples are for testing your code which uses the Turbine framework. We take care not to involve testing Turbine itself, but more how to exercise your application code. If you are looking for unit tests of the Turbine source code itself, this is the incorrect document. These are testing techniques for applications implemented with Turbine. The samples and techniques use various frameworks such as JUnit, HttpUnit, and Cactus. A Reference section is provided with links to more information about the frameworks and techniques used in the sample code.

これらのサンプルは、Turbineフレームワークを使用したコードをテストするためのものです。Turbineそのもののテストに巻き込まないようにし、それよりもむしろ、どのようにアプリケーションコードを鍛錬するかにを気を配っています。もし、Turbineのソースコードそのもののユニットテストを期待しているならば、このドキュメントは適当ではありません。これらはTurbineを使って実装されたアプリケーションのテスト技法です。サンプルと技法では、JUnit、HttpUnit、Cactusなど、各種フレームワークを使用しています。リファレンスの項では、サンプルコードで使用されているフレームワークと技法に関する、より多くの情報へのリンクを提供しています。

This document is very much a work in progress as the sample tests are directly taken from our code we are currently developing. Hopefully this document will serve not only as a reference for starting to test your Turbine based applications, but a place to collect and document testing techniques the Turbine application developer may use.

このドキュメントは、サンプルのテストが現在開発中のコードを直接持ち込んでいるということで、まさに進行中の作業です。願わくは、このドキュメントを、Turbineに基づくアプリケーションのテストを始めるためのリファレンスとしてだけではなく、Turbineアプリケーション開発者が使用するであろうテスト技法を集めて記録する場としても提供したいと思います。

Extreme Programming breaks testing into two parts, Developer Tests, and Customer Tests. This document contains tips for both kinds of tests. Each one is slightly different so some explanation will be helpful. This is a very short, high level description of the test types. More detailed information may be found in the reference section.

エクストリームプログラミング(XP)では、テストを開発者テストとカスタマテストの2つのパートに分けています。このドキュメントは、両方のテストに対するヒント(Tips)を含んでいます。それぞれは、わずかに違うので、いくつかの説明が参考になるでしょう。これは非常に短く、高度なテスト形式の解説です。より詳しい情報は、リファレンスの項で見つけることができるでしょう。

Developer Tests are unit tests written by the developers as the production code is written. Another practice of Extreme Programming is Test-First Coding, where the test is written, fails, then the code is written to make it pass. Developer Tests can be thought of as white-box testing. Inspection of the state of the code in the unit under test is important in this type of testing. All Developer Tests must be running at 100%, no failures, at all times. JUnit is the framework used for these tests described here.

開発者テストは、製品コードを記述している途中での、開発者が記述したユニットのテストです。エクストリームプログラミング(XP)のもうひとつの手法は、テスト−ファーストコーディングです。そこではテストが記述され、失敗し、そしてテストに合格するようにコードを記述します。開発者テストは、ホワイトボックスのテストと考えることができます。テストするユニット内のコードの状態を検討することは、この種のテストにおいては重要なことです。すべての開発者テストが、常に、失敗することなく、100%実行されていなければなりません。JUnitは、ここに記述したテストに使用されるフレームワークです。

Customer Tests are more like black-box tests. They test that the feature ( user story in XP-speak ) is functioning properly. This type of test could also be thought of as end-to-end testing or system testing. If your application has a feature to generate a pdf report, a Customer Test may be: Given inputs x and y, the pdf should look like z. We've generally used HttpUnit to simulate the user-agent accessing our web applications and verify its output.

カスタマテストは、ブラックボックスのテストのようなものです。機構(XPでいうところのユーザストーリ)が正確に機能していることをテストします。この種のテストは、終端間のテスト、あるいはシステムテストとも考えることができます。もし、アプリケーションがpdfレポートを生成する機構を備えているとすると、カスタマテストは、xとyを入力すると、pdfはzのようになるはずである、というものでしょう。webアプリケーションにアクセスするユーザエージェントをシミュレートし、その出力を検証するために、通常はHttpUnitを使用しています。

Customer Testing
カスタマテスト

  • Sample: HttpUnit test case of a turbine application
    サンプル: TurbineアプリケーションのHttpUnitテストケース