Handling Uninitialized Input Values in Test Cases
- It allows testing of "real world" behavior when functions are called with uninitialized data
- It allows test cases to "inherit" data from previously executed code (i.e. startup code, initialization user code, or previous slots in a compound test case)
Despite the fact that VectorCAST code does not initialize these parameters, however, there are several factors that may influence the initialization of test case parameters:
- In most operating environments, the processor startup code, operating system and/or C library will clear BSS and heap memory (as well as possibly other areas of memory) prior to main().
- For C++, the language standard explicitly requires that all uninitialized globals be initialized to zero prior to main().
- Certain VectorCAST features such as user code and automatic initialization test cases can be used to initialize memory and/or input parameters prior to execution of a test case.
Another thing to consider with regards to uninitialized input values is whether the test case is the first one to run in the test harness. As mentioned above, some features of VectorCAST -- like compound test cases and range/list iterations -- allow multiple executions of test case or different test cases within a single harness execution. In these scenarios only the first test case executed will get the "default" values for uninitialized inputs. Subsequent test case executions will "inherit" any parameter values modified by previous test cases (neither the target nor the test harness are reset during the compound execution). This behavior is useful for setting up complex test scenarios, but can occasionally be confusing for users unfamiliar with the tools.
So to summarize, if your test case depends on a value, you should explicitly set that value in the test case's "Input Values" column.