[SystemSafety] A further (anally obsessive?) rule to add to MISRA C

Olwen Morgan olwen.morgan at btinternet.com
Tue Sep 18 16:01:57 CEST 2018


In addition to the C coding rules I suggested in a previous post 
concerning a single-assignment style of programming, I'd add one more in 
aid of testability:

"As far as possible, functions should be written such that any set of 
test cases that achieves 100% strong, robust boundary-value coverage 
also achieves *both* 100% MCDC coverage and 100% simple path coverage of 
the program's control flow graph."

The reference for the test coverage  measures is: Jorgensen, P. C., 
/Software Testing: A Craftsman's Approach/, Auerbach Publications, 2013, 
ISBN-10: 1466560681, ISBN-13 978-1466560680.

Achieving this demands a pretty stringent discipline in how you write 
your code (that once got my own coding style labelled as, "anally 
obsessive"). The benefit is that it tends to ensure that for each 
function, control flow structure is no more complex than is necessary to 
deal with the different equivalence classes of data that the function 
has to handle.


regards,
O

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.techfak.uni-bielefeld.de/mailman/private/systemsafety/attachments/20180918/3c308c98/attachment.html>


More information about the systemsafety mailing list