Streamlining unit testing through hot code swapping
Abstract
Methods and systems are described for testing methods and other functions by swapping external functions for mock functions. A test case definition is entered by a programmer, which can specify the expected number of arguments and argument values of external function or method calls, the context state, the return value, and any expected error conditions. The test case definition is used by a function tester to automatically create mock functions, modify the target function so that it calls the mock functions, execute the target function with specified arguments and a test context, and then compare the results to expected results.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 6 · Forward citations: 11.
Claims (1 — 1 Independent, 0 Dependent)
- Claim 1Independent Claim
A method of testing functions using mock functions, the method comprising: receiving information at a function tester specified using a declarative syntax that defines a test case definition for a target function to be tested by the function tester, the test case definition including an expected number of arguments to one or more external functions to be called in the target function and expected argument values for the expected number of arguments to be sent in a call to each of the one or more external functions from the target function; creating, using a processor operatively coupled to a m
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗
Cited By — Indexed Forward Citations (11 of 11 total)
References Cited — Backward Prior Art (6)
Non-Patent Literature (1)
- Karlesky, Michael, et al. "Mocking the embedded world: Test-driven development, continuous integration, and design patterns." Proc. Emb. Systems Conf, CA, USA. 2007.