Software bug

From Wikipedia, the free encyclopedia

A software bug is  an error, flaw, mistake, failure, or  fault in a computer program that prevents it  from behaving as intended (e.g., producing an  incorrect result). Most bugs arise from mistakes and  errors made by people in either a program's source code or  its design, and  a few are  caused by compilers producing incorrect code. A program that contains a large number of bugs, and/or bugs that seriously interfere with its functionality, is  said to be buggy. Reports detailing bugs in a program are  commonly known as bug reports, fault reports, problem reports, trouble reports, change requests, and  so forth.

Bugs can have  a wide variety of effects, with varying levels of inconvenience to the user of the program. Some bugs have  only a subtle effect on the program's functionality, and  may thus lie undetected for a long time. more  serious bugs may cause the program to crash or  freeze. Other bugs lead to security problems; for example, a common type of bug which allows a buffer overflow may allow a malicious user to execute other programs that are  normally not allowed to run.

The results of bugs may be extremely serious. A bug in the code controlling the Therac-25 radiation therapy machine was directly responsible for some patient deaths and  in 1996, the European Space Agency's US$1 billion prototype Ariane 5 rocket was destroyed less  than a minute after launch, due to a bug in the on-board guidance computer program. In June 1994, a Royal Air Force Chinook crashed into the Mull of Kintyre, killing 29. This was initially dismissed as pilot error, but an  investigation by Computer Weekly uncovered sufficient evidence to convince a House of Lords enquiry that it  may have  been caused by a software bug in the aircraft's FADEC. [2] [3]

Contents

[edit] Etymology

The concept that software might contain errors dates back to 1842 in Ada Byron's notes on the analytical engine in which she speaks of the difficulty of preparing program 'cards' for Charles Babbage's Analytical engine:

   
“
...an analysing process must equally have  been performed in order to furnish the Analytical Engine with the necessary operative data; and  that herein may also lie a possible source of error. Granted that the actual mechanism is  unerring in its processes, the cards may give it  wrong orders.
   
”

Usage of the term "bug" to describe inexplicable defects has been a part of engineering jargon for many decades and  predates computers and  computer software; it  may have  originally been used in hardware engineering to describe mechanical malfunctions. For instance, Thomas Edison wrote the following words in a letter to an  associate in 1878:

   
“
It has been just so in all of my inventions. The first step is  an intuition, and  comes with a burst, then difficulties arise—this thing gives out and  [it is] then that "Bugs"—as such little faults and  difficulties are  called—show themselves and  months of intense watching, study and  labor are  requisite before commercial success or  failure is  certainly reached.[1]
   
”

Problems with radar electronics during World War II were referred to as bugs (or glitches), and  there is  additional evidence that the usage dates back much earlier.

 is  possibly the first actual bug found in a computer.">Photo of what<a
 href= is  possibly the first actual bug found in a computer." width="250" height="208" longdesc="../../../h/9/6/Image%7EH96566k.jpg_7d82.html" />
Enlarge
Photo of what is  possibly the first actual bug found in a computer.

The invention of the term is  often erroneously attributed to Grace Hopper, who publicized the cause of a malfunction in an  early electromechanical computer. A typical version of the story is  given by this quote:

   
“
In 1946, when Hopper was released from active duty, she joined the Harvard Faculty at the Computation Laboratory where she continued her work on the Mark II and  Mark III. Operators traced an  error in the Mark II to a moth trapped in a relay, coining the term bug. This bug was carefully removed and  taped to the log book September 9th 1945. Stemming from the first bug, today we call errors or  glitch's [sic] in a program a bug. [2]
   
”

Hopper was not actually the one who found the insect, as she readily acknowledged. and  the date was September 9, 1947, not of 1945 [4] [5]. The operators who did find it  (including William "Bill" Burke, later of the Naval Weapons Laboratory, Dahlgren Va. [3]), were familiar with the engineering term and, amused, kept the insect with the notation "First actual case of bug being found." Hopper loved to recount the story. [6]

