software error

30-01-2015, 11:31Print
A program error or software error or software anomaly, often also as a bug (English beetle [bʌg]) named, designates generally a failure of computer programs. This appears if the programmer has not moved a certain definition of the specification or wrong, or if the run time environment works faultily or differently than expected. Furthermore incompleteness, inaccuracy or ambiguities can also lead in the specification of the programme to errors.

To the very entire detection and removal of program errors will usually run through in the processes of the software development, i.e. before the actual, 'productive' application of software, the project phase Software test. Besides, appearing errors are usual and to find them is the destination of the testing, during errors in the running company according to error effect possibly critical anomalies / disturbances explain. In practice computer programs without program error appear as rare. Programmes with an error density of less than 0.5 errors per 1000 lines code are valid as stable programmes.

As special instruments to the search for the causes for error in programmes so-called debuggers are helpful with which a programme can be executed step by step and be controlled.

So-called Bugtracker (how Bugzilla or Mantis) become the capture and documentation used. These take up error reports, as well as improvement suggestions and wishes of the users or general processes. See also error management.

The process of the Beseitigens of a program failure is called colloquially bugfixing. The result of the improvement is designated in the technical language Bug-fixed, patch or software patch.

A program error or software error is, leant to the general definition for "error"

„The non-fulfilment of an agreed demand (German Institute for Standardization ISO in 8402)“.
Specifically the error defines itself afterwards as

„Divergence this IS (observed, ascertained, computed states or processes) from HAS TO DO (agreed, correct states and processes) if it can be the predefined tolerance border [also 0] crosses.“
To ISTQB the concept 'Error' from the following connections forms:

a false action (English Error)
„the human action which leads to an error state ([after IEEE 610])“
… leads to an error state (English Defect)
„Fault (the internal error state) in a component or a system which can affect a demanded function of the product …“
of one error effect (English Failure) can cause
„The Manifestierung of an internal error by the implementation of the [programme] as an incorrect behaviour or result or as a failure of the system.“
Example division by zero: False action: Zero as a possible input value was not examined / impossible; error state: the programme is (y unnoticed) fault up to the input of the value Zero; error effect: Runtime error during the implementation of the command.
As a synonym for "error" or in addition in addition expressions are also common like problem, fault, divergence, anomaly, lack. With it the "error gravity" can be also distinguished conceptual, e.g., the injury from instructions to the program style of the delivery of wrong results or a blowup.

"Bug" as a synonym for program error

Logbook page of the mark II Aiken of Relay Calculator with the first bug (1947)
The word "Bug" was used already in the 19th century for small errors in mechanical and electric parts. Hence, crackle and noise in the telephone line would stir that small animals (in English of bug‚ bug, beetle‘) nibble at the circuit. Edison wrote to its friend Tivadar Puskás, the inventor of the telephone exchange and founders of a phone newspaper a letter about the development of its inventions in which he designated small disturbances and difficulties "bug".

„The ridge [in all of micron inventions] is in intuition, and comes with a burst, then difficulties arise – this thing gives out and [it is] then that of 'bug' – feed search little faults and difficulties ares called – show themselves.“

„The first step [with all my inventions] is an intuitive thought which comes in an outbreak, however, then difficulties appear – then the thing functioned any more and [it is not] that‚ Bugs' – as such small errors and difficulties are called – to themselves point.“

– Edison in 1878
Though Edison is not an inventor, but, at least, principal witness for a new creation circulating even then.

The shortcut of the concept to computers possibly decreases to the computer pioneer Grace Hopper. The history spread you that on the 9th of September, 1945 a moth led mark II Aiken of Relay Calculator to a malfunctioning in a relay of the computer. The moth was deleted and in the logbook stuck with the words "First actual case of bug being found." (in German: „The first time that really one‚ beetle‘ was found.“). The legend of the Begriffsfindung keeps itself stubborn, although the logbook entry points just to the former use of the concept. Besides, Grace Hopper was wrong concerning the year: The incident occurred really on the 9th of September, 1947. The suitable page of the logbook was kept till the beginning of the 1990s in the Naval Surface Warfare centre computer museum of the US navy in Dahlgren, Virginia. At the moment there is this logbook page with the moth in the Smithsonian institutes.

