Q:

How to debug joomla components while developing them

I am writing my first joomla component and while I'm getting the hang of how joomla works, I don't know how I can effectively debug and run tests on my component before installing it in joomla. So my question is: How do you go about writing a joomla component. What parts should I write first and how do I test them?
Example: A component that gets information from database and displays it. How can I write the database part (model) and test it to see if it works as expected, without having to write the rest of the component (view and controller)?

A:

First you need to understand how to setup your machine for development. You don't need a complete component to install it on Joomla! 
This is by no means a complete answer, just a few directions which you can follow:
1. Developing - Understand how Joomla! works: as a beginner before going to much harder material, it's important to get your component to work first (starting isn't easy). Learn how to use the Joomla! Platform / Framework to build your components, check code in the core components.
2. Unit Testing - After you have a working component, if you want to test parts of it, do some search on the topic Unit Testing / PHPUnit. The article How to use PHPUnit in Joomla helped me a lot on how to test a method from a controller / model I've built.
3. Debugging your code - learn how to use a debugger in your IDE (like XDebug or Zend Debugger).
4. System Tests - in the end you may want to automate some tasks you do manually - have a look at Selenium WebDriver
A couple of resources:

Joomla! Official Documentation
Learn the Art of Joomla!® from master developer Andrew Eddie
Joomla! Programming - By Mark Dexter, Louis Landry

