Model-Based Testing

Robert Binder’s Testing Object-Oriented Systems book sits permanenly on my desk. At over 1500 pages long, it is almost a never-ending read, but from time to time I pause to read a few choice chapters. Binder also wrote about the compliance testing of Microsoft’s court-ordered publication of its Windows client-server protocols in 2012. An interesting …

The unit in unit-testing

Interpreted extremely, unit testing means testing each class separately. However, complete isolation is difficult to achieve given that a class typically interacts with other classes in most applications, and for this definition of the unit to be upheld, collaborating classes have be faked during testing. But, using mocks for this purpose, developers confront two problems …

Learning BASE64 encoding

BASE64 encoding is so prevalent that it is worth learning how it works and how to code your own implementation. The point of BASE64 is to communicate binary data as text, using only characters that are likely to exist on most computer platforms. These safe characters are known as the BASE64 alphabet and are the letters …

How we use SQL Server Data Tools

This post describes the process that we use to develop databases with SQL Server Data Tools (SSDT) in Visual Studio. For this process 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 …

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. …

How to identify and fix an anaemic domain model

In CRUD applications most classes usually consist of many accessor methods and few behaviour methods. While many developers recognise these classes as symptoms of an anaemic model, not so many of them know how to address the problem. Anaemic classes are characterised by not having any responsibilities other than to write and to read attributes. …

How to switch off a screen laptop under Linux

This post describes how to save power on a laptop running Linux by switching off the screen backlight. The instructions are tested on a Dell Latitude C810 running Ubuntu Linux 5.10. The first part is straightforward: set the correct governor for the CPU frequency with the following command. echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor This is executed …

Rapid web development

I am experimenting with the following technique to speed up web application development with Java. First, define an interface called Controller with a single method called handleRequest that takes an HttpServletRequest and an HttpServletResponse as arguments. The method should also throw an Exception. package web; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public interface Controller { public void …