Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. What is a bug?

What is a bug?

Scheduled Pinned Locked Moved The Lounge
helpquestionlearningpythonvisual-studio
37 Posts 24 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Marc Clifton

    I imagine we can all agree that a runtime error (something that blows up the program at runtime) or a logical error (doesn't blow up, but produces the wrong result) are bugs. Of course, there are other categories, like a "performance bug" -- produces the right result but takes too long. In any case... What about syntax errors -- those things that the compiler (or the IDE) detects before you even run the code, and in fact prevents you from running the code. Would you go so far as to say that syntax errors are a subset of what we call bugs? Or do you think that something can only be called a bug if it manifests when the program is run? Marc

    Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

    Mike HankeyM Offline
    Mike HankeyM Offline
    Mike Hankey
    wrote on last edited by
    #25

    An extract from a letter Thomas Edison wrote in 1878 to Theodore Puskas

    Quote:[^]

    '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.

    New version: WinHeist Version 2.2.2 Beta
    I told my psychiatrist that I was hearing voices in my head. He said you don't have a psychiatrist!

    1 Reply Last reply
    0
    • N Nish Nishant

      Technical requirements and business requirements have some overlap.

      Regards, Nish


      Website: www.voidnish.com Blog: voidnish.wordpress.com

      D Offline
      D Offline
      Dominic Burford
      wrote on last edited by
      #26

      Business requirements define "what" the system should do, while the technical requirements define "how" the system should met those requirements. And defining the binaries that are output is most definitely a technical requirement.

      "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare Home | LinkedIn | Google+ | Twitter

      1 Reply Last reply
      0
      • M Marc Clifton

        I imagine we can all agree that a runtime error (something that blows up the program at runtime) or a logical error (doesn't blow up, but produces the wrong result) are bugs. Of course, there are other categories, like a "performance bug" -- produces the right result but takes too long. In any case... What about syntax errors -- those things that the compiler (or the IDE) detects before you even run the code, and in fact prevents you from running the code. Would you go so far as to say that syntax errors are a subset of what we call bugs? Or do you think that something can only be called a bug if it manifests when the program is run? Marc

        Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

        R Offline
        R Offline
        Ravi Bhavnani
        wrote on last edited by
        #27

        It's unintended behavior that's not a feature. /ravi

        My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

        1 Reply Last reply
        0
        • L Lost User

          Marc Clifton wrote:

          What about syntax errors -- those things that the compiler (or the IDE) detects before you even run the code, and in fact prevents you from running the code.

          I would say no, that is not a bug. If it is then this is awesome code that simply has a bug that needs to be fixed.

          var godObject = new God();
          while(true)
          {
          godObject.DoWhatIsNeeded()
          }

          Thats right, god objects don't even care about semi colons they are rocking it so much. THey just go go go and do what is needed. I got your whole system right here. Can I get paid now? But seriously, no syntax errors are not bugs. A bug is a manifestation (i.e. observation) of a failure in a running system. Yes, this means that if it is not observed it is not a bug. Welcome to quantum physics and the world of programming where one persons bug is another persons feature.

          Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet. The interesting thing about software is it can not reproduce, until it can.

          K Offline
          K Offline
          Kevin Marois
          wrote on last edited by
          #28

          var godObject = new God();
          while(true)
          {
          godObject.DoWhatIsNeeded()
          }

          This is a compilation error... until you go back it add the missing semi-colon.

          If it's not broken, fix it until it is

          1 Reply Last reply
          0
          • M Marc Clifton

            I imagine we can all agree that a runtime error (something that blows up the program at runtime) or a logical error (doesn't blow up, but produces the wrong result) are bugs. Of course, there are other categories, like a "performance bug" -- produces the right result but takes too long. In any case... What about syntax errors -- those things that the compiler (or the IDE) detects before you even run the code, and in fact prevents you from running the code. Would you go so far as to say that syntax errors are a subset of what we call bugs? Or do you think that something can only be called a bug if it manifests when the program is run? Marc

            Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

            R Offline
            R Offline
            rob tillaart
            wrote on last edited by
            #29

            A bug is any unintended behaviour of the application. The intention of the application is defined in the requirements (I may hope) An application has 2 sides (more?) with unintended behaviour 1) unintended behaviour in the "eco system" aka computer [exobug] - behaviour that crashes the application itself - behaviour that crashes the OS and/or other applications - congests/blocks resources - CPU, memory, disk, network, GUI real estate, thread pool, battery, ... thereby interfering with other applications and/or the user. (can be acceptable, even the intention) 2) unintended behaviour wrt its intention [endobug] - generate completely wrong answers, - generate partly wrong answers, which might be acceptable (we do so with every float operation) - generate incomplete answers (what is given is right e.g. incomplete list of presidents) - generate answer too late, - generate too much information (overcomplete, the answer must be searched in the output) - generate the right answer when it is not supposed to (legal/permission/credential bug) A special kind of bug [releasebug] are features not meant to be released (e.g. not paid for) These can be especially costly when you wanted to patent them. - update - And you have bugs that corrupt your input data (or other data on the file system) while generating the correct result. e.g. a photo-editor that saves the modified picture under the source name.

            1 Reply Last reply
            0
            • M Marc Clifton

              I imagine we can all agree that a runtime error (something that blows up the program at runtime) or a logical error (doesn't blow up, but produces the wrong result) are bugs. Of course, there are other categories, like a "performance bug" -- produces the right result but takes too long. In any case... What about syntax errors -- those things that the compiler (or the IDE) detects before you even run the code, and in fact prevents you from running the code. Would you go so far as to say that syntax errors are a subset of what we call bugs? Or do you think that something can only be called a bug if it manifests when the program is run? Marc

              Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

              L Offline
              L Offline
              loctrice
              wrote on last edited by
              #30

              It's a moth[^]

              Elephant elephant elephant, sunshine sunshine sunshine

              1 Reply Last reply
              0
              • M Marc Clifton

                I imagine we can all agree that a runtime error (something that blows up the program at runtime) or a logical error (doesn't blow up, but produces the wrong result) are bugs. Of course, there are other categories, like a "performance bug" -- produces the right result but takes too long. In any case... What about syntax errors -- those things that the compiler (or the IDE) detects before you even run the code, and in fact prevents you from running the code. Would you go so far as to say that syntax errors are a subset of what we call bugs? Or do you think that something can only be called a bug if it manifests when the program is run? Marc

                Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

                Sander RosselS Offline
                Sander RosselS Offline
                Sander Rossel
                wrote on last edited by
                #31

                The more interesting question is "what do I tell my customers?" For example, the customer tells you "we want the name of the customer on our invoices." and you build exactly that. Now your customer calls and tells you the software doesn't work as expected. He created an invoice and it's addressed to "Higher Order Programming", but he had expected it to say "Marc Clifton"! "Well," you say "seems like we have ourselves a bug." However, classifying this as a bug makes it sound like it's YOUR fault (after all, bugs are made by programmers) while actually the specs were ambiguous (he had to specify the name of the person, not the company, a bug in the specs if you will). Calling the specs ambiguous may insult your customer. What is the correct thing to say, you don't want to take blame and you don't want to blame someone else? Perhaps "it seems there has been a misunderstanding, I can change it right away." Now what if you had made the application to print not any name on the invoice, but the price (where the name is supposed to be). Clearly that's not in the specs and it seems you actually have a bug. Can you tell the customer "we have a bug"? The word "bug" brings with it a negative annotation. Would it be better to tell the customer "it seems I've overlooked something" avoiding the words "bug", "error", "mistake", etc. I try to avoid the word as much as I can. "You're right, I'll change it right away!" seems like a good thing to say. Hearing you're right is always nice. Hearing that your problem will be fixed right away is also nice. The customer just forgot about the bug altogether and even though your software is buggy the customer is actually satisfied with your services! Answering your initial question, I don't think a syntax error is a bug, it's simply something you've overlooked :)

                Read my (free) ebook Object-Oriented Programming in C# Succinctly. Visit my blog at Sander's bits - Writing the code you need. Or read my articles here on CodeProject.

                Simplicity is prerequisite for reliability. — Edsger W. Dijkstra

                Regards, Sander

                M 1 Reply Last reply
                0
                • M Marc Clifton

                  I imagine we can all agree that a runtime error (something that blows up the program at runtime) or a logical error (doesn't blow up, but produces the wrong result) are bugs. Of course, there are other categories, like a "performance bug" -- produces the right result but takes too long. In any case... What about syntax errors -- those things that the compiler (or the IDE) detects before you even run the code, and in fact prevents you from running the code. Would you go so far as to say that syntax errors are a subset of what we call bugs? Or do you think that something can only be called a bug if it manifests when the program is run? Marc

                  Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

                  P Offline
                  P Offline
                  Peter R Fletcher
                  wrote on last edited by
                  #32

                  I take a slightly different approach, though I agree with others that a bug is something that appears in a running program - things (e.g. syntax errors) that I fix before the program goes anywhere don't count. For me, a bug is behavior that the programmer didn't intend (or, at least, shouldn't have intended!). Something happens that is not according to the specifications that (s)he understood and was working with. It needs to be fixed asap, and on the developer's dime. A deficiency is behavior that the designer of the program and/or the person writing the specifications didn't want or intend, but the code correctly represents the design and/or complies with the specifications. While this still may represent bad coding, it may also represent a failure of communication between the designer and the coder and/or between the customer and the developer. Deficiencies usually need to be fixed, and, since it is (IMHO) the developer's job to make sure that (s)he understands what the customer wants, it usually also gets done on the developer's dime. Some things that get labelled as bugs are really unimplemented features. When the customer sees a preliminary (or final!) version of the program, (s)he realizes that there was something that (s)he forgot to include in the specifications. These are not the developer's responsibility (to pay for), but it can sometimes be difficult to convince the customer of this!

                  1 Reply Last reply
                  0
                  • Sander RosselS Sander Rossel

                    The more interesting question is "what do I tell my customers?" For example, the customer tells you "we want the name of the customer on our invoices." and you build exactly that. Now your customer calls and tells you the software doesn't work as expected. He created an invoice and it's addressed to "Higher Order Programming", but he had expected it to say "Marc Clifton"! "Well," you say "seems like we have ourselves a bug." However, classifying this as a bug makes it sound like it's YOUR fault (after all, bugs are made by programmers) while actually the specs were ambiguous (he had to specify the name of the person, not the company, a bug in the specs if you will). Calling the specs ambiguous may insult your customer. What is the correct thing to say, you don't want to take blame and you don't want to blame someone else? Perhaps "it seems there has been a misunderstanding, I can change it right away." Now what if you had made the application to print not any name on the invoice, but the price (where the name is supposed to be). Clearly that's not in the specs and it seems you actually have a bug. Can you tell the customer "we have a bug"? The word "bug" brings with it a negative annotation. Would it be better to tell the customer "it seems I've overlooked something" avoiding the words "bug", "error", "mistake", etc. I try to avoid the word as much as I can. "You're right, I'll change it right away!" seems like a good thing to say. Hearing you're right is always nice. Hearing that your problem will be fixed right away is also nice. The customer just forgot about the bug altogether and even though your software is buggy the customer is actually satisfied with your services! Answering your initial question, I don't think a syntax error is a bug, it's simply something you've overlooked :)

                    Read my (free) ebook Object-Oriented Programming in C# Succinctly. Visit my blog at Sander's bits - Writing the code you need. Or read my articles here on CodeProject.

                    Simplicity is prerequisite for reliability. — Edsger W. Dijkstra

                    Regards, Sander

                    M Offline
                    M Offline
                    Marc Clifton
                    wrote on last edited by
                    #33

                    Sander Rossel wrote:

                    ow your customer calls and tells you the software doesn't work as expected. He created an invoice and it's addressed to "Higher Order Programming", but he had expected it to say "Marc Clifton"!

                    :) I had to deal with something like that recently (I posted about it a few days ago -- the issue came up on how my client was using the "search" feature) -- the response that I often end up giving is "well, right now it works this way" and they learn something new and potentially useful when using other websites/applications, along with "and I see your point as well, I'll make it work that way too." Then they're really happy, and I learn something too -- always remember that my concept of how something should work isn't necessarily my client's! When you think about it, any training manual is an attempt to coerce the user into the context that's been created, whereas a spec, before any code is written, is an attempt to create a shared and mutually agreed upon context. Usually specs fall short, so there's some adjustment that always ends having to be made later on. :) Marc

                    Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

                    1 Reply Last reply
                    0
                    • R raddevus

                      Very interesting question you pose. Would you track compiler errors in a bug tracking database? I would hope that no one ever has. As soon as I say that then someone is going to say, "what about the people who are writing code compilers?" :laugh: So, since you wouldn't really consider tracking compiler errors as you do other errors they probably should be ignored since you can't build the software to get it running without resolving them. Analogy Time Also, let's see if there is an analogy.... ...suppose the robots that are building the cars in an assembly line malfunction and start painting the cars multiple colors because the car has a design element which sticks out that inadvertently flips a switch as it travels down the assembly line. Would that be a bug in the car? Probably not.

                      My book, Launch Your Android App, is available at Amazon.com.

                      M Offline
                      M Offline
                      Member 10731944
                      wrote on last edited by
                      #34

                      I had the misfortune to work with a software development suite, back in my early years (around 1992-93) - where there was a bug in the compiler. We never exactly figured out the bug - but it manifested itself in a strange way. Basically, the error would only occur at run-time, but the error that was thrown made no sense for the line of code it was thrown at. If you then ran the code with the integrated debugging turned on, and stepped through the code to that line, it would pass just fine, and work as intended. If - after you exited the debugger - you then executed the code again, no error would be thrown. Only if you modified the code afterward and executed it again, would an error be generated (this time, on a different line, again unrelated to the error being thrown). We had to track that bug in our bug tracking system, but we never found out what was causing the bug in the compiler. We knew that the object code, though, that the debugger created (likely including the debugging symbols and other cruft needed to make stepping through the code, monitoring variables, establishing breakpoints, etc) worked fine, so as a part of our process at the time, we just included a comment detailing this info at the top of the code, so that we would remember to run a debug on it before shipping it out. Multiple phone calls and snail-mail letters (the internet wasn't a commercial thing back then) to the vendor of the system went completely unanswered, unfortunately. I ended up leaving the company a year or so later.

                      R 1 Reply Last reply
                      0
                      • M Member 10731944

                        I had the misfortune to work with a software development suite, back in my early years (around 1992-93) - where there was a bug in the compiler. We never exactly figured out the bug - but it manifested itself in a strange way. Basically, the error would only occur at run-time, but the error that was thrown made no sense for the line of code it was thrown at. If you then ran the code with the integrated debugging turned on, and stepped through the code to that line, it would pass just fine, and work as intended. If - after you exited the debugger - you then executed the code again, no error would be thrown. Only if you modified the code afterward and executed it again, would an error be generated (this time, on a different line, again unrelated to the error being thrown). We had to track that bug in our bug tracking system, but we never found out what was causing the bug in the compiler. We knew that the object code, though, that the debugger created (likely including the debugging symbols and other cruft needed to make stepping through the code, monitoring variables, establishing breakpoints, etc) worked fine, so as a part of our process at the time, we just included a comment detailing this info at the top of the code, so that we would remember to run a debug on it before shipping it out. Multiple phone calls and snail-mail letters (the internet wasn't a commercial thing back then) to the vendor of the system went completely unanswered, unfortunately. I ended up leaving the company a year or so later.

                        R Offline
                        R Offline
                        raddevus
                        wrote on last edited by
                        #35

                        Interesting story. In theory there are no exceptional cases, but there's always an exceptional case in practice, isn't there? :)

                        My book, Launch Your Android App, is available at Amazon.com.

                        1 Reply Last reply
                        0
                        • M Mandeep8

                          A bug is the failure of code to fulfill business requirements.

                          S Offline
                          S Offline
                          SeattleC
                          wrote on last edited by
                          #36

                          I think this is an excellent, succinct answer, though it doesn't completely capture the 'why' of bugs. A bug is a defect that has to be repaired before the program is in some sense perfect.

                          Mandeep8 wrote:

                          A bug is the failure of code to fulfill business requirements.

                          means the code is perfect if it perfectly fulfills business requirements. All kinds of run time errors keep the program from perfectly fulfilling business needs, though if the error is handled, the program may continue to fulfill some business needs. A compile error is a bug in this definition, since a program won't run if it doesn't compile. A program may run without error and still not fulfill business needs if it is incomplete or incorrect. This is a defect in design or implementation. Even if the program does exactly what its developer intends, if it doesn't meet the user's needs for which it was created, it may be said to be defective. This last kind of defect in design is the hardest kind for developers to get their heads around. It's not about what you intended, it's about what the user needed.

                          1 Reply Last reply
                          0
                          • M Marc Clifton

                            I imagine we can all agree that a runtime error (something that blows up the program at runtime) or a logical error (doesn't blow up, but produces the wrong result) are bugs. Of course, there are other categories, like a "performance bug" -- produces the right result but takes too long. In any case... What about syntax errors -- those things that the compiler (or the IDE) detects before you even run the code, and in fact prevents you from running the code. Would you go so far as to say that syntax errors are a subset of what we call bugs? Or do you think that something can only be called a bug if it manifests when the program is run? Marc

                            Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

                            M Offline
                            M Offline
                            maze3
                            wrote on last edited by
                            #37

                            have scanned some of the replies, i would say BUG is anything causing Unexpected or Unintended behaviour. Runtime errors can be expected and handled, as such not bug. but if expecting screen to scroll up when mouse wheel down, and instead does the opposite, that is a bug. unhandled errors, like the runtime ones you mention are the most obvious, but if documentation says input does not accept numbers, user inputs numbers and it causes runtime error, because code does not safely handle - that is NOT a bug. Bad input.

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups