Debug your Debugging Process

πŸ‘©πŸ½β€πŸ’»πŸ”πŸž

Cecelia Martinez

Community Lead, Replay.io

Women Who Code Front End Lead Volunteer

@ceceliacreates

Developers spend up to half their time debugging and maintaining software.

@ceceliacreates

@ceceliacreates

You need a process to debug effectively and efficiently.

@ceceliacreates

With a process, debugging can be a fun learning experience.

(Really!)

Debugging Process

  • Reproduce the issue
  • Identify expected behavior
  • Define the problem
  • Isolate the issue
  • Trace the root cause
  • Identify potential solutions

@ceceliacreates

Reproduce the issue

Recreate the issue in a debugging environment

  • Use a debugging recorder like Replay
  • Run version of codebase with bug locally
  • Create a minimal reproducible example using a code playground/sandbox

@ceceliacreates

Identify expected behavior

What is the application supposed to do instead?

  • A bug is a codingΒ error
  • UX issues or product requests are not bugs
  • What is the process when it works?

@ceceliacreates

Define the problem

What are we trying to fix?

  • How does the bug deviate from expected behavior?
  • Expected behavior: App validates credit card # is 16 digits before processing
  • Actual behavior: App tries to process credit card # with less than 16 digits and payment processor fails

@ceceliacreates

Isolate the issue

Where does the problem occur?

@ceceliacreates

⁉️

Isolate the issue

Where does the problem occur?

@ceceliacreates

  • Error message call stack
  • What lines of code executed
  • Validate working code

@ceceliacreates

Trace the root cause

Follow the code to the bug source

  • Validate code functionality at each step
  • Examine parameter values and types
  • Examine return values
  • Examine control flow logic
  • Identify when bug deviates from expectations

@ceceliacreates

Identify potential solutions

Where do we go from here?

  • Scope of the bug
  • Areas of the codebase impacted by changes
  • Larger underlying issues
  • Opportunity for improvement

@ceceliacreates

@ceceliacreates

Debug your Debugging Process

By Cecelia Martinez

Debug your Debugging Process

Investigating and fixing bugs in your application can feel like a frustrating and daunting process. With the right approach, debugging can actually help you better understand you codebase and be more confident to fix bugs fast.

  • 231