您如何重现偶尔发生的错误? [英] How do you reproduce bugs that occur sporadically?

查看:62
本文介绍了您如何重现偶尔发生的错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的应用程序中有一个bug不会每次都出现,因此我们不知道它的逻辑".我什至没有得到今天100次的复制.

We have a bug in our application that does not occur every time and therefore we don't know its "logic". I don't even get it reproduced in 100 times today.

免责声明:此错误存在,我已经看到了.它不是 pebkac 或类似的东西.

Disclaimer: This bug exists and I've seen it. It's not a pebkac or something similar.

重现这种错误的常见提示是什么?

What are common hints to reproduce this kind of bug?

推荐答案

成对分析问题并成对读取代码.记下您知道是真的问题,并尝试断言哪些逻辑先决条件必须才是正确的.遵循CSI等证据.

Analyze the problem in a pair and pair-read the code. Make notes of the problems you KNOW to be true and try to assert which logical preconditions must hold true for this happen. Follow the evidence like a CSI.

大多数人本能地说添加更多日志",这可能是一个解决方案.但是对于许多问题,这只会使情况变得更糟,因为日志记录可以充分改变时序依赖性,从而使问题或多或少地变得频繁.将频率从1000的1更改为1,000,000的1不会使您更接近问题的真正根源.

Most people instinctively say "add more logging", and this may be a solution. But for a lot of problems this just makes things worse, since logging can change timing-dependencies sufficiently to make the problem more or less frequent. Changing the frequency from 1 in 1000 to 1 in 1,000,000 will not bring you closer to the true source of the problem.

因此,如果您的逻辑推理不能解决问题,那么它可能会为您提供一些细节,您可以在代码中记录日志或声明后进行调查.

So if your logical reasoning does not solve the problem, it'll probably give you a few specifics you could investigate with logging or assertions in your code.

这篇关于您如何重现偶尔发生的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