37
eXtreme Debugging! (with apologies to Kent Beck, et al) David T Watts CTO Fig Leaf Software 30 Jul 2000

eXtreme Debugging! (with apologies to Kent Beck, et al)

Embed Size (px)

DESCRIPTION

eXtreme Debugging! (with apologies to Kent Beck, et al). David T Watts CTO Fig Leaf Software 30 Jul 2000. What is eXtreme Debugging?. For the purposes of this demonstration, it’s debugging problems external to CF. Many common problems can’t be identified from within CF. - PowerPoint PPT Presentation

Citation preview

Page 1: eXtreme Debugging! (with apologies to Kent Beck, et al)

eXtreme Debugging!(with apologies to Kent Beck, et al)

David T Watts

CTO

Fig Leaf Software

30 Jul 2000

Page 2: eXtreme Debugging! (with apologies to Kent Beck, et al)

What is eXtreme Debugging? For the purposes of this demonstration, it’s

debugging problems external to CF. Many common problems can’t be identified

from within CF. This presentation will examine how to solve

common problems using third-party freeware and shareware tools.

This presentation focuses on NT, but there are analogues for Solaris, etc.

Page 3: eXtreme Debugging! (with apologies to Kent Beck, et al)

What we’ll look atOS permissions problemsHTTP & FTP protocol problemsProblems with external DLLsTesting COM objectsHelp Resources

Page 4: eXtreme Debugging! (with apologies to Kent Beck, et al)

OS permissions problems Most commonly encountered when using IIS

to control access via file ACLs Example:

virtual server authentication Problem:

Multiple web server authentication prompts; after several tries, access is allowed, but application doesn’t work correctly.

Page 5: eXtreme Debugging! (with apologies to Kent Beck, et al)

Permissions problems, cont’dCursory glance at directory ACLs looks

correct: authtest1 allows anonymous user, authtest2 allows DAVE\Users

Page 6: eXtreme Debugging! (with apologies to Kent Beck, et al)

Permissions problems, cont’d

Page 7: eXtreme Debugging! (with apologies to Kent Beck, et al)

Permissions problems, cont’d

Page 8: eXtreme Debugging! (with apologies to Kent Beck, et al)

Permissions problems, cont’dFor a quick determination of file ACL

problems, you can use the freeware NT File Monitor, from www.sysinternals.com. Registry permissions problems can be diagnosed with the NT Registry Monitor, also freeware.

Page 9: eXtreme Debugging! (with apologies to Kent Beck, et al)

Permissions problems, cont’d

Page 10: eXtreme Debugging! (with apologies to Kent Beck, et al)

HTTP & FTP protocol problemsSome problems between client and

server require viewing raw headers and data.

Problems may occur between end-user and server, or between one server acting as a client and another server.

Page 11: eXtreme Debugging! (with apologies to Kent Beck, et al)

HTTPAnalyzerHTTPAnalyzer is a freeware Windows

tool from http://www.coolfusion.com/ which shows HTTP request and response headers. Easy to use and effective for simply looking at headers.

Page 12: eXtreme Debugging! (with apologies to Kent Beck, et al)

HTTPAnalyzer

Page 13: eXtreme Debugging! (with apologies to Kent Beck, et al)

TelnetTelnet is available on practically every

TCP/IP-networked computer.Telnet can be used to build custom

HTTP requests and view and log responses.

Some telnet clients can be scripted.

Page 14: eXtreme Debugging! (with apologies to Kent Beck, et al)

Telnet

Page 15: eXtreme Debugging! (with apologies to Kent Beck, et al)

Netcat Common Windows telnet clients don’t work

very well, and can’t be scripted. Netcat, available for NT from

http://www.l0pht.com/~weld/netcat/ can be used to perform the same tasks as telnet, and more.

Netcat can redirect to and from files, and can be used to act as an HTTP client or server.

Page 16: eXtreme Debugging! (with apologies to Kent Beck, et al)

Netcat, cont’d Netcat usage:

nc [switches] [IP addr/host] [port] Switches:

-d detach from console-e execute (followed by command)-l listen-L listen and restart after termination-p listening port-t perform telnet negotiation-v verbose

Page 17: eXtreme Debugging! (with apologies to Kent Beck, et al)

Netcat, cont’dUsing Netcat as a client: This example

pipes a text file of HTTP request headers to Netcat.

Page 18: eXtreme Debugging! (with apologies to Kent Beck, et al)

Netcat, cont’d