Kinds of program errors
In the software engineering it is distinguished between following types from errors in programmes:

Lexical errors are references in the program code on not existing constructs, for example, on invalid, not defined variable names etc.
Syntax errors are an offence against the grammatical rules of the used programming language, for example, comma instead of semicolon, too few command parametres.
Lexical and syntax error prevent as a rule the compilation of the faulty programme. With the programming languages which are interpreted sequential the programme usually escapes at the syntactically faulty place.

Semantic errors are errors in which a programmed instruction is syntactically perfect though, but is faulty concerning the contents, nevertheless, for example, mistake of the command code, syntactically not recognizable wrong parametre order.
Logical errors exist an in detail wrong problem solving beginning, for example, on grounds of a fallacy, a wrong interpreted specification or simply a Versehens or write error. Examples: plus instead of below, smaller instead of small / same etc. The tolerance compared with such errors and these limit having to go attribute grammar from programming languages, as for example with the allocation compatibility of data types, are coined according to used programming language very differently and can cause difficultly security gaps to be overlooked and program falls.
Design errors are errors in the elementary concept, either with the definition of the demands for the software, or by the development of the software design on whose basis the programme is developed. Errors with the requirement definition are often based on lacking knowledge of the field for which the software is written or on misunderstandings between users and developers. However, errors directly in the software design are often on lacking experience of the software developers, unstructured programming or on sequence error by error in the requirement specification. In other cases the design has grown historically and becomes with the time blind what can lead again to design errors with advancements of the programme. Often it is programmed without right draught directly what can lead then in particular at higher complexity degree of the software for design errors. In addition, for error in the requirement definition as well as in the software design are possible often cost printing or pressure of time. A typical design error is the code repetition which does not lead though immediately to program errors, but can be overlooked by the software maintenance, the modification or the extension by program code very easily and then without fail to undesirable effects leads.

Error in the operating draught. The programme differently behaves than it single or many users expect, although it works technically on itself perfectly.
Other error concepts:

Runtime error: While the precalled errors mean a really faulty programme which either is not compiled or delivers faulty results, can also lead a "correct" programme by its implementation to errors. Runtime errors are all kinds of errors which appear, while the programme is processed. Their cause lies in many cases in an incorrect implementing of the desired functionality in the programme (semantic or logical errors). According to situation the cause can also be an inappropriate program environment (e.g., a wrong operating system version, wrong parametres by the call of the programme as a subroutine, wrong input data etc.)
Runtime errors can show themselves in the most different kinds. The programme often shows undesired behaviour, in the extreme case the implementation of the programme is exited ("fall"), or the programme goes over in a state in which it accepts no more user's inputs ("freezing", "hanging"). If memory is not released into programming languages without automatic garbage collection (possibly C or C ++) after the use any more, more and more memory is booked by the programme on a continuing basis. This situation is called memory leakage. But also into programming languages with automatic garbage collection (possibly Java or C #) similar problems can appear if, for example, objects are collected by programming close to system uncontrollably. Even more critically are inadvertent from the programmer released storage areas which often become, nevertheless, still by hanging pointers referenziert, because this can lead to absolutely uncontrolled behaviour of the software. Hence, some run time environments do not permit such programmable memory releases basically. Besides there is also of bug in connection with Multithreading, possibly Race Conditions which constellations designate in which the result of an operation depends on the temporal behaviour of certain single operations, or Deadlocks.

Error in the compiler, the run time environment or other libraries. Such errors are mostly especially difficult to understand, because the behaviour of the programme in such cases does not correspond to its semantics. Hence, the special reliability which is not always given, nevertheless, just with smaller projects is expected in particular from compiler and run time environment.
A regression bug is an error which was already repaired in a former program version which appears, however, in a later program version again.
Error as a sequence of physical operating conditions. The most differWith the programming
In addition, a row of advanced applications is offered which analyse either the source code or the binary code and try to find often made mistakes automated. In this category possibly programmes fall for the implementation monitoring which usually faulty memory accesses and memory leakage track down reliably. Examples are the freely available tool Valgrind and the commercial Purify. An other category of test programs encloses applications which analyse source code or binary code statically and discover possibly not closed resources and other problems and can announce. Under it fall possibly Findbugs, Lint and split pin.

