-
Notifications
You must be signed in to change notification settings - Fork 13
Debug version of ModelArrayRef
Name: Tim Spain
Affiliation: NERSC
Target/Actual Release Date/Project Milestone (delete as appropriate): ASAP
Reviewers: Alex Smith, Kacper Kornet
GitHub Issue: #240
When writing tests or new code, ModelComponent
derived classes of end up missing ModelArrayRef
s that they require. The way the model and tests currently signal this is to crash with a SIGSEGV
once the missing array is accessed. Having a way of diagnosing this problem with a descriptive message would be a benefit to developers.
The new code will be added in such a way that the final version of the model and of each test will not be impacted at all, since they will compile using the current version of ModelArrayRef
.
The new code should
- provide checked access to
ModelArrayRef
data and report when access is attempted on aModelArrayRef
that doesn't actually refer to aModelArray
. - This is done by throwing a
std::invalid_argument
exception with a message describing at least the ModelComponent that should be being referenced.- This is not necessarily the best standard exception to use, but it certainly is one.
- Once the application in question has all the data it needs the checks can be turned off or replaced with the current
ModelArrayRef
code.
A developer uses the new class to check all ModelArrayRef
s actually connect to a ModelArray
. Once the new class reports no errors and the test runs to completion, the developer replaces the new class with the current ModelArrayRef
.
Substitute in the new class until it is not needed any more.
The one place the new class will be used is in a test that it a) can return data exactly as ModelArrayRef
when there is data at the other end of the reference and that it throws an appropriate exception with an informative message when there is not.
Feature Specifications By Component
-
General IO
-
Developer Tools
-
Model Architecture
Draft Component Specifications
- Coupling