1. Computing
RTL reference|Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link To
 
Look Ma, I've found a BUG
How do you know if a bug in your Delphi application is really yours? Windows applications are NOT bug-free; Delphi is no exception to this rule.
 More of this Feature
Printer friendly versionPrinter friendly version
 Join the Discussion
"Post your views, comments, questions and doubts to this article."
Discuss!
 Related Resources
• Handling Access Violations
• Errors and Exceptions
• Delphi IDE tools
 Elsewhere on the Web
• The Delphi Bug List

In computer technology, a bug is a coding error in a computer program that causes an application to malfunction.

No matter how careful you are, a program you are currently developing will probably contain some bugs. Even if the code is perfect, it must be prepared to handle unexpected conditions such as missing files, network failure, and other applications using all of the system's resources.

Figuring out where you application crashed might take some time. Someone once wrote that "the most bug-free line of code is the one you don't have to write". This is true, but you might "write" a buggy Delphi application with no code at all. How's that? Delphi, as a Windows application, has its own bugs!
Yes that's true, even Delphi is not bug free.

Various bugs have various severity, some of the bugs have a workaround some of them have not. For example, the StateImage property for a TreeWiev will not display the 0th element in the TImageList. This bug is a just a basic IDE functionality failure - Delphi will still work. Another example of a bug in Delphi is more serious. Right click|New procedure in the Code Explorer while it is busy updating itself from a large file (e.g. Windows.Pas), generates AVs. After this, you'll need to restart Delphi.
The most serious bug is the one that crashes your program occasionally at run-time and when some special cases have occurred. For example, if a user passes a command line parameter to your program that is longer than 255 characters and then try to read this parameter using the ParamStr function an access violation will occur.

Note that the above bug examples might not exist in your (newer) Delphi version.

One excellent method of proactive error prevention is to always keep the current with all updates and patches for whatever edition and version of Delphi (BDE, ADO, ...) that you are using. Always have the latest patch for Delphi - the number of your programs bugs will drastically decrease.

The first question that pops up is: how do I know if a bug in my Delphi application is really "mine"?

   Borland's QualityCentral
"The QualityCentral project started (code named "BugCentral") as a community-based bug tracking system. It has evolved into a feedback application that has its own unique twist - it allows the entire Borland community to participate in a discussion with measurable value. There's not really a simple way to describe everything it does, but perhaps it can be summed up as a "request" box for Borland customers. When someone posts a "request," other community members can agree, disagree, rate, vote, or comment on that topic. These requests will be bug reports, feature suggestions, ideas for community articles, requests for content on the Borland web site, and so on"

Bug reports?
1. Any community member is able to submit a bug report for any product Borland is actively supporting.
2. When the "bug" is reported, it immediately becomes visible, and other commmunity members can provide feedback on it.
3. When the bug has been verified, communication among the reporter of the bug, Borland Developer Support, QA, and R&D can then be brokered by the application, so all people interested in the bug can track its progress.

This is what one "bug-report" looks like:

Report #: 9658
Status: Reported

Delphi 2005 Hangs when writing code

Project: Delphi Build #: 2005
Version: 2005
Submitted By: Jason Evans
Date Reported: 11/29/2004 3:42:32 AM
Report Type: Basic functionality failure
Severity: Critical / Show Stopper
Last Updated: 11/29/2004 4:32:20 AM
Platform: 95, 98, 2000, NT, XP
Internal Tracking #:
Resolution: None
Resolved in Build: None

Description:
Whenever I am writing code in the the Delphi 2005, after about 5 minutes of coding the IDE becomes unstable. I have to wait around 2-3 minutes before the code I have just written starts to appear in the editor window. Delphi is taking up my system resources, I have trouble switching to another application, and I can't switch back to Delphi until it has finished doing whatever it is that is causing to to stop responding.

   BugyJuice
Did you know? According to folklore, the first computer bug was an actual bug. Discovered by Lieutenant Grace Hopper in 1945 at Harvard, a moth trapped between two electrical relays of the Mark II Aiken Relay Calculator caused the whole machine to shut down.

All graphics (if any) in this feature created by Zarko Gajic.

 More Delphi
· Learn another routine every day - RTL Quick Reference.
· Download free source code applications and components.
· Talk about Delphi Programming, real time.
· Link to the Delphi Programming site from your Web pages.
· Tutorials, articles, tech. tips by date: 2001|2000|1999|1998 or by TOPIC.
· NEXT ARTICLE: Charting with Databases - DB/14.
Chapter fourteen of the free Delphi Database Course for beginners. Introducing the TDBChart component by integrating some basic charts into a Delphi ADO based application to quickly make graphs directly for the data in recordsets without requiring any code.
 Stay informed with all new and interesting things about Delphi (for free).
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?

©2013 About.com. All rights reserved.