Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asked to fix bugs in a program, you find over 100 instances of

Tags:

catch(Exception ex) {  } 

What's the best way to proceed?

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

like image 733
karl.r Avatar asked Jun 12 '10 16:06

karl.r


People also ask

Which of the following is used to find and fix bugs in the program?

6) _____ is used to find and fix bugs in the Java programs. Explanation: The Java Debugger (JDB or jdb) is a command-line java debugger that debugs the java class. It is a part of the Java Platform Debugger Architecture (JPDA) that helps in the inspections and debugging of a local or remote Java Virtual Machine (JVM).

What is bug fixing in software testing?

What Does Bug Fix Mean? A bug fix is a change to a system or product designed to handle a programming bug/glitch. Many different types of programming bugs that create errors with system implementation may require specific bug fixes that are successfully resolved by a development or other IT team.

When a computer program has a lot of bugs we call IT?

Code defects is a more formal term, and "defects per 1,000 non-comment lines of source code" is a relatively common way of quantifying the bugginess of the software. Well this isn't really useful because "code defect" is a noun and -as you point out- "buggy" is an adjective.


2 Answers

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?

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...

like image 159
Jon Skeet Avatar answered Nov 17 '22 15:11

Jon Skeet


Fix the bugs that you were set out to do, and report the exception swallowing blocks as new, critical, bugs.

like image 20
Guffa Avatar answered Nov 17 '22 16:11

Guffa