Debugging - Best tools and practices

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
lockerrushing
Forum Newbie
Posts: 4
Joined: Thu Nov 20, 2008 3:24 pm

Debugging - Best tools and practices

Post by lockerrushing »

Hi,

Can anyone tell me if there is a way to output var_dump() or print to a console like a gdbp client? It just seems wrong to mix in debug info with the web app on screen.

Trying to understand the app I'm working with. Just want to be able to drop in dumps throughout the app and see what's going on through a separate console.

Any guidelines on the best practices for debugging. I have been trying to setup xdebug with eclipse, and I have to say the process for a noob sucks! Why does it have to be so freakin complex?!?

Also, any recommendations on the best ide? Is Zend studio better then PDT? Is Zend Debugger better then XDebug?

Thanks for any help!
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Debugging - Best tools and practices

Post by josh »

User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Re: Debugging - Best tools and practices

Post by Jenk »

Create yourself a print_debug() function and use that instead of var_dump() that way you've got a central location to change where it's output goes etc.

I must ask, however, just for clarity - is this regarding Legacy code (Legacy code is code that does not have accompanying Tests/Specs) or are we talking about 'debugging' tested code?

:)

As for IDE's, I've not used Zend, but I liked PDT (and Eclipse with SVN/FTP/etc plugins) a lot.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Debugging - Best tools and practices

Post by josh »

Eclipse has GUI debugging? I'd have to give it a whirl if it did. Heard good things about it
lockerrushing
Forum Newbie
Posts: 4
Joined: Thu Nov 20, 2008 3:24 pm

Re: Debugging - Best tools and practices

Post by lockerrushing »

Hey Jenk, thanks for the reply. I'm working with an open source shopping cart. Just trying to get a feeling for the inner workings. So if I understood correctly, I should make a custom dump function and redirect the dump to an external console? How exactly do I do that part of it?

Thanks
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Re: Debugging - Best tools and practices

Post by Jenk »

Dumping to the console won't be easy, dumping to a file would be much easier. If you're on *nix, you could `tail -f` the file in a terminal if you want a 'live feed' as it were.
Post Reply