Low-level checking of context-dependent expected results
First Claim
1. A processor-implemented method for diagnostic testing using an expected result parameter, the method comprising:
- establishing, by a processor, a known system environment associated with a specific function under test;
setting, by the processor, an expected result parameter corresponding to the specific function under test and the known system environment;
issuing, by the processor, a call to execute the specific function under test, wherein the specific function under test is called by a higher-level module and the specific function under test is a lower-level module than the higher level module that called the specific function under test and the expected result parameter is passed through multiple levels of nesting modules and assigned to the specific function under test when the specific function under test is called, wherein the expected result parameter is an added parameter to an invocation statement of a function in a call stack;
comparing, by the specific function under test, the assigned expected result value to an actual result value;
determining, by the specific function under test, an error based on the actual result value being different from the assigned expected result value;
performing, by the specific function under test, a low-level diagnostic based on the determined error, wherein the performing of the low-level diagnostic comprises a capturing of a current system environment immediately following the error which includes performing a storage dump, recording a plurality of trace data, and collecting a plurality of problem documentation in retained memory; and
receiving, by the processor, a return value from the specific function under test based on the issued call.
1 Assignment
0 Petitions
Accused Products
Abstract
A processor-implemented method for diagnostic testing using an expected result parameter is provided. The processor-implemented method may include establishing a known system environment associated with a function under test and setting the expected result parameter corresponding to the function under test and the known system environment. A call is issued by the processor to execute the function under test. Before returning to the caller, the function under test compares an expected result value to an actual result value. The function under test determines an error based on the actual result value being different from the expected result value and performs a low-level diagnostic based on the determined error. Then the processor receives a return value from the function under test based on the issued call.
26 Citations
14 Claims
-
1. A processor-implemented method for diagnostic testing using an expected result parameter, the method comprising:
-
establishing, by a processor, a known system environment associated with a specific function under test; setting, by the processor, an expected result parameter corresponding to the specific function under test and the known system environment; issuing, by the processor, a call to execute the specific function under test, wherein the specific function under test is called by a higher-level module and the specific function under test is a lower-level module than the higher level module that called the specific function under test and the expected result parameter is passed through multiple levels of nesting modules and assigned to the specific function under test when the specific function under test is called, wherein the expected result parameter is an added parameter to an invocation statement of a function in a call stack; comparing, by the specific function under test, the assigned expected result value to an actual result value; determining, by the specific function under test, an error based on the actual result value being different from the assigned expected result value; performing, by the specific function under test, a low-level diagnostic based on the determined error, wherein the performing of the low-level diagnostic comprises a capturing of a current system environment immediately following the error which includes performing a storage dump, recording a plurality of trace data, and collecting a plurality of problem documentation in retained memory; and receiving, by the processor, a return value from the specific function under test based on the issued call. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A computer system for diagnostic testing using an expected result parameter, the computer system comprising:
one or more processors, one or more computer-readable memories, one or more computer-readable tangible storage devices, and program instructions stored on at least one of the one or more storage devices for execution by at least one of the one or more processors via at least one of the one or more memories, the program instructions comprising; program instructions to establish a known system environment associated with a specific function under test; program instructions to set an expected result parameter corresponding to the specific function under test and the known system environment; program instructions to issue a call to execute the specific function under test, wherein the specific function under test is called by a higher-level module and the specific function under test is a lower-level module than the higher level module that called the specific function under test and the expected result parameter is passed through multiple levels of nesting modules and assigned to the specific function under test when the specific function under test is called, wherein the expected result parameter is an added parameter to an invocation statement of a function in a call stack; program instructions to compare an expected result value to the assigned actual result value; program instructions to determine an error based on the assigned actual result value being different from the expected result value; program instructions to perform a low-level diagnostic based on the determined error wherein the performing of the low-level diagnostic comprises a capturing of a current system environment immediately following the error which includes performing a storage dump, recording a plurality of trace data, and collecting a plurality of problem documentation in retained memory; and program instructions to receive a return value from the specific function under test based on the issued call. - View Dependent Claims (8, 9, 10)
-
11. A computer program product for diagnostic testing using an expected result parameter, the computer program product comprising:
one or more computer-readable storage devices and program instructions stored on at least one of the one or more non-transitory tangible storage devices, the program instructions comprising; program instructions to establish a known system environment associated with a specific function under test; program instructions to set an expected result parameter corresponding to the specific function under test and the known system environment; program instructions to issue a call to execute the specific function under test, wherein the specific function under test is called by a higher-level module and the specific function under test is a lower-level module than the higher level module that called the specific function under test and the expected result parameter is passed through multiple levels of nesting modules and assigned to the specific function under test when the specific function under test is called, wherein the expected result parameter is an added parameter to an invocation statement of a function in a call stack; program instructions to compare an expected result value to the assigned actual result value; program instructions to determine an error based on the assigned actual result value being different from the expected result value; program instructions to perform a low-level diagnostic based on the determined error wherein the performing of the low-level diagnostic comprises a capturing of a current system environment immediately following the error which includes performing a storage dump, recording a plurality of trace data, and collecting a plurality of problem documentation in retained memory; and program instructions to receive a return value from the function under test based on the issued call. - View Dependent Claims (12, 13, 14)
Specification