|
MockServer is an open source mocking framework for HTTP and HTTPS released under the Apache License. MockServer is designed to simplify integration testing, by mocking HTTP and HTTPS system such as a web service or web site, and to decouple development teams, by allow a team to develop against a service that is not complete or is unstable. ==Simplify testing== MockServer simplifies automated testing and promotes best practices by improving the isolation of the system under test, simplifying test scenarios and improving encapsulation and separation of concerns in tests, as follows: * Mocking dependent systems is an effective mechanism to isolate the system under test to ensure tests run reliably and only fail when there is a genuine error, this avoids tests failing due to irrelevant external changes such as network failure or a server being rebooted / redeployed.〔(【引用サイトリンク】title=MockServer )〕 * In addition to test isolation mocking dependent system also allows the full range of responses and scenarios to be tested without having to set up and manage a complex test infrastructure. For example increased response delay or dropped connections can increase as load increases on a dependant system. To simulate these types of performance related degradation can be extremely difficult without with out generating a large volume of traffic. If the dependent system is mocked the mock can control the exact response delay or any other characteristics of each response.〔 * A common anti-pattern for automated tests is to record and replay real dependent service responses. These recordings are typically complex and shared between multiple tests. This, however, introduces unnecessary coupling between tests and breaks the Single responsibility principle, which, states that every context (class, function, variable, etc.) should define a single responsibility, and that responsibility should be entirely encapsulated by the context. Record and replay solutions also break down when the response changes. For example if a bookshop service is mocked by recording a response containing a list of 50 books, when the format for a book changes then the recorded response must be updated in 50 places. If a new response is recorded with the new format, most likely, the test assertions will need to be updated. In addition record and replay approaches hide the data being used in the test from the test code and therefore break encapsulation and separation of concerns. MockServer simplifies the mocking of responses for dependent systems by providing a simple API and client in multiple languages. Each test can then independently encapsulate the data and logic used for mock services, ensuring each test runs independently. In addition such an approach also reduces the time for a suite of test to complete because tests can run in parallel and do not share data.〔 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「MockServer」の詳細全文を読む スポンサード リンク
|