Create a blank test.php

I usually do this for just code (no HTML):

add_action('template_redirect', 'test');

function test() {

    // code goes here

    die;
}

For dealing with HTML I prefer blank theme, set up for testing.

If you want to test in context of existing theme create custom page template, add/remove elements according to your needs and assign to test page.