While it  is certain that the Mark II operators did not coin the term "bug", it  has been suggested that they did coin the related term, "debug".

[edit] Prevention

It can be psychologically difficult for some engineers to accept that their design contains bugs. They may hide behind euphemisms like "issues" or  "unplanned/unexpected/undocumented features". This is  also true of corporate software where a fix for a bug is  often called "a reliability enhancement".

Bugs are  a consequence of the nature of the programming task. Some bugs arise from simple oversights made when computer programmers write source code carelessly or  transcribe data incorrectly. Many off-by-one errors fall into this category. Other bugs arise from unintended interactions between different parts of a computer program. This happens because computer programs are  often complex, often having been programmed by several different people over a great length of time, so that programmers are  unable to mentally keep track of every possible way in which different parts can interact. Many race condition bugs fall into this category.

The computer software industry has put a great deal of effort into finding methods for preventing programmers from inadvertently introducing bugs while writing software. These include:

Programming style 
Bugs are  often created by typos that are  not caught by the compiler. Some innovations to programming style such as indentation, clearly-distinguished variable names, vertically aligning similar blocks, and  so forth, are  designed to make these bugs less  likely, or  easier to spot. In curly bracket programming languages, it  has become common for style documents to require that even where optional, curly brackets be placed after all control flow constructs. This prevents program-flow bugs which can be very time-consuming to track down, such as where a terminating semicolon is  introduced at the end of the construct (a common typo); where another line is  added before the first; or  where the following line may be removed by the preprocessor. Other examples of using style to prevent bugs include placing constants on the left hand side in comparisons, (which causes a syntax error in the case of the common typo of replacing the comparison operator "==" with the assignment operator "="); placing a comma after even the last element of a list, and  the last line in a block, where these are  normally optional; etc.
Programming techniques 
Bugs often create inconsistencies in the internal data of a running program. Programs can be written to check the consistency of their own internal data while running. If an  inconsistency is  encountered, the program can immediately halt, so that the bug can be located and  fixed. Alternatively, the program can simply inform the user, attempt to correct the inconsistency, and  continue running.
Development methodologies 
There are  several schemes for managing programmer activity, so that fewer bugs are  produced. Many of these fall under the discipline of software engineering (which addresses software design issues as well.) For example, formal program specifications are  used to state the exact behavior of programs, so that design bugs can be eliminated.
Programming language support 
Programming languages often include features which help programmers deal with bugs, such as exception handling. In addition, many recently-invented languages have  deliberately excluded features which can easily lead to bugs. For example, the Java programming language does not support pointer arithmetic.

[edit] Debugging

 is  unconfirmed. A reproduced bug is  a confirmed bug. The confirmed bugs are  later fixed. Bugs, belonging to other categories (unreproducible, will not be fixed, etc) are  usually in the minority">The typical bug history (GNU Classpath project data). A bug, submitted by the user,<a
 href= is  unconfirmed. A reproduced bug is  a confirmed bug. The confirmed bugs are  later fixed. Bugs, belonging to other categories (unreproducible, will not be fixed, etc) are  usually in the minority" width="350" height="291" longdesc="../../../c/l/a/Image%7EClasspath_bugs.png_5c60.html" />
Enlarge
The typical bug history (GNU Classpath project data). A bug, submitted by the user, is  unconfirmed. A reproduced bug is  a confirmed bug. The confirmed bugs are  later fixed. Bugs, belonging to other categories (unreproducible, will not be fixed, etc) are  usually in the minority
Main article: Debugging

Finding and  fixing bugs, or  "debugging", has always been a major part of computer programming. Maurice Wilkes, an  early computing pioneer, described his realization in the late 1940s that much of the rest of his life would be spent finding mistakes in his own programs. As computer programs grow more  complex, bugs become more  common and  difficult to fix. Often programmers spend more  time and  effort finding and  fixing bugs than writing new code.

