Error Handling and Debugging

Proactive Debugging

  • Comment, comment, comment. Put a lot of comments in your program. They tell other programmers what you did. They also tell you what you did. 
  • Use  a  single  macro  to   define  a  constant  value  that   is   or   may  be   reused   so   that   we  only   have  to   change   it   in   one  place.  
  • Use the "KISS" principle. (Keep It Simple, Stupid.) Clear and simple is better than complex and wonderful. 
  • Use the "DRY" principle.(Don't repeat youself.) Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
  • keep in mind "The Law of Least Astonishment," which states that your program should behave in a way that least astonishes the user.
  • Turn on all the warning flags, then make your program warning free. 
AS DEVELOPER
  • Baby  steps  for  the  engineer: test   the  code   every  20  to   50  lines
  • Regression testing: running  the  same  old  tests   on  new   pieces  of   code 

AS FINDER

  • Never  assume   anything.  Never  assume  that   the  tools   are  working  flawlessly.  Never assume   that   the  hardware   is   good. 
  • Never  changing   more  than   one  thing  at a  time
  • Write a  few   notes  about  what   change   was  made  and  what   behavior  was  observed

AS FIXER

  • provide  feedback to   the  engineer  or   engineering   group  that   introduced  the  bug.



阅读更多
文章标签: Debugging
个人分类: Debugging
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

Error Handling and Debugging

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