11.07.2015 Views

Encyclopedia of Computer Science and Technology

Encyclopedia of Computer Science and Technology

Encyclopedia of Computer Science and Technology

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ulletin board systems 61bugs <strong>and</strong> debuggingIn general terms a bug is an error in a computer programthat leads to unexpected <strong>and</strong> unwanted behavior. (Lore hasit that the first “bug” was a burnt moth found in the relays<strong>of</strong> the early Mark I computer in the 1940s; however, as earlyas 1878 Thomas Edison had referred to “bugs” in the design<strong>of</strong> his new inventions.)<strong>Computer</strong> bugs can be divided into two categories: syntaxerrors <strong>and</strong> logic errors. A syntax error results fromfailing to follow a language’s rules for constructing statements,or from using the wrong symbol. For example, eachstatement in the C language must end with a semicolon.This sort <strong>of</strong> syntax error is easily detected <strong>and</strong> reported bymodern compilers, so fixing it is trivial.A logic error, on the other h<strong>and</strong>, is a syntactically validstatement that does not do what was intended. For example,if a C programmer writes:if Total = 100instead <strong>of</strong>if Total == 100the programmer may have intended to test the value <strong>of</strong> Totalto see if it is 100, but the first statement actually assigns thevalue <strong>of</strong> 100 to Total. That’s because a single equals sign inC is the assignment operator; testing for equality requiresthe double equals sign. Further, the error will result in theif statement always being true, because the truth value <strong>of</strong> anassignment is the value assigned (100 in this case) <strong>and</strong> anynonzero value is considered to be “true” (see branchingstatements).Loops <strong>and</strong> pointers are frequent sources <strong>of</strong> logical errors(see loop <strong>and</strong> pointers <strong>and</strong> indirection). The boundarycondition <strong>of</strong> a loop can be incorrectly specified (for example,< 10 when < = 10 is wanted). If a loop <strong>and</strong> a pointer orindex variable are being used to retrieve data from an array,pointing beyond the end <strong>of</strong> the array will retrieve whateverdata happens to be stored out there.Errors can also be caused in the conversion <strong>of</strong> data <strong>of</strong>different types (see data types). For example, in many languageimplementations the compiler will automatically convertan integer value to floating point if it is to be assignedto a floating point variable. However, while an integer canretain at least nine decimal digits <strong>of</strong> precision, a float mayonly be able to guarantee seven. The result could be a loss<strong>of</strong> precision sufficient to render the program’s results unreliable,particularly for scientific purposes.Debugging TechniquesThe process <strong>of</strong> debugging (identifying <strong>and</strong> fixing bugs) isaided by the debugging features integrated into most modernprogramming environments. Some typical featuresinclude the ability to set a breakpoint or place in the codewhere the running program should halt so the values <strong>of</strong> keyvariables can be examined. A watch can be set on specifiedcertain variables so their changing values will be displayedas the program executes. A trace highlights the source codeto show what statements are being executed as the programruns. (It can also be set to follow execution into <strong>and</strong> throughany procedures or subroutines called by the main code.)During the process <strong>of</strong> s<strong>of</strong>tware development, debuggingwill usually proceed h<strong>and</strong> in h<strong>and</strong> with s<strong>of</strong>tware testing.Indeed, the line between the two can be blurry. Essentially,debugging deals with fixing problems so that the programis doing what it intends to do, while testing determineswhether the program’s performance adequately meets theneeds <strong>and</strong> objectives <strong>of</strong> the end user.Further ReadingAgans, David J. Debugging: The Nine Indispensable Rules for FindingEven the Most Elusive S<strong>of</strong>tware <strong>and</strong> Hardware Problems. NewYork: AMACOM, 2002.Robbins, John. Debugging Applications. Redmond, Wash.: Micros<strong>of</strong>tPress, 2000.Rosenberg, Jonathan B. How Debuggers Work: Algorithms, DataStructures, <strong>and</strong> Architecture. New York: Wiley, 1996.bulletin board systems (BBS)An electronic bulletin board is a computer application thatlets users access a computer (usually with a modem <strong>and</strong>phone line) <strong>and</strong> read or post messages on a variety <strong>of</strong> topics.The messages are <strong>of</strong>ten organized by topic, resultingin threads <strong>of</strong> postings, responses, <strong>and</strong> responses to theresponses. In addition to the message service, many bulletinboards provide files that users can download, suchas games <strong>and</strong> other programs, text documents, pictures, orsound files. Some bulletin boards expect users to uploadfiles to contribute to the board in return for the privilege <strong>of</strong>downloading material.The earliest form <strong>of</strong> bulletin board appeared in the late1960s in government installations <strong>and</strong> a few universities participatingin the Defense Department’s ARPANET (the ancestorto the Internet). As more universities came online in theearly 1970s, the Netnews (or Usenet) system <strong>of</strong>fered a way touse UNIX file-transfer programs to store messages in topicalnewsgroups (see netnews <strong>and</strong> newsgroups). The newssystem automatically propagated messages (in the form <strong>of</strong> a“news feed”) from the site where they were originally postedto regional nodes, <strong>and</strong> from there throughout the network.By the early 1980s, a significant number <strong>of</strong> personalcomputer users were connecting modems to their PCs. Bulletinboard s<strong>of</strong>tware was developed to allow an operator(called a “sysop”) to maintain a bulletin board on his orher PC. Users (one or a few at a time) could dial a phonenumber to connect to the bulletin board. In 1984, programmerTom Jennings developed the Fido BBS s<strong>of</strong>tware, whichallowed participating bulletin boards to propagate postingsin a way roughly similar to the distribution <strong>of</strong> UNIX Netnewsmessages.Decline <strong>of</strong> the BBSIn the 1990s, two major developments led to a drastic declinein the number <strong>of</strong> bulletin boards. The growth <strong>of</strong> major servicessuch as America Online <strong>and</strong> CompuServe (see onlineservices) <strong>of</strong>fered users a friendlier user interface, a comprehensiveselection <strong>of</strong> forums <strong>and</strong> file downloads, <strong>and</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!