Interview Questions

Design Your Code for Simplicity and Reliability

Why are there Bugs in Software?


(Continued from previous question...)

Design Your Code for Simplicity and Reliability

After attitude and commitment, program design and structure have the biggest impact on defect-free code. A clean, well structured design simplifies producing reliable code. A poor design cripples the engineer, and will make it impossible to achieve defect-free code.

Each function should be precise -- it should have only one purpose. Each action or activity should be implemented in exactly one place. When programs are structured this way, the engineer can easily find the right place to make a change. In the unlikely event that a bug is discovered in testing, the engineer can go directly to the code with the defect and promptly correct it. This saves time and is the major cause of the faster schedules experienced with Defect-Free Software.

In addition to designing for clarity, it's important to keep the defect-free goal in mind. You want to choose designs that will be least likely to have bugs. In other words, avoid tricky code. Don't start to optimize code unless you are sure there is a performance problem.

(Continued on next question...)

Other Interview Questions