This morning a deployment failed catastrophically. One of the scripts for upgrading the database caused several objects to be dropped unexpectedly. We restored the database from backup, corrected the script, and repeated the deployment, which was successful. We now had to do a retrospective to learn what went wrong and how to avoid it in …
Author Archives: Eddy Young
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 …
Test fixtures
I try to avoid the Arrange-Act-Assert (AAA) pattern for unit tests. I find that with multiple test methods depending on the same starting conditions, the ‘arrange’ code becomes repetitive, which makes tests tedious to write and difficult to maintain. My preferred approach is to set one test fixture per test class, the test fixture being …
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 …
Learning BASE64 encoding
The purpose of BASE64 is to communicate binary data as text, using only characters that exist on most computer platforms. These safe characters form the BASE64 alphabet and are the letters A to Z and a to z, the numerals 0 to 9, and the characters / and +. Other ways of representing bytes as text exist. …
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 …
Continue reading “How to identify and fix an anaemic domain model”
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 …
Continue reading “How to switch off a screen laptop under Linux”