Gene Manipulation == Software Engineering?

Posted on September 29, 2008

According to Michael Crichton, it is true.

“In reality, the task of injecting a gene into an animal and making it work more closely resembled debugging a computer program that it did any biological process. You had to keep fixing the errors, making adjustments, eliminating unwanted effects, until you got the thing working. And then you had to wait for downstream effects to show up, sometimes years later.”

Crichton writes this in Next, his fictional book covering many of the topics and themes associated with genetic science. Pretty cool book, and a reminder of how capable a good author is of mixing fiction, with fact to push there view on specific subjects.

Anyway, I thought it very insightful of Crichton to pair genetic manipulation with software development. I think most of us, born into the information age, have very little understanding of how complex software engineering and computer science really are. The dynamic nature of computing platforms obviously don’t compare to any living thing’s genome, but it is pretty damn close.

Using Restlet's Jetty Server with JUnit - Integration Testing the ReST Interface...

Posted on September 17, 2008

Here’s my test class setup:


@BeforeClass
    public static void setUpServer() throws Exception {
        // Create a new Component.
        component = new Component();
        // Add a new HTTP server listening on port 8182.
        component.getServers().add(Protocol.HTTP, 8182);

        // Attach the sample application.
        component.getDefaultHost().attach(
                new MyApplication(component.getContext()));

        // Create an application
        Application test = new Application(component.getContext()) {
            @Override
            public Restlet createRoot() {
                Reference rootUri = LocalReference.createFileReference(new File("./src/test/resources"));
                return new Directory(getContext(), rootUri);
            }
        };
        component.getClients().add(Protocol.FILE);
        component.getDefaultHost().attach("/test", test);
        // Start the component.
        component.start();

So, this takes files in ‘src/test/resources’ and makes them available through the spun up HTTP server. And, by taking advantage of the JUnit annotations we can ensure this only happens once, before any of the test code. Nice, eh? I’ve created a RFE at Restlet.org to provide direct support for non-absolute file paths, which the LocalReference works around (nicely).