Resilient mock object creation for unit testing
Abstract
Embodiments of the invention provide for fault alerting in mock object supported unit testing. In a method for fault alerting in mock object supported unit testing an instance a mock object proxying for an object under test by test code is created in memory of a computing system and an invocation of a method in the object under test is proxied by method name to the mock object. Then, it is determined whether or not a method exists in memory for the mock object corresponding to the method name. Finally, an exception handler is invoked for the mock object outputting error text indicating a non-presence of a method associated with the method name responsive to a method by the method name not existing in the memory for the mock object, but otherwise a method is invoked that exists in the memory of the mock object corresponding to the method name.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 16 · Forward citations: 1.
Claims (2 — 1 Independent, 1 Dependent)
- Claim 1Independent Claim
A method for fault alerting in mock object supported unit testing, the method comprising: creating in memory of a computing system an instance of a mock object; proxying for an object under test by test code; proxying by method name an invocation of a method in the object under test to the mock object; determining absence in memory of a method corresponding to the method name for the mock object; and, responsive to the determination of the absence of the method name, invoking an exception handler for the mock object; and responsive to the invocation of the exception handler for the mock object
- Claim 2Depends on #1
The method of claim 1 , wherein the
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗
Cited By — Indexed Forward Citations (1 of 1 total)
| Patent | Title | Year | Citations |
|---|---|---|---|
| US 10,824,546 B2 | Test method and non-transitory computer readable medium storing program for testing modules | 2020 | 0 |
References Cited — Backward Prior Art (16)
Non-Patent Literature (5)
- Chaffee, et al., "Unit Testing With Mock Objects," IBM developers Works, Nov. 2002.
- Coelha et al, "Unit Testing in Multi-agent Systems using Mock Agents and Aspects", ACM, pp. 83-89, 2006.
- Freeman et al, "jMock: Supporting Responsibility-Based Design With Mock Objects", ACM, pp. 4-5. 2004.
- Kim et al, "Mock Object Models for Test Driven Development", IEEE, pp. 1-8, 2006.
- Marri et al, "An Empirical Study of Testing File-System-Dependent Software with Mock Objects", IEEE, pp. 149-153, 2009.