Page 19: eXtreme Debugging! (with apologies to Kent Beck, et al)

Netcat, cont’d

Page 20: eXtreme Debugging! (with apologies to Kent Beck, et al)

Netcat, cont’dNetcat can also be used as a server;

this is useful for determining problems with file uploads and proprietary plugins. In this example, Netcat will return an HTTP response to any request on port 81.

Page 21: eXtreme Debugging! (with apologies to Kent Beck, et al)

Netcat, cont’d

Page 22: eXtreme Debugging! (with apologies to Kent Beck, et al)

Netcat, cont’d

Page 23: eXtreme Debugging! (with apologies to Kent Beck, et al)

Recording proxiesRecording proxies allow the easy

capture of multiple requests/responses between client and server.

Typically, a recording proxy requires that you modify the request to pass through the proxy.

Page 24: eXtreme Debugging! (with apologies to Kent Beck, et al)

Recording proxies, cont’d Freeware HTTP and FTP recording proxies

are available from http://www.compansr.demon.co.uk/. These proxies are Perl scripts, and require that Perl be installed on the machine that will act as the proxy (typically the requesting client).

These scripts record request headers, but not request bodies.

Page 25: eXtreme Debugging! (with apologies to Kent Beck, et al)

Recording proxies, cont’d

Page 26: eXtreme Debugging! (with apologies to Kent Beck, et al)

Recording proxies, cont’d

Page 27: eXtreme Debugging! (with apologies to Kent Beck, et al)

Recording proxies, cont’dLoad-test tools can also generally be

used as recording proxies; this is often how the load test script is created. These will record headers and bodies.

Page 28: eXtreme Debugging! (with apologies to Kent Beck, et al)

Working with external DLLsA DLL, such as a CFX component,

working on one machine may not work on another for no apparent reason.

Typically, this is caused by a dependency on a library found on the working machine, but not on the other.

Page 29: eXtreme Debugging! (with apologies to Kent Beck, et al)

External DLLs, cont’dYou can use Dependency Checker

(depends.exe) to determine what files are needed.

Dependency Checker is available in the Windows NT Resource Kit, Windows 2000 Support Tools (on the Win2K CD), and in Visual Studio.

Page 30: eXtreme Debugging! (with apologies to Kent Beck, et al)

Dependency Checker

Page 31: eXtreme Debugging! (with apologies to Kent Beck, et al)

Testing COM objects Many, but not all, COM objects can be used

from CF. COM objects often come with ASP sample

code, but this ASP code may hide some of the complexity behind the object’s usage (ex: authentication).

To separate object testing from web server issues, use Windows Script Host to automate the object, then convert the WSH test to CF iteratively.

Page 32: eXtreme Debugging! (with apologies to Kent Beck, et al)

Testing COM objects, cont’d

Page 33: eXtreme Debugging! (with apologies to Kent Beck, et al)

Help resourcesBeyond the standard resources for CF,

there are several that are useful to CF developers on NT.

Page 34: eXtreme Debugging! (with apologies to Kent Beck, et al)

Help resources, cont’d Windows NT/Windows 2000 Resource Kits IIS Resource Kit Windows 2000 Magazine Archive, available

on CD: http://www.win2000mag.com/ MSDN Library, available from Microsoft Microsoft Online Support: http://support.

microsoft.com/

Page 35: eXtreme Debugging! (with apologies to Kent Beck, et al)

General advice (a.k.a. common sense) Many problems require an approach outside of

the normal CF development process. Very few problems, however, are new to you!

Most of them have existing solution processes. Sometimes, the solution to a problem requires

“recasting” the problem to a different problem domain – in other words, looking at the process (“What am I trying to accomplish?”) rather than the implementation issues (“how do I do x?”).

Page 36: eXtreme Debugging! (with apologies to Kent Beck, et al)

General advice, cont’d A competent CF developer needs to know

more than just CF and SQL. Beyond development skills, CF developers

need to have a basic understanding of the OS they’re using, TCP/IP networking, and the HTTP protocol, among other things.

Iterative solutions make problem-solving easier. Problems that are purely “CF problems” can

easily be tested by any competent CF developer.

Page 37: eXtreme Debugging! (with apologies to Kent Beck, et al)

That’s all, folks!This presentation will be available

Monday from the CFUG section of the Fig Leaf site, and should be available from the CFUN2K site as well.

If there are any questions, please contact Dave Watts:[email protected]

Thanks, and have a nice day!