Friday, April 24, 2009

Handy hint for unit tests

We've got loads of unit tests. A run takes approximately 20 minutes.

This is because we've got a lot of database interaction, and the re-engineering effort required to go back and mock that all out is immense.

So, what's the best way to make sure you catch problems quickly?

In your AllTests.php, make it a policy to put new test suites at the top, rather than the bottom.


Basically:
    public static function suite() {
$suite = new PHPUnit_Framework_TestSuite();

$suite-<addTestSuite('NewTest');
$suite-<addTestSuite('CoreTest');

return $suite;
}


This is the opposite thinking than "write your most important test cases first", but it helps you find the newest broken features.

Reblog this post [with Zemanta]

ANZAC day, freebase

If you've got a freebase account, help add details to WWI soldiers.

Sunday, April 05, 2009

FOAF from Freebase

I made a quick FOAF from Freebase application.

Here's mine.

You just pass in an ID and out comes RDF/XML. It's limited to things typed as people.

This will help mend the gap between freebase RDF and common vocabularies, and was pretty easy to do - what other RDF vocabularies exist out there which would be nice to map onto freebase?