The unit in unit-testing

Interpreted literally, unit testing means testing each class individually. Complete isolation is, however, difficult given that a class typically interacts with other classes. Therefore, for this definition of unit testing to hold, collaborating classes must be replaced with fakes in a test. But developers confront two main problems when using these mock objects. First, tests …

How we use SQL Server Data Tools

This post describes our process for developing databases with SQL Server Data Tools (SSDT) in Visual Studio. For it to work, the conventions below must be respected. Use the live database as the gold standard for schema objects (and data). Deploy only database projects that have been built successfully. Deploy to a database that matches the schema of …

Three golden rules to tackle complexity

Tim Newing, the IT director of Camelot, shares three golden rules to manage complexity in IT projects. Think of a collection of simple solutions instead of one complex project. Manage outside the ‘business as usual’. In other words, set up a different structure so that the project team is not distracted by the normal business. …

Three weeks with a MacBook Pro laptop

I have been using my MacBook Pro for the past three weeks. The MacBook Pro is a great laptop, perfectly suited for development work. The laptop delivers incredible performance, thanks to its Core Duo Intel CPU and the high-end ATI X1600 graphics chip. After using an iBook G3 for the past four years, I am …

How to identify and fix an anaemic domain model

In most CRUD applications, classes consist of many accessor methods and few behaviour methods. It is often difficult for developers to recognise this as a symptom of an anaemic model. Anaemic classes are characterised by having only methods for reading and for writing attributes. In addition to negating the benefits of object-oriented programming, such methods …

How to switch off a screen laptop under Linux

In this post, I describe how to write a shell script that switches off a laptop screen. The instructions are tested with Ubuntu Linux 5.10 (Breezy) on a Dell Latitude C810. First, set the governor for the CPU frequency with the following command. echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor This command can be run automatically at run-level …

Rapid web development

Lately, I have been experimenting with a technique to accelerate web application development in Java. It does without custom servlets and relies on Java Server Pages (JSP). Here is how it is implemented. First, define an interface called Controller. Declare a method called handleRequest that takes as arguments an HttpServletRequest and an HttpServletResponse. The method …