

1. Psychic debugging
Coined by Raymond Chen (https://blogs.msdn.microsoft.com/oldnewthing) This may be an unfamiliar term for something we're all very familiar with in some form, and it tends to work best for smaller projects. Basically we draw on our experiences with prior projects and attempt to skim the project code, looking at high level functions to get a sense for the proper flow of the application, ignoring the specific details and assume each functions work as they should. This is where following coding standard really helps with assisting us in getting a quick idea of how the module work. This technique will often help expose issues relating to the logic of the application, such as a function meant to execute an update on a node when a node is deleted. More details on psychic debugging can be found here (https://blogs.msdn.microsoft.com/oldnewthing/20070423-00/?p=27163).2. Rubber duck debugging


3. Debugger assisted debugging
What if as a car mechanic, you had the full schematics to every car that came into your garage, and for every engine problem you could trace the passage of every droplet of gas from the gas tank to the combustion chamber, the expelling of the exhaust gas through the manifold out the tailpipe, and the ability to check the exact temperature, pressure, composition and other properties of every single component within the car, wouldn't that be helpful? That was the glorious revelation afforded to me, when during my junior years, a senior colleague did a presentation on the use of xdebug in debugging drupal modules. Previously I had been using dpm() to print statements and expose various variables as needed, but there were limitations with this approach and it was not nearly as comprehensive nor convenient as using a proper debugger such as provided by the popular IDE PhpStorm. With a debugger you're able to expose essentially all variables within the application, see the backtrace of a function call, and follow an interaction from the beginning to the end, and see exactly where the bug occurs and what caused it. I cannot espouse the virtues of incorporating a debugger into your daily workflow enough, and strongly encourage everyone to take the plunge and try it out. The set up of xdebug is dependant on a number of variables and beyond the scope of this post, but there are numerous resources that goes into great details on how to get started such as this awesome tutorial (https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm) by JetBrains, the developer of PhpStorm.
4. Call a friend
Tried and true, it's never a bad idea to get a second eye and perspective on a problem. Your friend may have run into similar cases in the past and can point out the issue right away, saving you valuable development hours! With the above techniques, hopefully you're able to figure out the issue, and if you wrote up a patch, be sure to post it back to the projects page!Last updated
Reading time
5 mins
You might also like
Working with colleges and universities for over 20 years
Featured on Inc. Power Partners list for 2023
We rank #1 Globally for Drupal Development and #1 in Canada for Web Development on Clutch
GreatPlacetoWork Certified since 2020, achieving #12 on the list of BestWorkplaces Canada in 2023
Expertise in optimizing your higher education site for inclusivity and accessibility for all users
Expertise in crafting user-centric information architecture
Awarded DotComm awards, AVA Digital Awards, Awwwards, Drupal Splash awards, Indigo Design Awards, and more.