With the testing
It absolutely makes sense that the test is developed before the real programme. With it it is reached that a test is not written which fits to the already written programme. This can occur through determination of test cases with the help of the specification already during the analysis or design phase. Besides, the determination of test cases in this early stage of the software development allows the check of the demands for the programme on Testbarkeit and completeness. The test cases ascertained with the help of the specification put the base for the acceptance test tests and can be continuously refined about the whole process of development.

Some software providers carry out test phases partly publicly and publish beta releases to let test the unpredictable varied conditions of utilisation of different users by itself and to let comment.

In the company
If an error appears during the company, must be tried to hold its effects as low as possible and to dam its sphere of activity by creation of "bulwarks" or "backups". This requires on the one hand possibilities of the error detection and on the other hand to be able to react adequately to an error.

An example to the error detection at the run time of a computer program are Assertions with whose help conditions are interrogated which are always fulfilled according to program design. Other mechanisms are exception handlings like trap and Exception.

By the implementing of Proof-Carrying code the software for the run time can guarantee its reliability in certain border and guarantee.ent occurrences like electromagnetic fields, rays, temperature variations, vibrations, etc., can also lead with usually perfectly configured and within the specifications to run systems to errors. Errors of this type are very unlikely, can be ascertained only very hard and have with real time applications under circumstances fatal sequences. However, they may not be excluded for statistical reasons. Famous „falling down 1 bit “ in the memory or on the hard disk on grounds of the described influence explains, for example, such an error. Because the effects of such an error (e.g. Fall of the system or boot inability because a system file was damaged) by their other program error mostly only very hard can be distinguished, one often supposes another cause, particularly as such an error is not often reproduceable.
With some projects not the concept Bug is used, but one speaks, for example, of Metabugs with which a bug displays an element of a things-to-do list. With some projects one speaks, instead, also of "Issues" (matters), because this printout does not limit itself to program error.

In general is valid: The earlier in the process of development the error appears and is discovered the later he, becomes the more luxuriously it to repair the error.

During the planning
A good and suitable planning of the process of development is most important. For this there are already several action models from which a suitable one can be selected.

In the analysis phase
A problem is that the correctness of a programme can be proved only against an accordingly formalized specification. To create such a specification, nevertheless, can be complicated in particular cases alike and be error-laden, how the programming of the programme.

Among the rest, also the development of more and more abstract program paradigms and program styles like the function-oriented programming, object-oriented programming, design By Contract and the programming oriented to aspect serve the fault avoidance and simplification of the fault location. A suitable one is to be selected from the available technologies for the problem. However, on this occasion, an important dot is also that experienced programmers must be available for the respective paradigm, otherwise often there originates the contrary effect.

Further it very helps to let do many duties of the fault avoidance reliably and from the developing tools possibly automatically what is made easier, e.g., with the help of structured programming. This concerns on the one hand already controls like visibility rules and type security, as well as the avoidance of the circular reference which can be already taken over before the translation from programmes from the compiler, but also controls which can be carried out only at the run time, as for example index check with data fields or type check with objects of the object-oriented programming.

In the draught phase
Software experts agree about the fact that practically every non-trivial programme contains error. Therefore, technologies were developed to handle with errors within programmes tolerant. Defensive programmation, exception handling, redundancy and the monitoring of programmes (e.g., by Watchdog timer) as well as the Plausibilisierung of the programme during the development and the data during the program flow belong to these technologies.

Complete accuracy for software which crosses a certain complexity border is neither accessible nor provable. With rising complexity sinks the Überblickbarkeit, in particular also if several people are involved in the programming. Even expensive or often tested software contains without fail program error. Then one speaks with well useful programmes not of accuracy, but of stability and robustness. Software is valid then as stable or robust if errors appear as only very rare and bring these incommodities smaller only then with themselves and cause no bigger damages or losses.

