关闭

Error Handling and Debugging

标签: Debugging
501人阅读 评论(0) 收藏 举报
分类:

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.



0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:94960次
    • 积分:1114
    • 等级:
    • 排名:千里之外
    • 原创:30篇
    • 转载:15篇
    • 译文:0篇
    • 评论:9条
    最新评论