Most developers hate doing this but Microsoft has made it slightly easier with Internet Explorer Application Compatibility VPC Images. They have created virtual machines running IE6, IE7, IE8 & IE9 that you can download and run legally. You can download the images from Microsoft: http://www.microsoft.com/en-us/download/details.aspx?id=11575