发明名称 Reliable unit testing through cached mocking
摘要 During execution of a unit test, receiving from the unit test a first request referencing a mock object. An instance of the mock object and initial cached mock object data is returned to the test unit, wherein the initial cached mock object data includes first data for a real object represented by the mock object. Second data for the real object represented by the mock object is collected. The second data for the real object is compared to the initial cached mock object data. Responsive to determining that at least one aspect of the second data for the real object does not correspond to the initial cached mock object data, the cached mock object data is updated with the second data for the real object. An indication can be provided to the unit test that the initial cached mock object data returned to the unit test is unreliable.
申请公布号 US8935573(B2) 申请公布日期 2015.01.13
申请号 US201213597716 申请日期 2012.08.29
申请人 International Business Machines Corporation 发明人 Horsman Steven J.;Sharp Kathleen
分类号 G06F11/28 主分类号 G06F11/28
代理机构 Cuenot, Forsythe & Kim, LLC 代理人 Cuenot, Forsythe & Kim, LLC
主权项 1. A method of unit testing a mock object using cached data, the method comprising: during execution of a unit test, receiving from the unit test a first request referencing a mock object; returning to the unit test an instance of the mock object and initial cached mock object data, wherein the initial cached mock object data includes first data for a real object represented by the mock object; collecting second data for the real object represented by the mock object; comparing the second data for the real object to the initial cached mock object data; responsive to determining that at least one aspect of the second data for the real object does not correspond to the initial cached mock object data; via a processor, updating the cached mock object data with the second data for the real object; and indicating to the unit test that the initial cached mock object data returned to the unit test is unreliable.
地址 Armonk NY US