Skip to Content
程序员的38堂成长课
book

程序员的38堂成长课

by Pete Goodliffe
January 2022
Beginner to intermediate
314 pages
6h 55m
Chinese
Posts & Telecom Press
Content preview from 程序员的38堂成长课
68
10
10.3
 
bug
追踪
请注意上面这段代码中的
bug
。我只证明了代码是对的,但是没有试过。
——高德纳
现实一点儿,不管你的代码编写方法有多好,其中一些有害的
bug
总会设法突破防御。为
此你需要戴上程序员的狩猎帽并拿起捕捉
bug
的猎枪。那应该如何找到
bug
并消除它们
呢?这可能是一项艰巨的任务,就像大海捞针一样。或者,更准确地说,是在一堆针里寻
找某一根针。
发现并修复
bug
就像解决逻辑难题一样。一般来说,当有条有理地分析并解决问题时,这
并不难,因为大多数
bug
很容易定位并在几分钟内修复。然而,有些
bug
更复杂,修复它
们需要更长的时间。这些高难度
bug
的数量很少,但考虑到它们的性质,我们将把大部分
时间花在这上面。
一个
bug
的修复难度通常由两个因素决定。
是否容易复现。
软件缺陷(由一行错误的代码或一个错误的假设导致)进入代码的时间和你意识到它的
存在的时间之间的间隔。
当一个
bug
在这两个方面都得分很高时,如果没有得力的工具和敏锐的洞察力,你几乎不
可能找到它。有许多实用的技术和策略,可以帮我们解决难题和定位
bug
最重要的是系统地研究和分析
bug
。尽可能收集高质量的原始资料。
确定最简单的
复现步骤
是至关重要的。筛除所有与复现问题无关的细节,它们只会分散
你的注意力。
确保只关注一个问题。当你没有意识到自己把两个独立但相关的错误合并在一起时,很
容易陷入混乱。
确定问题的可重复性。复现步骤多久复现一次问题?它是否依赖于一系列简单的行动?
它是否取决于软件配置或正在运行的机器的类型 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey
Python应用开发指南

Python应用开发指南

Posts & Telecom Press, Ninad Sathaye
解密金融数据

解密金融数据

Justin Pauley

Publisher Resources

ISBN: 9787115577948