Kbase 13015: Tips for techniques on debugging and simplifying application
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
Tips for techniques on debugging and simplifying application
Last Changed: August 1994
1.0 EXAMINE THE EVIDENCE OF A PROBLEM
1.1 Can you reproduce it?
1.1.1 Consistently
1.1.2 Sporadically
1.1.3 Cannot reproduce
1.2 Can you force it NOT to occur? By doing what?
1.3 Is the application problem new, and if so, what changed?
- PROGRESS version updated? Check for new features with
conflicts between SCHEMA field or index names and new
keywords. Check for new bugs in PROGRESS (Tech Bulletin).
- Scripts? Check for PROPATH and startup option
modifications, e.g., -q affects which procedure is run.
- Configuration (runtime vs. full licenses)? Check for
session compile sub-procedure arguments such as
FOR EACH {1}: DISPLAY {1}.{2}. END.
- Deployment? Check for new connection options:
- Client vs. single user vs. server licenses
Check for operating system differences:
- 63k limit for some startup options
- Case sensitivity
- Non-binary file transfers of encrypted source code
- Data? Check for new data conditions not handled in
procedure (procedure logic bug not revealed before).
Check for production data volumes not tested for.
- Source code? Check for procedure logic bugs.
2.0 IDENTIFY LIKELY CAUSES BASED ON EXPERIENCE AS RELATED
TO THE EVIDENCE
- SOME AUTOMATED TOOLS AVAILABLE
- SOME "POOR MAN'S DEBUGGER" (MESSAGE, PAUSE,
V6's $DLC/prodict/dictrace.i)
Common sources of application problems
--------------------------------------
- Date conversions (First vs. Twentieth century)
DATE, DAY, MONTH, YEAR, TODAY, TIME, WEEKDAY
- Logicals (not really Boolean; PROGRESS's can also be unknown)
- Complex boolean logic (Nested/combined NOTs, ANDs, and ORs)
- Outlier data conditions
- negative numeric values
- the unknown value.
- Integer and decimal calculations and functions
TRUNCATE, DECIMAL, RANDOM, MODULO, EXP, LOG, ASC,
MINIMUM, MAXIMUM, CHR, ROUND, SQRT
- String manipulation
- Concatenation
- List and string functions
ASC, ENCODE, CHR, STRING, SUBSTRING,
OVERLAY, LC, CAPS, LENGTH, KEYWORD,
MATCHES, BEGINS, TRIM, FILL,
CAN-D0, INDEX, R-INDEX, ENTRY, NUM-ENTRIES, LOOKUP)
- IF ... THEN ... ELSE
- Lacking appropriate DO: ... END. blocking
- Lacking final ELSE to catch OTHERWISE conditions
- Deep block nesting
- Recursive programming (procedures that RUN themselves)
- Includes which include other includes
- Parameter and argument passing
- Case sensitivity
- Context sensitive application help (applhelp.p)
- Multiple database programming
- Alias usage
- Parent/child procedure connects
- Disconnect defaults
CONNECT, DISCONNECT, CONNECTED, CREATE ALIAS, DELETE ALIAS,
LDBNAME, PDBNAME, SDBNAME, DBNAME, DBRESTRICTIONS, USERID,
SETUSERID, DBTYPE, NUM-DBS, NUM-ALIASES, DBVERSION
- PROGRESS defaults taking over (Block processing services)
- Framing
- Lock status
- Record scope, Weak vs. Strong scoping statements
- Transaction scope,
esp., inherited transactions from parent procedures
- Field formats
- Concatenations
- LIKE used for shorthand rather than close linkage
between a dictionary field and the procedure variable
- Initial values
- Dictionary "Mandatory" attribute without Initial value unknown
- Indices lacking UNIQUE attribute
- PROGRESS limits exceeded or assumption of capabilities
- Data loads: embedded quotes, trying to load non-ASCII chars
- Record size
- Number of workfile records supported by -l buffer space
- Dataserver limitations
- Nested WAIT-FORs
- Non-modal updates (transaction)
- Modal vs. Event-Driven design considerations
- User Interface portability
- Focus
- New V7 PROGRESS Defaults, and sometimes lack thereof where
people expect them
- New Windows created
- Trigger - event pairing: database vs. session, by type,
especially trigger execution sequence
- Validation: VALIDATE clause or statement vs. database
trigger and tie-in to ENABLE statement
- Data type mismatch: SCREEN-VALUE _always_ returns a
character value
V6: DEF VAR x AS INT.
UPDATE x.
FIND customer WHERE cust-num = INPUT x.
vs.
V7: DEF VAR x AS INT.
UPDATE x.
FIND customer WHERE cust-num = INT(x).
- Third-party software capabilities and limits and proper usage
- Dynamic Link Libraries (DLLs)
- OLE (Object Link Embedding)
3.0 SIMPLIFY IN ORDER TO TEST FURTHER IF THE ABOVE LIST DOESN'T
LEAD YOU TO AN ANSWER
3.1 ENVIRONMENT
- Client / Server : Instead, run local self-served clients or
single user
- PROPATH : Eliminate multiple source code trees to confirm
which version of a procedure is being used
- Multiple database Connects : disconnect from any database
not expressly referenced in the procedure(s) you are testing
- Complex schema(s) : Create a test bed with only the
structures and data necessary to reproduce the problem
3.2 HARD-CODE KNOWN VALUES
- Variables
- Parameters and arguments
- Record keys
3.3 ELIMINATE/REDUCE INCLUDES
3.4 ISOLATE PROCEDURE WITHIN THE OVERALL APPLICATION
- Run the procedure from the editor rather than the
menu infrastructure
4.0 Version 7 PROGRESS: Using the DEBUGGER
4.1 Features and Functions
4.1.1 Application Control
4.1.2 Application Data Management
4.1.3 Execution Monitoring
4.1.4 Session Management and Information
4.2 How the Debugger Session Operates
4.2.1 Interaction Between Debugger and Client
4.2.2 Debugger and Application Control
4.3 Procedures and the Debugger Context
4.3.1 Debugger Context
4.3.2 Procedure Call Stack
Progress Software Technical Support Note # 13015