We have decided not to go for the big-bang approach to rewriting the QRA codes but instead pull out the key functionality from each re-structure these elements and convert them into object modules so that we can later reassemble with each of these modules fully tested. This also helps in understanding how the current version operates as we need to continue using these codes in the interim period before the new version has been assembled.
Roy is again buried in the code and in the process of extracting the fire and explosion escalation elements of one of the codes. The first step being to put the data structures into better order. Quote;
The QRA relies on an extensive data set held
within MS Excel. The code accesses the data by explicit sheet and cell
references using a combination of global variables and conditional logic. This
makes the code very difficult to follow and tightly couples the code to the
specific spreadsheet layout, hence it could not be directly ported to a
differently structured spreadsheet (or other data source)
The model also relies heavily on conditional
logic to perform its calculations given that there are many factors that have
to be considered and evaluated. This has resulted in a large number of chained conditionals
statements together with extensive nesting of the conditionals. As with the
data issue, this makes the code extremely difficult to follow and test.
Modifying the model with the existing escalation implementation would be
impractical.
The plan is therefore to create a data abstraction layer to decouple the code from the spreasheets as illustrated below.
Lets see how we get on from here ......