[SystemSafety] Modelling and coding guidelines: "Unambiguous Graphical Representation"

paul_e.bennett at topmail.co.uk paul_e.bennett at topmail.co.uk
Tue Mar 1 15:15:44 CET 2016


On 01/03/2016 at 1:31 PM, "Derek M Jones" <derek at knosof.co.uk> wrote:
>
>Paul,
>
>> Whilst it is true that quality or safety cannot be inspected 
>into a product
>> the Fagan Inspections can and do prevent bad code going further 
>so
>> long as the process can keep the bad code from passing by.
>
>What is bad code and how does one detect its presence?

Bad code is code which does not conform to the standards you 
employ as guidance, does not have sufficient or clear enough 
comments, and does not have a clear and unambiguous path
through from start to end of the code.

I do my code inspections on quite simple modules and any that
does not meet the criteria is marked as a fail and returned with
issues that were raised as part of the inspection.

I also have limits on cyclomatic complexity of components (see
McCabe on this) which are also enfoirced during the inspection.

>There are obvious errors, such as use of uninitialized variables.

Yes, which can become obvious on a thorough enough inspection.

>There are suspicious constructs, that is use which experience
>has shown to be unintended, such as assignment rather than equality
>test in an if-statement (i.e., one = instead of two).
>
>Suspiciousness is not a binary variable.  A cost/benefit decision
>has to be made about how suspicious a usage has to be before it
>is worth investing time looking at it (and estimates of suspicious
>have large error margins associated with them).

There was a saying that went something like

"You can make it simple enough there are obviously no errors
or you can make it so complex there are no obvious errors"

I tend to favour the former approach.

Regards

Paul E. Bennett IEng MIET
Systems Engineer

-- 
********************************************************************
Paul E. Bennett IEng MIET.....<email://Paul_E.Bennett@topmail.co.uk>
Forth based HIDECS Consultancy.............<http://www.hidecs.co.uk>
Mob: +44 (0)7811-639972
Tel: +44 (0)1392-426688
Going Forth Safely ..... EBA. www.electric-boat-association.org.uk..
********************************************************************



More information about the systemsafety mailing list