Usually, the most difficult part of debugging is  locating the erroneous part of the source code. Once the mistake is  found, correcting it  is usually easy. Programs known as debuggers exist to help programmers locate bugs. However, even with the aid of a debugger, locating bugs is  something of an  art.

Typically, the first step in locating a bug is  finding a way to reproduce it  easily. Once the bug is  reproduced, the programmer can use a debugger or  some other tool to monitor the execution of the program in the faulty region, and  find the point at which the program went astray. Sometimes, a bug is  not a single flawed instruction, but represents an  error of thinking or  planning on the part of the programmer. Such logic errors require a section of the program to be overhauled or  rewritten.

It is  not always easy to reproduce bugs. Some bugs are  triggered by inputs to the program which may be difficult for the programmer to re-create. One cause of the Therac-25 radiation machine deaths was a bug that occurred only when the machine operator very rapidly entered a treatment plan; it  took days of practice to become able to do this, so the bug did not manifest in testing or  when the manufacturer attempted to duplicate it. Other bugs may disappear when the program is  run with a debugger; these are  heisenbugs (humorously named after the Heisenberg uncertainty principle.)

Debugging is  still a tedious task requiring considerable manpower. Since the 1990s, particularly following the Ariane 5 Flight 501 disaster, there has been a renewed interest in the development of effective automated aids to debugging. For instance, methods of static code analysis by abstract interpretation have  already made significant achievements, while still remaining much of a work in progress.

[edit] Famous computer bugs

[edit] Space exploration

[edit] Medical

  • The Therac-25 accidents (1985-1987), quite possibly the most serious computer-related failure ever in terms of human life (three died, at least three more  were injured).

[edit] Computing

[edit] Electric power transmission

[edit] Telecommunications

[edit] Military

