Mock object generation
AssigneeHome Box Office, Inc.
InventorBrendan Joseph Clark
Life of this patent
Estimating the term…
Abstract
The disclosure is generally directed towards automatically generating a mock object from a description of a real object, such as for use in testing. Mock object generation logic parses the description to determine interface(s) of the real object, which are replicated in the mock object, and to determine method(s) of the real object, which are simulated in the mock object. The mock object generation logic may generate a description of the mock object that is then compiled into the mock object for execution. Data types may be validated so that the arguments and/or return values from the mock object meet the expectations of a calling object.
Claims20
A method, comprising:
- parsing, by a system including a processor, a parsable description language document describing a real object, on which a calling object to be unit tested depends, to generate one or more mock object generation files representative of the real object, wherein the one or more mock object generation files comprise a first description of an interface set of the real object, a second description of a method set of the real object, and a third description of a constructor set, an event set, and a property set of the real object;
- compiling, by the system, the one or more mock object generation files to generate a mock object of the real object, wherein the mock object replicates the interface set of the real object and simulates the method set, the constructor set, the event set, and the property set of the real object.
A system, comprising:
- a processor;
- and
- a memory communicatively coupled to the processor, the memory having stored therein computer-executable instructions, comprising:
- a mock object generation logic component that parses a parsable description language document describing a real object, on which a calling object to be unit tested depends, to generate one or more mock object generation files representative of the real object, wherein the one or more mock object generation files comprise a first description of an interface set of the real object, a second description of a method set of the real object, and a third description of a constructor set, an event set, and a property set of the real object;
- and
- a compiler component that compiles the one or more mock object generation files, into a mock object of the real object;
- and
- the mock object comprises an interface set from the real object, and is configured to simulate the method set, the constructor set, the event set, and the property set from the real object.
One or more machine-readable storage media having machine-executable instructions that, perform operations comprising:
- parsing an interface description language document describing a real object, on which a calling object to be unit tested depends, to generate one or more mock object generation files representative of the real object, wherein the one or more mock object generation files comprise a first description of an interface set of the real object, a second description of a method set of the real object, and a third description of a constructor set, an event set, and a property set of the real object;
- and
- compiling, by the system, the one or more mock object generation files to generate a mock object of the real object, wherein the mock object replicates the interface set of the real object and simulates the method set, the constructor set, the event set, and the property set of the real object.
Dependencies are inferred from the claim text.