SLIDE 1
The Exterminator's Tool Belt: Finding and eliminating bugs without - - PowerPoint PPT Presentation
The Exterminator's Tool Belt: Finding and eliminating bugs without - - PowerPoint PPT Presentation
The Exterminator's Tool Belt: Finding and eliminating bugs without staying up all night Allen Shaw (TwoMice) allen@emphanos.com Emphanos LLC, Chicago, IL 1 2 3 4 5 6 7 8 9 10 Examples 1 2 3 4 5 6 7 8 9 10 Examples 1 2 3 4 5 6 7 8
SLIDE 2
SLIDE 3
Examples
1 2 3 4 5 6 7 8 9 10
SLIDE 4
Examples
1 2 3 4 5 6 7 8 9 10
SLIDE 5
Examples
1 2 3 4 5 6 7 8 9 10
SLIDE 6
Best practices for debugging
1 2 3 4 5 6 7 8 9 10
- 1. Skepticism:
- 2. Pessimism:
- 3. Entitlement:
- 4. Impatience:
- 5. Laziness:
- 6. Ruthlessness:
SLIDE 7
Best practices for debugging
- 1. Skepticism: There probably isn't a bug.
- 2. Pessimism: It's probably the user's fault.
- 3. Entitlement: Surely somebody fixed it already.
- 4. Impatience: No time to keep testing this bug.
- 5. Laziness: Do no more than necessary.
- 6. Ruthlessness: Rip the code apart.
1 2 3 4 5 6 7 8 9 10
SLIDE 8
1 2 3 4 5 6 7 8 9 10
Tools for debugging
SLIDE 9
http://bit. ly/civicrm-debug- settings
1 2 3 4 5 6 7 8 9 10
- Smarty variables:
&smartyDebug=1
- Stack trace: &backtrace=1
- Session variables:
&sessionDebug=1
- CIVICRM_MAIL_LOG
- CIVICRM_DEBUG_LOG_QUERY
- CIVICRM_DAO_DEBUG
CiviCRM debug settings
SLIDE 10
Firebug
1 2 3 4 5 6 7 8 9 10
FireBug: Analyze DOM and network calls, analyze and execute JavaScript, all within the browser. Similar features available natively in Google Chrome.
http://getfirebug.com
SLIDE 11
FirePHP
1 2 3 4 5 6 7 8 9 10
FirePHP: Send debugging messages to Firebug from PHP.
http://firephp.org
SLIDE 12
A good IDE helps.
- NetBeans
- Eclipse
- Others?
Quickly navigate through unfamiliar code.
1 2 3 4 5 6 7 8 9 10
SLIDE 13
Devel module (Drupal)
- Easily examine
variables.
- Limit output via
Drupal permissions.
http://drupal.org/project/devel
1 2 3 4 5 6 7 8 9 10
SLIDE 14
Selenium IDE
- Script the browser to
perform the steps necessary to replicate a bug.
- Write regression tests
to ensure bugs stay gone.
http://seleniumhq.org
1 2 3 4 5 6 7 8 9 10
SLIDE 15
Hands on...
1 2 3 4 5 6 7 8 9 10
http://activities.civicon2013.localhost/ http://12269.civicon2013.localhost/ http://12014.civicon2013.localhost/
SLIDE 16
Thank you, questions welcome.
1 2 3 4 5 6 7 8 9 10
CiviCRM debug settings: http://bit.ly/civicrm-debug- settings Firebug: http://getfirebug.com FirePHP: http://firephp.org NetBeans: https://netbeans.org/ Eclipse: http://www.eclipse.org/ Devel module: http://drupal.org/project/devel Selnium: http://seleniumhq.org
Allen Shaw allen@emphanos.com Emphanos LLC, Chicago, IL