A type of code
that, in its finished state
, does exactly what it was designed to do
, under all possible scenarios of underlying hardware
performing as they are expected to do
Note that what is bug-free code on one platform is not necessary bug-free code on any other platform, and the definition of bug-free code incorporates the platform it is designed to operate correctly on as a part of the design of what it was designed to do.
For example: If a piece of code is designed to only operate on Linux, then using Linux extensions to the C library is okay. However, if a piece of code is designed or intended to run on any platform other than Linux (say, Solaris, BSD, SCO, Alpha), the use of those extensions introduces bugs on those other platforms... and thus, the code is not bug-free code.