Test context generation
AssigneeFujitsu Limited
InventorHiroaki Yoshida
Life of this patent
Estimating the term…
Abstract
A method to generate a human-friendly test context in a test proxy for a function under test may include generating an initial test context of the function under test. The method may also include enhancing a current test context with a new context enhancement. The method may also include adding a hint to the current test context. The current test context may include or be derived from the initial test context.
Claims20
A method to generate a human-friendly test context in a test proxy for a function under test, the method comprising:
- generating an initial test context of the function under test;
- enhancing a current test context with a new context enhancement;
- adding a hint to the current test context;
- and
- performing extended symbolic execution of the function under test using the current test context to identify the new context enhancement, the extended symbolic execution including:
- determining whether a concrete variable included in a portion of the function under test is a dependent concrete variable based on whether an ability to execute a branch of the function under test depends on the concrete variable;
- further determining the branch is not executable;
- in response to determining that the concrete variable is the dependent concrete variable and to determining that the branch of the function under test is not executable, marking the concrete variable as a symbolic variable;
- determining whether the marked symbolic variable is accessible to the function under test;
- and
- in response to determining that the symbolic variable is accessible to the function under test, identifying the symbolic variable as the new context enhancement,
- wherein the current test context includes or is derived from the initial test context.
An apparatus comprising:
- one or more processors;
- and
- a non-transitory computer-readable medium communicatively coupled to the processors and having stored thereon computer instructions comprising a test context module executable by the processor to:
- generate an initial test context of a function under test;
- enhance a current test context with a new context enhancement;
- mark a concrete variable included in a portion of the function under test that is symbolically executed as a symbolic variable;
- determine whether the symbolic variable is accessible to the function under test;
- and
- in response to determining that the symbolic variable is accessible to the function under test, identify the symbolic variable as the new context enhancement, and
- add a hint to the current test context, wherein the hint comprises a suggestion for a user to make the concrete variable marked as the symbolic variable symbolic in the current test context,
- wherein the current test context includes or is derived from the initial test context.
A non-transitory computer-readable medium having computer instructions stored thereon that are executable by a processor to perform operations comprising:
- generating an initial test context of a function under test;
- enhancing a current test context with a new context enhancement;
- and
- adding a hint to the current test context;
- and
- performing extended symbolic execution of the function under test using the current test context to identify the new context enhancement, the extended symbolic execution including:
- determining whether a concrete variable included in a portion of the function under test is a dependent concrete variable based on whether an ability to execute a branch of the function under test depends on the concrete variable;
- further determining the branch is not executable;
- in response to determining that the concrete variable is the dependent concrete variable and to determining that the branch of the function under test is not executable, marking the concrete variable as a symbolic variable;
- determining whether the marked symbolic variable is accessible to the function under test;
- and
- in response to determining that the symbolic variable is accessible to the function under test, identifying the symbolic variable as the new context enhancement,
- wherein the current test context includes or is derived from the initial test context.
Dependencies are inferred from the claim text.