In special cases a proof of the accuracy of a programme is possible. Besides, in particular in ranges in which the application is connected by software with high financial, economic or human risks, as for example with software used medically or militarily or in the aviation and astronautics, one uses a (formal) verification the called method with which the correctness of software is proved formal-mathematically. However, narrow limits are set because of the huge expenditure to this method and, hence, it is to be carried out with complicated programmes practically impossibly (see also computability). Indeed, there are meanwhile the tools which can produce this proof according to own entries at least for subranges (runtime error) fast and reliably.

Beside the mathematical verification there is still a form suited for practise of the verification which is described by the high-class management norm ISO in 9000. With her an error is stated only if a requirement is not fulfilled. Therefore, vice versa a result of working (and with it also software) can be designated perfect if it fulfils provably all demands. Besides, the fulfilment of a requirement is ascertained by tests. If all tests produce the expected result, a requirement is fulfilled.

Classification of errors

Appeared errors are edited generally in the error management systematically. Besides, after the IEEE norm in 1044 (classification of software anomalies) every error goes through a so-called classification process, consisting of four steps of detection (Recognition), analysis (Investigation), treatment (action) and end (arrangement). In each of these steps will identify the administration activities recording (Recording), classing (Classifying), effect (Identifying Impact) executed.

The criteria according to which errors can be classed, besides are among other things (with examples):

the kind of the error: Besides, after (are distinguished: Lexical errors (unknown relation), syntactic errors (forgotten semicolon), semantic errors (wrong declaration), runtime error (wrong formatted input data) and logical errors (plus instead of below, loop error, …)
the error cause: imprecise default, figure turner, wrong formula, not examined (wrong) input data …
the time of the error origin (false action‘): Already with the program target, in the code draught, while encoding, …
the time of the error appearance (error effect‘): A basic difference arises from whether the error appears during the program development, for example, with the testing (here this is a normal case) or in the productive company (where he often displays a critical disturbance).
the time of the discovery: The longer the "error residence time" is, the more luxuriously becomes i. A. the correction measure run.
the effect (en) of the error: Representation error, wrong result, blowup, outside effect …
Expenditure and duration to the troubleshooting: minimally … very high; immediately … very long duration;
Treatment state: appeared, examines, correction order in treatment, Retest possibly, …, does
With the help of metrics „the results [and cognition science about error] should also be an occasion for the search for the causes behind the problems“. „Error classifications form the basis for standardised procedures to the error handling and, besides, support a continuous high-class improvement for the purposes of the high-class management.“ Other entries error like a detailed error description, affected programmes, involved people accompany etc. The measures to the removal of the errors and document this. Further details see BITKOM guide.

Program errors become simplifying in the error treatment process often only after the error gravity, moreover, this encloses the error effect and the removal expenditure, in categories / classes like A, B, C … or 1, 2, 3 … etc. divided. Examples see BITKOM guide, in particular in the attachment.

Sequences of program errors
The sequences of program errors can be different extremely and show themselves in varied manner. If errors are discovered within the scope of the processes of development, the false success limits themselves, moreover, to the reworking of the software (code corrections, draught reworking, documentation …) – according to situation with more or less big effect on the project budget and the project period. Against it recognised errors look only in the productive company not seldom far more critical, for example, they can cause process disturbances or production shutdown, image damages cause, the loss of customers and markets cause, recourse duties release or bring even the enterprise in existence danger. Errors in technical applications can lead in the worst case to disasters.

Concrete examples of program error and their sequences are found in the list of program error examples.

Ability for reproduction of program errors
Some program errors are only extremely difficult or reproduceable not at all reliably. With the repetition of a before failed process under apparently unchanged conditions the probability is high that these errors do not express themselves once more. There are two possible reasons for this behaviour: On the one hand it can come for delays between the error activation and the problem appearing in the end, for example, to a program fall which veil the actual cause and complicate whose identification. On the other hand other elements of the software system (hardware, operating system, other programmes) can influence the behaviour of the errors in the looked programme. An example for this are errors, in nebenläufigen environments with lacking synchronisation (more exactly: Sequentialisierung) appear. Because of the race situations following out of this (Race Conditions) the processes can be processed in an order which leads to a runtime error. With a repetition of the same operation it is possible that the order of the processes is different and no problem appears.

Popular magazines