Should making debug-checklists be an essential part of development process? How it can be integrated with unit-tests?
Debugging checklist: Think about it as your troubleshooting checklist -- like what you do for your network connection, this time for your developers and your source code. For example if you're trying to access web via your web browser and you can't, then you'd probably go and check if you can load other websites or not, if not, then you'd check your internet/network connection, and so on.
Here if you have a team of multiple developers and you ran into a bug, you wouldn't just jump into the source code and try to debug it there, because someone else might changed the code and that might cause the problem. To spot the actual bug without a checklist, everybody needs to spend a lot of time looking at different things, probably in an unorganized way also.
For example we have a Map module in our software. If you're trying to use that module somewhere in the application and that doesn't work, then there is a small checklist to help you debug it faster:
- Check if the license exists in Dashboard/Settings/Map or in the database. Is that a valid license?
- What is the MapCenter? Is that a valid LatLng?
- What is the MapProjection?
- Can you reach the MapServer?
So, specially if you're new to the team/code, you can catch up with others much faster without spending hours trying to spot the cause of errors.
There are ways to do a better error handling -- like throw an exception for example if the MapServer is unreachable, however there are also situations that you still need to check different elements to make sure what exactly causing the error.
The question is: If I'm writing a sort function, and I know that you need to specify the correct encoding in order to get the correct result, should I write a checklist simply like this:
- Make sure you have set the proper encoding in configuration file.
If the above example could save myself or another developer 10-15 minutes of looking around to find the problem, should we make it mandatory for every developer to write this kind of checklists when they spot something that's potential to be source of a problem on a specific part of application later?