[ and  video games">edit]  and  video games">Computer and  video games

[ and  security holes">edit] Modern bugs and  security holes

While people would like bugs to be fixed before a new release, it  is common practice for software to be released with known, but considered non-critical, bugs. While software products contain an  unknown number of unknown bugs when shipped, measurements during the testing may provide a statistically reliable estimate of the number of likely bugs remaining.

[edit] Security vulnerabilities

Also known as security holes. Many computer systems are  able to be infected by viruses. Viruses exploit known vulnerabilities in the system - which may or  may not be bugs. Viruses are  not bugs in themselves - they are  typically programs that are  doing precisely what they were designed to do. However, viruses are  occasionally referred to as such in the popular press.

Although all operating systems are  vulnerable to viruses, most virus writers only target (write viruses for) operating systems with large userbases, such as various Windows versions, so as to maximize the virus distribution and  damages caused by the virus.

[edit] Common types of computer bugs

[edit] See also

[edit] Notes

  1. ^ Edison to Puskas, 13 November 1878, Edison papers, Edison National Laboratory, U.S. National Park Service, West Orange, N.J., cited in Thomas P. Hughes, American Genesis: A History of the American Genius for Invention, Penguin Books, 1989, ISBN 0-14-009741-4, on page 75.
  2. ^ Danis, Sharron Ann: "Rear Admiral Grace Murray Hopper"[1]
  3. ^ IEEE Annals of the History of Computing, Vol 22 Issue 1, 2000

[edit] External links

STATIC WIKIPEDIA JUNE 2008 on wikipedia2006.classicistranieri.com

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu

STATIC WIKIPEDIA MARCH 2008 on wikipeda2006classicistranieri.com
aa, ab, af, ak, als, am, an, ang, ar, arc, as, ast, av, ay, az, ba, bar, bat_smg, be, bg, bh, bi, bm, bn, bo, bpy, br, bs, bug, bxr, ca, cbk_zam, cdo, ce, ceb, ch, cho, chr, chy, closed_zh_tw, co, cr, cs, csb, cu, cv, cy, da, de, diq, dv, dz, ee, el, eml, en, eo, es, et, eu, fa, ff, fi, fiu_vro, fj, fo, fr, frp, fur, fy, ga, gd, gl, glk, gn, got, gu, gv, ha, haw, he, hi, ho, hr, hsb, ht, hu, hy, hz, ia, id, ie, ig, ii, ik, ilo, io, is, it, iu, ja, jbo, jv, ka, kg, ki, kj, kk, kl, km, kn, ko, kr, ks, ksh, ku, kv, kw, ky, la, lad, lb, lbe, lg, li, lij, lmo, ln, lo, lt, lv, map_bms, mg, mh, mi, mk, ml, mn, mo, mr, ms, mt, mus, my, mzn, na, nah, nap, nds, nds_nl, ne, new, ng, nl, nn, no, nov, nrm, nv, ny, oc, om, or, os, pa, pag, pam, pap, pdc, pi, pih, pl, pms, ps, pt, qu, rm, rmy, rn, ro, roa_rup, roa_tara, ru, ru_sib, rw, sa, sc, scn, sco, sd, se, searchcom, sg, sh, si, simple, sk, sl, sm, sn, so, sq, sr, ss, st, su, sv, sw, ta, te, test, tet, tg, th, ti, tk, tl, tlh, tn, to, tokipona, tpi, tr, ts, tt, tum, tw, ty, udm, ug, uk, ur, uz, ve, vec, vi, vls, vo, wa, war, wo, wuu, xal, xh, yi, yo, za, zea, zh, zh_classical, zh_min_nan, zh_yue, zu.

STATIC WIKIPEDIA APRIL 2007 on wikipeda2006classicistranieri.com
aa, ab, af, ak, als, am, an, ang, ar, arc, as, ast, av, ay, az, ba, bar, bat_smg, be, bg, bh, bi, bm, bn, bo, bpy, br, bs, bug, bxr, ca, cbk_zam, cdo, ce, ceb, ch, cho, chr, chy, closed_zh_tw, co, cr, cs, csb, cu, cv, cy, da, de, diq, dv, dz, ee, el, eml, en, eo, es, et, eu, fa, ff, fi, fiu_vro, fj, fo, fr, frp, fur, fy, ga, gd, gl, glk, gn, got, gu, gv, ha, haw, he, hi, ho, hr, hsb, ht, hu, hy, hz, ia, id, ie, ig, ii, ik, ilo, io, is, it, iu, ja, jbo, jv, ka, kg, ki, kj, kk, kl, km, kn, ko, kr, ks, ksh, ku, kv, kw, ky, la, lad, lb, lbe, lg, li, lij, lmo, ln, lo, lt, lv, map_bms, mg, mh, mi, mk, ml, mn, mo, mr, ms, mt, mus, my, mzn, na, nah, nap, nds, nds_nl, ne, new, ng, nl, nn, no, nov, nrm, nv, ny, oc, om, or, os, pa, pag, pam, pap, pdc, pi, pih, pl, pms, ps, pt, qu, rm, rmy, rn, ro, roa_rup, roa_tara, ru, ru_sib, rw, sa, sc, scn, sco, sd, se, searchcom, sg, sh, si, simple, sk, sl, sm, sn, so, sq, sr, ss, st, su, sv, sw, ta, te, test, tet, tg, th, ti, tk, tl, tlh, tn, to, tokipona, tpi, tr, ts, tt, tum, tw, ty, udm, ug, uk, ur, uz, ve, vec, vi, vls, vo, wa, war, wo, wuu, xal, xh, yi, yo, za, zea, zh, zh_classical, zh_min_nan, zh_yue, zu.

STATIC WIKIPEDIA DECEMBER 2006 on wikipeda2006classicistranieri.com
aa, ab, af, ak, als, am, an, ang, ar, arc, as, ast, av, ay, az, ba, bar, bat_smg, be, bg, bh, bi, bm, bn, bo, bpy, br, bs, bug, bxr, ca, cbk_zam, cdo, ce, ceb, ch, cho, chr, chy, closed_zh_tw, co, cr, cs, csb, cu, cv, cy, da, de, diq, dv, dz, ee, el, eml, en, eo, es, et, eu, fa, ff, fi, fiu_vro, fj, fo, fr, frp, fur, fy, ga, gd, gl, glk, gn, got, gu, gv, ha, haw, he, hi, ho, hr, hsb, ht, hu, hy, hz, ia, id, ie, ig, ii, ik, ilo, io, is, it, iu, ja, jbo, jv, ka, kg, ki, kj, kk, kl, km, kn, ko, kr, ks, ksh, ku, kv, kw, ky, la, lad, lb, lbe, lg, li, lij, lmo, ln, lo, lt, lv, map_bms, mg, mh, mi, mk, ml, mn, mo, mr, ms, mt, mus, my, mzn, na, nah, nap, nds, nds_nl, ne, new, ng, nl, nn, no, nov, nrm, nv, ny, oc, om, or, os, pa, pag, pam, pap, pdc, pi, pih, pl, pms, ps, pt, qu, rm, rmy, rn, ro, roa_rup, roa_tara, ru, ru_sib, rw, sa, sc, scn, sco, sd, se, searchcom, sg, sh, si, simple, sk, sl, sm, sn, so, sq, sr, ss, st, su, sv, sw, ta, te, test, tet, tg, th, ti, tk, tl, tlh, tn, to, tokipona, tpi, tr, ts, tt, tum, tw, ty, udm, ug, uk, ur, uz, ve, vec, vi, vls, vo, wa, war, wo, wuu, xal, xh, yi, yo, za, zea, zh, zh_classical, zh_min_nan, zh_yue, zu.

STATIC WIKIPEDIA NOVEMBER 2006 on wikipeda2006classicistranieri.com
aa, ab, af, ak, als, am, an, ang, ar, arc, as, ast, av, ay, az, ba, bar, bat_smg, be, bg, bh, bi, bm, bn, bo, bpy, br, bs, bug, bxr, ca, cbk_zam, cdo, ce, ceb, ch, cho, chr, chy, closed_zh_tw, co, cr, cs, csb, cu, cv, cy, da, de, diq, dv, dz, ee, el, eml, en, eo, es, et, eu, fa, ff, fi, fiu_vro, fj, fo, fr, frp, fur, fy, ga, gd, gl, glk, gn, got, gu, gv, ha, haw, he, hi, ho, hr, hsb, ht, hu, hy, hz, ia, id, ie, ig, ii, ik, ilo, io, is, it, iu, ja, jbo, jv, ka, kg, ki, kj, kk, kl, km, kn, ko, kr, ks, ksh, ku, kv, kw, ky, la, lad, lb, lbe, lg, li, lij, lmo, ln, lo, lt, lv, map_bms, mg, mh, mi, mk, ml, mn, mo, mr, ms, mt, mus, my, mzn, na, nah, nap, nds, nds_nl, ne, new, ng, nl, nn, no, nov, nrm, nv, ny, oc, om, or, os, pa, pag, pam, pap, pdc, pi, pih, pl, pms, ps, pt, qu, rm, rmy, rn, ro, roa_rup, roa_tara, ru, ru_sib, rw, sa, sc, scn, sco, sd, se, searchcom, sg, sh, si, simple, sk, sl, sm, sn, so, sq, sr, ss, st, su, sv, sw, ta, te, test, tet, tg, th, ti, tk, tl, tlh, tn, to, tokipona, tpi, tr, ts, tt, tum, tw, ty, udm, ug, uk, ur, uz, ve, vec, vi, vls, vo, wa, war, wo, wuu, xal, xh, yi, yo, za, zea, zh, zh_classical, zh_min_nan, zh_yue, zu.