Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Debugging Effectively - php[world] 2015

Software bugs are inevitable; some are especially difficult to track down, causing you to waste countless hours before throwing your hands up in defeat. It doesn't have to be this way! The mental fatigue and wasted time can be avoided by using strategies like identifying the most-appropriate tool, taking a logical & objective approach, challenging assumptions, listening to variables, isolating the code path, and reinforcing code with automated tests. Attendees will learn how to combine these techniques with the right mindset and attitude in order to debug their code quickly and effectively.

Immediate understanding of what type of problem, where it might be Like intuition, but not Understanding without proof, but based on logic and experience -- Focus on the process Experience and “sixth sense” will come with time

NEXT: Debugging process

And intermediate developers

BE NICE / CONSTRUCTIVE

TODO ADD NOTES

When you give up on the proper approach Apply workaround instead

Improper solutions will cause issues later

NEXT - EXAMPLE

First Magento client Ability to generate PDFs Base85-encoded

Don’t be clever

TRANSITION NEEDED!!

Magical thinking

Code is not a magic black box

Article

sneaky

Bugs are almost always based on faulty assumptions If you build on faulty assumptions

95% in your code

If helping others, assume their code is problem Challenge their assumptions Take with grain of salt

Define the symptoms

Collect everything you can

Automated tests preferred, but manual is okay too

LEGOS

Understand the fundamental nature Exactly why We’ll get into the tools & techniques

19.
“The bug is not moving around in your code,
trying to trick or evade you. It is just siting in
one place, doing the wrong thing in the same
way every time.” – Nick Parlante, Debugging Zen
Photo by GrahamC57 // cc by-nc-nd 2.0 // https://flic.kr/p/cwJi9Q