2006-01-01から1ヶ月間の記事一覧

Unit Test More Efficiently with Mock Object Alternatives

The mock-object testing pattern has commonly been used to test an individual unit of code without testing its dependencies. While this pattern works well for interaction-based testing, it can be overkill for state-based testing. Learn how …

モック、スタブ、擬似オブジェクトを使った効率的なユニットテスト1

When you're unit testing, you often want to test an individual unit of code without testing its dependencies. One common solution to this problem is to utilize the mock-object testing pattern. Though the mock-objects pattern can lead to a …

モック、スタブ、擬似オブジェクトを使った効率的なユニットテスト2

Mock Objects モックオブジェクト The idea behind the mock object pattern is that you pass a phony object (the mock object) into a method that is being tested. The method must accept an abstract class or interface as its parameter, and the p…

モック、スタブ、擬似オブジェクトを使った効率的なユニットテスト3

Pseudo Objects 擬似オブジェクト Here's a scenario where mock objects may be a bit of overkill. Suppose you're going to test a method, and the path you're going to test shouldn't reference a particular object that is passed into the method …

モック、スタブ、擬似オブジェクトを使った効率的なユニットテスト4

Passing in Mocks and Pseudos モックと擬似オブジェクトでテストをパスする It's often difficult to test methods that are responsible for their own object creation. If a method is responsible for creating the objects that it uses, then the met…

Unit Test More Efficiently with Mock Object Alternatives