词条 | Test double |
释义 |
In computer programming and computer science, programmers and developers employ a technique called automated unit testing to enhance the quality of the software. Frequently, the final release software consists of a complex set of objects or procedures interacting together to create the final result. In automated unit testing, it may be necessary to use objects or procedures that look and behave like their release-intended counterparts, but are actually simplified versions that reduce the complexity and facilitate testing. A test double is a generic (meta) term used for these objects or procedures. Types of test doublesGerard Meszaros[1] identified several different terms for what he calls, "Test Doubles." Using his vocabulary, there are at least five types of Test Doubles:
For both manual and automated black box testing of service oriented architecture systems or microservices software developers and testers use test doubles that communicate with the system under test over a network protocol.[2][3] These test doubles are called different names depending on the tool vendor. A commonly used term is service virtualization. Other names used include API simulation, API mock,[4] HTTP stub, HTTP mock, over the wire test double[5] .[6] Another form of test double is the Verified Fake, a Fake object whose behavior has been verified to match that of the real object using a set of tests that run against both the Verified Fake and the real implementation.[7] While there is no open standard for test double and the various types, there is momentum for continued use of these terms in this manner. Martin Fowler used these terms in his article, Mocks Aren't Stubs[8] referring to Meszaros' book. Microsoft also used the same terms and definitions in an article titled, Exploring The Continuum Of Test Doubles.[9] See also
References1. ^{{cite book |last=Meszaros |first=Gerard |title=xUnit Test Patterns: Refactoring Test Code |year=2007 |publisher=Addison-Wesley |isbn=978-0-13-149505-0}} 2. ^Clemson, Toby [https://martinfowler.com/articles/microservice-testing/#testing-component-out-of-process-diagram "Testing Strategies in a Microservice Architecture"], martinfowler.com, 18 November 2014. Retrieved on 07 December 2017. 3. ^Byars, Brandon. "Testing Microservices with Mountebank", Manning Publications, MEAP began March 2017. {{ISBN|9781617294778}}. Retrieved on 07 December 2017. 4. ^Bryant, Daniel [https://www.infoq.com/news/2016/08/wiremock-v2-api-mocking "API Mocking Tool WireMock v2 Released with Improved Request Matching and Stub Management"], InfoQ, 16 August 2016. Retrieved on 07 December 2017. 5. ^ThoughtWorks [https://www.thoughtworks.com/radar/tools/mountebank "Technology Radar, Tools: Mountebank"], ThoughtWorks, November 2015. Retrieved on 07 December 2017. 6. ^Bulaty, Wojciech [https://www.infoq.com/articles/stubbing-mocking-service-virtualization-differences "Stubbing, Mocking and Service Virtualization Differences for Test and Development Teams"], InfoQ, 19 February 2016. Retrieved on 07 December 2017. 7. ^{{cite web |url=https://pythonspeed.com/articles/verified-fakes/ |title=Fast tests for slow services: why you should use verified fakes |last=Turner-Trauring |first=Itamar |year=2019 |accessdate=2019-01-21 }} 8. ^{{cite web |url=http://martinfowler.com/articles/mocksArentStubs.html |title=Mocks Aren't Stubs |last=Fowler |first=Martin |year=2007 |accessdate=2010-12-29 }} 9. ^{{cite web |title=Exploring The Continuum Of Test Doubles |url=http://msdn.microsoft.com/en-us/magazine/cc163358.aspx |last=Seemann |first=Mark |year=2007 |accessdate=2010-12-29 }} External linksGerard Meszaros:
Martin Fowler:
Open Source:
3 : Software testing|Software development philosophies|Software development process |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。