Questions tagged [robustness]

Robustness is the ability of a system to continue to run after it detects an error (Steve McConnell, "Code Complete").

Robustness is the ability of a system to continue to run after it detects an error.
/Steve McConnell, "Code Complete"/

As per wikipedia:

In computer science, robustness is the ability of a computer system to cope with errors during execution or the ability of an algorithm to continue to operate despite abnormalities in input, calculations, etc.

The opposite of robust code is fragile code; an example of fragile code would be having a class with all its member variables marked as public.


The benefits of having robust code are many, some of the most important ones are:
1. Easy to change. Robust code is easier to change because external factors don’t affect its behaviour.
2. Less bugs. The more robust the code is, the less combinations that cause a bug in the code.
3. Better integration. Robust code is predictable, so from an integrator point view, is always going to have the same behavior. 4. Consistency. Robust code works fine no matter who, when or how it gets called.
/Robustness, the forgotten code quality/

Several links by theme:
Examples for Robustness Requirements
10 characteristics of a robust application or service

134 questions
50
votes
6 answers

Equals(item, null) or item == null

Is code that uses the static Object.Equals to check for null more robust than code that uses the == operator or regular Object.Equals? Aren't the latter two vulnerable to being overridden in such a way that checking for null doesn't work as expected…
Joseph Sturtevant
  • 13,194
  • 12
  • 76
  • 90
22
votes
7 answers

String-handling practices in C

I'm starting a new project in plain C (c99) that is going to work primarily with text. Because of external project constraints, this code has to be extremely simple and compact, consisting of a single source-code file without external dependencies…
tylerl
  • 30,197
  • 13
  • 80
  • 113
20
votes
8 answers

Fail Fast vs. Robustness

Our product is a distributed system. The modules I work on are fairly new, quite rigorous, well tested. They were developed with recent best practices in mind. Other modules can be considered as legacy software. While I'm vigilant about everything…
tolak
  • 233
  • 1
  • 5
18
votes
2 answers

Heteroscedasticity robust standard errors with the PLM package

I am trying to learn R after using Stata and I must say that I love it. But now I am having some trouble. I am about to do some multiple regressions with Panel Data so I am using the plm package. Now I want to have the same results with plm in R as…
Marcus R
  • 245
  • 1
  • 2
  • 8
15
votes
2 answers

Robust endless loop for server written in Python

I write a server which handles events and uncaught exceptions during handling the event must not terminate the server. The server is a single non-threaded python process. I want to terminate on these errors…
guettli
  • 25,042
  • 81
  • 346
  • 663
15
votes
5 answers

Python, writing an integer to a '.txt' file

Would using the pickle function be the fastest and most robust way to write an integer to a text file? Here is the syntax I have so far: import pickle pickle.dump(obj, file) If there is a more robust alternative, please feel free to tell me. My…
clickonMe
  • 521
  • 2
  • 6
  • 12
14
votes
3 answers

How to reconnect to a socket gracefully

I have a following method that connects to an end point when my program starts ChannelSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); var remoteIpAddress = IPAddress.Parse(ChannelIp); ChannelEndPoint = new…
Null Reference
  • 11,260
  • 40
  • 107
  • 184
12
votes
2 answers

What are the rules to write robust shell scripts?

I recently erased part of my home directory with a shell script I wrote. Fortunately, I did hit Ctrl-C fast enough to avoid the worst. My mistake has been to rely too much on relative paths. Since now, I always use absolute paths when changing…
perror
  • 7,071
  • 16
  • 58
  • 85
11
votes
10 answers

Best Practices for 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…
Adam Liss
  • 47,594
  • 12
  • 108
  • 150
11
votes
2 answers

How to tell if a caught IOException is caused by the file being used by another process, without resorting to parsing the exception's Message property

When I open a file, I want to know if it is being used by another process so I can perform special handling; any other IOException I will bubble up. An IOException's Message property contains "The process cannot access the file 'foo' because it is…
Paul Killick
  • 427
  • 6
  • 9
11
votes
4 answers

Atomic file copy under .NET

I am building a server app that copies files using System.IO.File.Copy(...) function. My files can be rather large, therefore, it has a fair chance that if the machine crashes, it happens during copying. After restarting the service, I should be…
user256890
  • 3,396
  • 5
  • 28
  • 45
10
votes
1 answer

How to ensure out-of-memory robustness with C++ exceptions disabled (VS2010)?

I'm working on a performance-critical dynamically-linked library (DLL) that should also have a relatively small binary size. Since it doesn't explicitly throw any exceptions, I'd like to disable exception support altogether. However, there's one…
Nicolas Capens
  • 832
  • 6
  • 12
8
votes
3 answers

Robust haskell without errors

I'm currently learning Haskell. One of the motivations why I picked this language was to write software with a very high degree of robustness, i.e. functions that is fully defined, mathematically deterministic and never crash or produce errors. I…
Hannes Landeholm
  • 1,525
  • 2
  • 17
  • 32
8
votes
1 answer

CLI shell script code generation from compiled executable?

Question, topic of discussion I am very interested in generation of command line shell scripting source code from code written in a more robustness-promoting, well-performant and platform-independent compiled language (OCaml, for instance).…
Sander
  • 323
  • 3
  • 9
7
votes
1 answer

"set -e" in shell and command substitution

In shell scripts set -e is often used to make them more robust by stopping the script when some of the commands executed from the script exits with non-zero exit code. It's usually easy to specify that you don't care about some of the commands…
Ivan Tarasov
  • 7,038
  • 5
  • 27
  • 23
1
2 3
8 9