# Error’s meanings in software projects

Software projects involve many people from different domains. Software developers, testers, domain experts, technical and sales managers working together and contribute to the project and influence on the software shape. Do they all agree what does it mean “errors” in software? The answer is yes, but not exactly.

## Different contexts of errors

All the people in software projects understand error as an issue, a problem which needs to be handled. It may depend on context if a software behaviour is considered as an error or not.

### An error in a context of a software developer

Being a software developer I consider error as a problem which may occur as a result of code statement execution. Error is an object like exception, number, special data structure or an event like function invocation. Errors are described in specifications of API. Generally, when You are a software developer You are being familiar with error raising and errors handling methods supported by programming languages and frameworks. In my opinion, the best definition of error occurrence in code is this from Alexandrescu and Sutter book “C++ Coding Standards”

An error is any failure that prevents a function from succeeding

Alexandrescu, Sutter ++ Coding Standards

According to the definition program codes include plenty of situations when errors occurred, and lots of codes were written to handle errors reported by invoked functions. Let’s see a one of common example (pseudocode):

Number getFileSize( _fileName ) {
if file named by _fileName does not exist
then report an error by returning -1
else return size of the file in bytes
}

The function above must return the size of the file passed to it as a parameter. Of course, it cannot succeed in a case when the passed file does not exist on filesystem, so it returns a special value ‘-1’ which means an error. The client of the function may write something like this:

if getFileSize( myFile ) returns -1
then try to create myFile ...

The code above handles an error reported by getFileSize function. Both programmers (this who write the function and this who invoke it) understand an error as a situation in the code which needs to be reported and handled. There is something interesting, the function may return an error, but the function caller does not have to consider the error as a problem, he can ignore it and continue processing (for example it may be expected by the caller that file does not exist). We need to accept the fact , that for developers errors are objects or events in the code, they are not good or bad, but always requires to consider a method of theirs reporting and handling ( ignoring an error is also a handling method ).

### An error in a context of a software tester

Testers understand an error as a software behaviour which does not comply with the specification (or their intuition if the spec does not exist). For testers, errors are not objects in the code. The difference of understanding errors between developers and testers are so big, that we have another word: ‘the bug’ which both parties understand as a problem with the software which must be fixed.

### An error in a context of a software user

Assuming that the software works according to specification ( doesn’t have bugs ), the user can be only informed by programs about errors, in situations when his own action prevents the software for executing its task. For example, the user tries to open a file without permissions or tries to connect to a server with a wrong IP address. For the users, the errors are their own mistakes during working with the software.