Tips to efficiently create an independent test case for reproducing a specific exception #1411
Replies: 2 comments
-
If you're able to provide steps to consistently reproduce the issue, we can definitely assist in debugging, even if it's a complex scenario. In terms of generic advice, unfortunately I don't have much. We haven't isolated pieces of the system as well as we could have, so for instance even if the root cause of an issue is related to 1 specific module and none of the others, you can't necessarily remove those other modules because that impacts the random number sequence. At minimum you should be able to isolate the issue to a single patient, using the Re: serializing to a file, there are a couple options. You can use the JSONExporter which will produce something reasonably human-readable to inspect:
or you can use native java serialization but this creates a binary file that can really only be parsed back in java code:
|
Beta Was this translation helpful? Give feedback.
-
Thank you @dehall for your tip to use |
Beta Was this translation helpful? Give feedback.
-
I'm seeing a strange exception which I am attempting to narrow down before filing an issue. I found that for a very specific case, a call to person.getVitalSign(VitalSign.SYSTOLIC_BLOOD_PRESSURE, time) here is returning negative values, leading to consequent out-of-range exception in Framingham.getIndexForValueInRangelist.
To efficiently reproduce as an independent test case, I believe we need to have a
person
with identical or similar attributes, medications, etc. I say this because just re-creating aperson
with the same seed and using the sametime
as the bigger reproduction scenario, does not cause the exception in the independent test case. When I attach a debugger and try to dump out the state of theperson
at the time of the exception, it contains too many attributes, medications, etc. to efficiently reproduce inside an independent test case.Are there any dev tips to help me narrow this down more efficiently? Is there a way to serialize the
person
class as a file and then use that in an independent test case?If this is better suited for an Issue, do let me know. But again, here I'm trying to get an idea for developer process tips to help narrow these kinds of tricky, rare bugs down from a bigger run to an independent test case.
Beta Was this translation helpful? Give feedback.
All reactions