翻訳と辞書
Words near each other
・ Hambury Tout
・ Hamby
・ Hamby Park
・ Hamby Shore
・ Hambye
・ Hambye Abbey
・ Hambühren
・ HAMC
・ Hamcearca
・ Hamchako
・ Hamchang Station
・ Hamchang-eup
・ Hamchoon
・ Hamchoon Women's Clinic
・ Hamchétou Maïga
Hamcrest
・ Hamd
・ Hamda Khamis
・ Hamdah
・ Hamdallah Mustawfi
・ Hamdallaye
・ Hamdallaye, Burkina Faso
・ Hamdallaye, Niger
・ Hamdam Foundation
・ Hamdamabad
・ Hamdamlu
・ Hamdamsaltaneh Pahlavi
・ Hamdan
・ Hamdan Al Abri
・ Hamdan Al Nahyan


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Hamcrest : ウィキペディア英語版
Hamcrest
Hamcrest is a framework that assists writing software tests in the Java programming language. It supports creating customized assertion matchers ('Hamcrest' is an anagram of 'matchers'), allowing match rules to be defined declaratively
. These matchers have uses in unit testing frameworks such as JUnit and jMock.
Hamcrest has been ported to Java, C++, Objective-C, Python, ActionScript 3, PHP, JavaScript, Erlang, and R.
==Rationale==

"First generation" unit test frameworks provide an 'assert' statement, allowing one to assert during a test that a particular condition must be true. If the condition is false, the test fails. For example:
assert(x == y);
But this syntax fails to produce a sufficiently good error message if 'x' and 'y' are not equal.
It would be better if the error message displayed the value of 'x' and 'y'.
To solve this problem, "second generation" unit test frameworks provide a family of assertion statements, which produce better error messages. For example,

assert_equal(x, y);
assert_not_equal(x, y);

But this leads to an explosion in the number of assertion macros, as the above set is expanded to support comparisons different from simple equality. So "third generation" unit test frameworks use a library such as Hamcrest to support an 'assert_that' operator that can be combined with 'matcher' objects, leading to syntax like this:

assert_that(x, equal_to(y))
assert_that(x, is_not(equal_to(y)))

The benefit is that you still get fluent error messages when the assertion fails, but now you have greater extensibility. It is now possible to define operations that take matchers as arguments and return them as results, leading to a grammar that can generate a huge number of possible matcher expressions from a small number of primitive matchers.
These higher-order matcher operations include logical connectives (and, or and not), and operations for iterating over collections.
This results in a rich matcher language which allows complex assertions over collections to be written in a declarative, rather than a procedural, programming style.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Hamcrest」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.