Beginning ColdFusion Debugging
Beginning
ColdFusion Debugging
Tips and Tricks
Bilal Soylu
CFinNC 2009
no notes exist for this slide
Agenda
Agenda
Definition / Why should we care
Debug Space (Avoidance vs Detection)
The Basic Tools (Tags, Software)
Making Errors and using CFTRY/CATCH
no notes exist for this slide
The Creds Slide
The Creds Slide
CTO Verian Technologies, Inc.
ColdFusion since mid 90âs beginning with Version 1.5
Certified Advanced CF Developer
Contributor to Brainbench CF 8 Exam
no notes exist for this slide
General Definition
General Definition
Definition 1
Detection and rectification of deficiencies in a software code that can cause it to crash, behave erratically, or be susceptible to cracker or hacker attack. In some cases it takes more time to debug a program than to write it. See also bug.
Definition 2
Detection and remedying of existing and potential errors in a product or system before its final acceptance or sale.
no notes exist for this slide
Debug Space My Definition
Debug Space (My Definition)
no notes exist for this slide
Why should we care
Why should we care
âAll software has bugsâ¦â
ââ¦Debugging the Most Time-Consuming Phase of Software Development Lifecycleâ¦â
(Business Wire)
(StackOverflow.com)
ï¨
Time
Frustration
Quality of Life ;o)
no notes exist for this slide
Avoidance Categories
Avoidance Categories
Peer Reviews:
My code is bug free and You are wrong !
Question Approach, Algorithm, Code Compliance
Standards and Practices
Why the flippâng âey do I need to change my code for anyways?
Frameworks
I like to copy and paste, itâs coolâ¦
The Docs Please
âI donât need to understand the business process, just need to write codeâ¦â
no notes exist for this slide
Detection Categories
Detection Categories
Areas
Syntax Errors
Missing attributes, misspelled commands, etc.
Runtime Errors
Exceptions (program ends prematurely etc.)
Logical Errors
Unexpected behaviors
Performance Related
Time / Throughput
no notes exist for this slide
Process Before Tools
Process Before Tools
Report Error conditions as soon as possible
Maximize presentation (ease of interpretation)
Calculate intermediate process values
Provide inputs and outputs in dumps
Minimize distractions (do not dump all)
Focus on Simplicity
Change one thing at a time
Eliminate the obvious first
no notes exist for this slide
Detection The Syntax
Detection: The Syntax
Using the Code Analyzers
ColdFusion Admin
Compile your Code
Using W3 compliance checkers
http://validator.w3.org/
Using IE 8
no notes exist for this slide
Detection Logic Errors
Detection: Logic Errors
Logic is all about understanding the program design and its algorithms
Tracing Program Steps and Changes as they occur
Some Tools
Documentation
Interactive Debugger
Review Debugging output
no notes exist for this slide
Detection Logic
Detection: Logic
How do you run CF?
Using the command window during development?
Especially for Flex and AMF messages
no notes exist for this slide
Detection Logic CFDUMP
Detection: Logic: CFDUMP
Old hat with new uses
Complex objects
Functions
Components
Java Classes
no notes exist for this slide
Slide 14
Detection: Logic
Reviewing Debug Options in CF
Reviewing CF Output
Summary
Tree
no notes exist for this slide
Slide 15
Detection: Logic
What if you are not there?
Using Logging
CFLOG is your friend
Using CFTrace (performance and logic)
no notes exist for this slide
CF Error Types
CF Error Types
Site wide error handling (CF and Application)
CFTRY / CATCH
application: catches application exceptions
database: catches database exceptions
template: catches ColdFusion page exceptions
security: catches security exceptions
object: catches object exceptions
missingInclude: catches missing include file exceptions
expression: catches expression exceptions
lock: catches lock exceptions
custom_type: catches the specified custom exception type that is defined in a cfthrow tag
searchengine: catches Verity search engine exceptions
any: catches all exception types
no notes exist for this slide
Logging with CF Catch
Logging with CF Catch
Examples
Precedence
Database Calls
no notes exist for this slide
QampA
Q&A
Contact
bilal.soylu@gmail.com
Blog
BonCode.blogspot.com
no notes exist for this slide
Detection Performance
Detection: Performance
Using the ColdFusion Monitor
Using and understanding Performance Counters
no notes exist for this slide