当被问及修复程序中的错误,你发现了超过100个实例 [英] Asked to fix bugs in a program, you find over 100 instances of

查看:144
本文介绍了当被问及修复程序中的错误,你发现了超过100个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

catch(Exception ex)
{

}

什么是前进的最好方法是什么?

What's the best way to proceed?

瑞普他们都出去,让它崩溃? 添加日志code?消息框? 这是在C#。

Rip them all out and let it crash? Add logging code? Message boxes? This is in C#.

推荐答案

这一定程度上取决于你如何侵略性是。这是应用程序内部或外部的?将您的更改将在现场系统部署快?你有没有具体的bug修复,还是仅仅视为是一场灾难?

It partly depends on how aggressive you can be. Is this app internal or external? Will your changes be deployed on live systems soon? Do you have specific bugs to fix, or is it just deemed to be a disaster?

要减少错误尽可能快地算,但严重损害的威胁最大,只是删除所有的catch块,让异常冒泡。对于一个更微妙的方式,只需要添加记录的开始。

To reduce the bug count as quickly as possible, but with the most risk of serious damage, just remove all the catch blocks and let exceptions bubble up. For a much more delicate approach, just add logging to start with.

您也应该向谁写的应用程序入手,如果可能的话。尝试找出的为什么的他们已经得到了这么多的异常吞咽块。难道他们真的明白,在所有异常?将一定量的机智这里是必要的,我怀疑:)

You should also talk to whoever wrote the app to start with, if possible. Try to find out why they've got so many exception-swallowing blocks. Do they really understand exceptions at all? A certain amount of tact is necessary here, I suspect :)

下一站:单元测试...

Next stop: unit tests...

这篇关于当被问及修复程序中的错误,你发现了超过100个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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