Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Practices for Robustness [closed]

Tags:

robustness

I just came across this question about initializing local variables. Many of the answers debated simplicity/readability vs. robustness. As a developer of (remotely deployed) embedded systems, I always favor robustness and tend to follow several seemingly conflicting rules:

  • Handle every error to the best of your ability in a way that allows the device to continue running.

  • Design the code to fail as soon as possible after a programming or fatal error occurs.

We've all been trained to validate input to prevent the device from breaking as a result of user (or other external) input; always assume data may be invalid and test it accordingly.

What other specific practices do you follow to ensure robustness? Examples are helpful, but I'm also interested in techniques that are universally applicable.

like image 559
Adam Liss Avatar asked Nov 12 '08 05:11

Adam Liss


People also ask

What is a robust control strategy?

In control theory, robust control is an approach to controller design that explicitly deals with uncertainty. Robust control methods are designed to function properly provided that uncertain parameters or disturbances are found within some (typically compact) set.

How can software robustness be improved?

One of the most important points to improve the robustness of our software is to test it. Not only do we have to check the runtime- and input-output-behaviour, also side-effects should be discovered. Testing is a determined, systematic attempt to break a program that you think is working [KePi99].

What is robustness requirement?

Robustness is defined as the degree to which a system operates correctly in the presence of exceptional inputs or stressful environmental conditions.


1 Answers

I'm a fan of the techniques described in "The Pragmatic Programmer". I also use TDD, rather than DBC as I find it more flexible and productive. For example some of the techniqes described in 'pragprog' include:

  • Test often. Test early. Test automatically
  • Don't repeat yourself
  • Use saboteurs to test your testing
  • Use exceptions for exceptional problems
  • Don't live with broken windows
  • Don't use manual procedures

They all seem like common sense, but its amazing how quickly teams deviate from these underpinning principles when faced with deadlines.

like image 153
Jim Burger Avatar answered Oct 04 '22 04:10

Jim Burger