Terraform CDK or AWS CDK

Introduction This post is the write-up of a comparison between Terraform CDK and AWS CDK. Both of these Cloud Development Kits (CDK) are new approaches to writing infrastructure-as-code. They both provide libraries of infrastructure constructs in a variety of programming languages. Also included are command-line tools to deploy the infrastructure. Like traditional Terraform the Terraform CDK supports multiple cloud providers. It also supports providers of other types of infrastructure (e.g. other CDN). Whereas AWS CDK is dedicated to managing AWS infrastructure. This assessment focusses on managing AWS infrastructure ONLY. What was being assessed? Ease of use How easy is it...
Continue reading

Release and Deployment

First a question, What do you want your software release and deployment process to be like? If you had no constraints from your organisation what would it look like? There are two predominant factors around release and deployment: Automation - How much do you want to automate? On one side of the scale is a manual release process with no automation. At the opposite end of the scale is everything automated with few (if any) manual gates . This is would involve automation of deployment, testing, security scans, automatic rollbacks etc. Trust - There are two elements of Trust. The...
Continue reading

Time Tracking

Time tracking is a very emotive subject with even the mention of the words likely to cause offense or an immediate defensive stance. This is hardly surprising when many peoples experience of time tracking is either a corporate Orwellian nightmare or a misguided attempt to attribute cost to projects or initiatives. Many years ago when I worked in a call centre they had a tracking system built into the phones with a series of codes to enter for reasons that included breaks and visiting the toilet. It’s not clear what they were trying to measure with the latter, perhaps they...
Continue reading

Alerting, Monitoring, and Diagnostics

Inevitably your software will fail. Requirements around detection and diagnosing of software problems are often neglected. At best they are the last thing considered and are reactionary. Hence, solutions can be muddled and confusing; often unclear about which problem they are trying to address. Furthermore, the direction is often dictated by the companies choice of Dashboard/Alerting tooling. Rather than engineering having the time and freedom to consider what they need. In this post, I will run through the differences between Alerting, Monitoring, and Diagnostics of software systems looking at good practices and potential pitfalls. Alerting “It’s a dangerous world, man....
Continue reading

Job Title Diffusion Causal Loop Diagram

In my previous post I covered the phenomenon of Job Title Diffusion. That is the impact of a variety of job titles can have on a organisation. Recently, I’ve had to examine this in more detail and found that a Causal Loop Diagram really helped to illustrate and understand the problem (see this post for more details about Causal Loop Diagrams). What I ended up with is the diagram below. As a refresher, the S links move in the Same direction and the O links move in the Opposite direction. For example, as the variety of job roles increase in...
Continue reading

Law of Job Title Diffusion

I’ve been trying to put into words a phenomenon that I’ve increasingly seen in software organisations. This is my first attempt in describing what I’ve called the Law of Job Title Diffusion: An organisations number of tools, languages, frameworks and source code repositories increases with every job title introduced. My hypothesis is that in organisations with lower numbers of engineering job titles there are fewer programming languages, frameworks and tools in play. The source code is also more likely to be concentrated in a smaller number of repositories. Imagine an engineering team where individuals do have particular talents, but work...
Continue reading

Asynchronous meetings

Asynchronous - not simultaneous or concurrent in time : not synchronous https://www.merriam-webster.com/dictionary/asynchronous The current pandemic has suddenly thrust many of us into remote ways of working. This post looks at Asynchronous (Async) Meetings, how to make them effective and how to conduct one in a tool such as Slack/Microsoft Teams. What is an Async meeting? An Async meeting doesn’t require all participants to meet and discuss a topic at the same time. Instead, the meeting happens in written form via a shared document or in a channel of a tool such as Slack or Microsoft Teams. This style of meeting...
Continue reading

Causal Loop Diagrams: Ability to Cope

This is my favourite diagram at the moment…. I’ve shared it with countless colleagues, as I feel it really demonstrates the vicious circle that many Software Teams/Departments find themselves in. It is shamelessly copied and adapted from an example in the book Seeing the Forest For the Trees. The example in the book is based upon a back-office function of a financial organisation, yet it shares many of the traits of departments and teams in Software. This type of diagram is called a Causal Loop Diagram and is used to show the interactions between parts of a system. Each link...
Continue reading

A Year in Retrospective

Recently, I completed a year of holding weekly personal retrospectives. In this post I’ll look at how I run my retrospectives, what has gone well, what hasn’t worked and finally why I’ve managed to keep to this routine for a year. My weekly personal retrospective takes the following format: Meditation How am I? Feedback What has gone well? What can I improve? Review last weeks goals Set weeks goals Initially, I perform 10 minutes of mindfulness meditation to clear my mind ready to reflect. This is followed by asking myself how am I? Which is aimed at discovering how I’m...
Continue reading

Acceptance Testing

Last week I had the following DM on Twitter from @rahabm about the current state of Acceptance Testing Hi Iain. I remember that testing used to be taken serious back in the UK. What is the current state on Acceptance Testing these days ? What are your thoughts on who should write and implement an acceptance test ? 😀 I commented at the end of my rant back to @rahabm that I should probably write a blog post about this, so here it is! To begin with, what do we mean by Acceptance Test? If we use Mike Cohn’s Testing...
Continue reading

Tragedy of the Commons

Recently my team was contacted by the centralised infrastructure group to discuss our use of the organisations Sumo Logic account. We utilise Sumo Logic to store and explore some of our application logs. These can be quite large due to the high volume of traffic that our APIs handle. We were being contacted because the centralised Sumo Logic account was reaching the contractual storage limit. They were attempting to encourage the teams who used it to reduce their log generation. This is an example of Tragedy of the Commons which I will talk about in this post. The phrase first...
Continue reading

Dysfunctions of Multi-Discipline Teams

Back in the summer of 2001 I started my first role as a Software Engineer. This role had a wide range of responsibilities that included gathering requirements, designing the User Interface and producing quality code to meet the user needs. We also had to design our own windows program icons, which resulted in some very peculiar works of miniature art! One of the downside of this job is that, although we were organised into teams, we worked alone. The teams were just amalgamations of individuals brought together to share common line management. Fortunately, the industry has moved towards a more...
Continue reading

Mono No Aware (物の哀れ)

The Stanford Encyclopedia of Philosophy defines mono no aware as a “pathos” (aware) of “things” (mono), deriving from their transience The term was constructed by Motoori Norinaga in the eighteenth century to encapsulate the mood which was central to the Japanese. This was particularly focussed upon the impermanence of things and a slightly melancholy awareness of this. But there is also a quiet rejoicing as our awareness allows us the opportunity to witness the beauty in these. The annual sakura (Cherry blossom) in Japan is a good example of mono no aware. Every year thousands of Japanese families visit parks...
Continue reading

Dunning-Kruger Effect in Software Development

In 1999 a paper by Justin Kruger and David Dunning of Cornell University appeared in the Journal of Personality and Social Psychology, this piece summarised research that they had been carried out into the difference between peoples perceived and actual ability in a subject. Here is a particularly amusing account of stupidity that is mentioned within the paper: In 1995, McArthur Wheeler walked into two Pittsburgh banks and robbed them in broad daylight, with no visible attempt at disguise. He was arrested later that night, less than an hour after videotapes of him taken from surveillance cameras were broadcast on...
Continue reading

Full stack testing with gulp & zombie

For the latest nodejs website I’ve been working on, I wanted to write a couple of full stack tests using the headless browser zombie. I also wanted to automate the running of these tests using the task runner gulp. N.B. If you want to try any of the following examples, you’ll need the following packages from NPM: npm install zombie --save-dev npm install gulp --save-dev npm install gulp-mocha --save-dev npm install gulp-develop-server --save-dev I decided to write my tests using Mocha, though alternatively you can use pretty much any other node testing framework. Here is an example of one my...
Continue reading

Projects

In contemporary business and science a project is defined as a collaborative enterprise, involving research or design, that is carefully planned to achieve a particular aim. Oxford English Dictionary This agile stuff seems to work fine for defects and BAU (Business As Usual) work, but it doesn’t seem to fit for project work Anonymous team member What is the difference between BAU and project development work? They both involve changes to the software, maybe to a database, hopefully they are tested and then they are released out in the wild. Except usually the project work is not released out into...
Continue reading

Chess

Over the last few days I’ve been attempting to discover the objects and interactions for the game of chess. After writing down the basic rules of pawns I identified the following candidate objects, using noun analysis: Pawn Square Piece Board Game Move Using these I’ve run a couple of CRC card sessions to try and work out the objects, their responsibilities and interactions. I’m trying to model the game in a strict Object Orientated fashion, by protecting object state by following the principle of Tell Don’t Ask. The issue I am having is seems that the pawn should have the...
Continue reading

Isomorphism

Recently I’ve been reading a fascinating book by Douglas Hofstadter called Gödel, Escher, Bach. In an early chapter he introduces the concept of Formal Systems, which is any system of abstract thought based upon the model of mathematics. Further into the book a Formal System called the PQ-system is proposed. DEFINITION: xP-Qx- is an axiom, whenever x is composed of hyphens only. RULE OF PRODUCTION: Suppose x, y and z all stand for particular strings containing only hyphens. And suppose that xPyQz is known to be a theorem. Then xPy-Qz- is a theorem. The author then asks the reader to...
Continue reading

Introducing Pageboy.js

Recently, I was explaining how to Test Drive Javascript with DOM interaction and one of the audience mentioned that they found the tests unreadable. The tests had been written in qunit and used jQuery to interact with the test fixture in the DOM, here is a similar example: test('Hello displayed When clicking on Hello button', function(){ $('#hello').trigger('click'); ok($('#helloDisplay').is(":visible")); }); If you’ve used jQuery before, you should be able to decipher that this test is about clicking one element and checking the effect on another. But if you’re new to jQuery this maybe confusing, you’d have to investigate the framework and...
Continue reading

8 Test Driven Development tips

1. Have a failing test – The red stage is the first of the TDD cycle, it is complete when only one test is failing AND the test is failing on the expected assertion. Seeing the test fail is an important validation of the criteria of the test, so avoid temptation to leap into the implementation without running the tests. 2. Simplest implementation – The objective of the second (green) stage of TDD is to implement just enough to make the failing test pass. Follow a “You Ain’t Gonna Need It” (YAGNI) approach and don’t try to second guess subsequent...
Continue reading

8 visualisation improvements for Kanban/Scrum boards

A physical Kanban or Scrum board is usually one of the first steps that software development teams take when they set sail on an Agile course. The intention of these boards is to visualise the state of the current deliverable(s), so that all members of the team and the customer should be able to understand what is happening. This may act as a conversation starter or even help pre-empt delays in delivery. Unfortunately, many boards tend to end up as messy project task boards, which hide the subtle improvements that help reduce waste and cycle time. Think about your board,...
Continue reading

Fantasy world built of metrics?

Last weekend I went to see the Adam Curtis and Massive Attack event, which was part of the Manchester International Festival. This was an audio/visual film (or Glim – Gig integrating with a film) about the fake enchanting modern world which we live in today. One of the ideas that grabbed my attention was that much of the modern world is built on numbers (or metrics), this ranges from financial planning/investments through to behaviour of political parties. The flaw in this idea is that metrics are always based upon the past actions and not the future, which leads to a...
Continue reading

Constructor Function v Prototype in Javascript

There are two main mechanisms for creating objects in Javascript, these are known as Constructor Function and Prototype. In this post I will run through an example of each and explain my preference. Lets say we want to create a Cat object, this has to be constructed with the cats name (e.g. Terry) and it also needs a single method called sayHello() which will reveal the cats name. Our orchestrating code would look something like this: var aCat = new Cat("Terry"); alert(aCat.sayHello()); //alerts "Meow! My name is Terry" If we coded this using the Constructor Function approach, it would look...
Continue reading

A tour of our Kanban board

In this post I’m going to give a quick run through the Kanban board that my team uses at LateRooms.com. This is not a ‘thou shalt do it this way’ article, it is intended to demonstrate a working board and explain its structure. Also, I must stress that this is the current state of the board at the time of this post was written, so it has probably evolved again by now! The board The board is split into 4 sections: Backlog -> For the Business Analyst (BA) to add and prioritise tickets DEV -> contains the queue (pending) and...
Continue reading

Extending classes with IExtensibleObject

Introduction One of the key features of Windows Communication Foundation (WCF) is the ability to extend various parts of the framework, by adding and/or replacing behaviours. Many of these extension points are implemented by using the IExtensibleObject interface. This post is going to examine how this works and the reasons for using it. The IExtensibleObject Interface Classes implement IExtensibleObject in order to be extendible. The interface is defined in .NET as: namespace System.ServiceModel { public interface IExtensibleObject<T> where T : IExtensibleObject<T> { IExtensionCollection<T> Extensions { get; } } } This interface ensures that implementers have a publicly accessible IExtensionCollection, which...
Continue reading

Implementing the Repository pattern with MongoDB and coffeescript/nodejs

The Repository Pattern is a useful mechanism to abstract the mechanics of the data store away from the business logic. There are various ways of implementing a repository against a relational database, the mechanics could use plain old SQL or something more exotic like nHibernate or Entity Framework. This post is going to look at constructing a generic repository to use against a mongoDB data store, and because I want to show how ‘hip’ I am, the example will be in coffeescript with nodejs. Prerequisites You will need: nodejs & mongoDB installed coffeescript npm package (npm install -g coffee-script) mongojs...
Continue reading

AddressFilterMode in WCF

Recently, I have been implementing a POX (plain ol’ XML) WCF service that needed to route all requests through a single ‘handler’ operation contract. The routing to this single operation was easily implemented by adding a wildcard action to the operation contract: [OperationContract(Action = "*", ReplyAction = "*")] Message HandleRequest(Message request); However, an additional requirement was for the service to respond to all messages that included the base url in their address. For example, if the service is running at http://localhost/myService, it needed to accept messages addressed to http://localhost/myservice/hello. In order to implement this we have to alter the WCF...
Continue reading

Cross-Origin Resource Sharing (CORS)

COR blimey, what’s this all about? A common requirement of websites is to display data retrieved from a web service in another domain, for example the Twitter or Google API. Unfortunately, standard Javascript AJAX calls to resources outside the domain will fail. This is due to safety measures put in place to prevent cross site scripting attacks. To work around this, many Javascript libraries implement JSONP, which allows cross domain retrieval of resources by the use of a script tag (the script tag in HTML does not fall under the same origin policy). The problem with JSONP is that it...
Continue reading

Using JSONP with Backbone JS

JSON with Padding (JSONP) is a mechanism to support the retrieval of data from a server in a different domain. This is achieved by exploiting the fact that the HTML <script> element can be retrieved from an external domain. By default, Backbone JS is unable to retrieve collection or model data from a url in a different domain. This is because Backbone is using the jQuery AJAX call with a data type of JSON rather than JSONP. So, how do we change Backbone to use a data type of JSONP in its AJAX requests for a particular model or collection?...
Continue reading

Implementing the Specification Pattern in .NET

Recently I have been reading Eric Evans excellent book on Domain Driven Design. One of the patterns discussed in this book is the Specification Pattern, which was conceived by Eric Evans and Martin Fowler (see here for full description). This pattern is about encapsulating domain rules into specification classes. These are then used to test if a particular domain object satisfies the criteria. Typically, they expose a public function called IsSatisifiedBy() that returns a boolean based on whether the object satisfies the specification. For example, if we have a bank account value object… public class BankAccount { public int CurrentBalance(...
Continue reading

4 Tips on WCF JSON serialisation

1. Excluding null fields from serialisation By default all serialisers in WCF, including the DataContractJsonSerializer, will automatically serialise ALL Data Member properties. So, if your property is not set it will serialise as null. For example, the following DataContract is serialised with PropertyTwo set to ‘aValue’ and PropertyOne left unset…. [DataContract] public class MyContract { [DataMember] public string PropertyOne { get; set; } [DataMember] public string PropertyTwo { get; set; } } ..the resulting JSON after serialisation will look like this: {"PropertyOne": null, "PropertyTwo": "aValue"} This can cause problems as there are jQuery plugins that require properties to be undefined...
Continue reading

Exposing functions on jQuery plugins

Introduction For some jQuery plugins it would be useful if we could expose one or more functions, so that we can interact with it from Javascript outside the plugin. If we follow the standard mechanism of plugin authoring, we can only interact with the it at the moment of initialisation. This post will look at two mechanisms that can be used to expose and access plugin functions. This post will be based around the following mediaPlayer fictional plugin: ```javascript (function($) { $.fn.mediaPlayer = function(options){ ......... } })(jQuery); ``` This mediaPlayer plugin would work by being attached to a selected DIV...
Continue reading

Drop Down Lists in ASP.NET MVC 2

A problem that I have come across recently is, how do you handle drop down lists in MVC? There is a dual function of the MVC model as it has to: 1) Provide the data to populate the drop down list (the display name and value) 2) Capture the selected value when being submitted back to the controller. For example, lets say we want the user to select their favourite A-Team member. We want to display the list of A-Team names (B.A, Face, Murdoch, Hannibal) but we want the value sent back to the controller to be the selected actors...
Continue reading

Closing WCF Proxies / Channels

The purpose of this post is to discuss the best way of closing Windows Communication Foundation (WCF) proxies/channels. Whether you are using a system generate proxy, or an interface initialised through a channel factory* it is inevitable that at some point you will need to close this. A common mistake you’ll often see in WCF is the attempted closing of a proxy by the use of the using statement (see example below). using (myProxy = this.GetMyProxy()) { //call myProxy } A using block will call the Dispose() on the proxy object, but it won’t close the channel correctly. We need...
Continue reading

Accessing a .NET Dictionary in jQuery

Recently I noticed that the DataContractJsonSerializer does something peculiar with the .NET Dictionary type when serialising it to JSON. I assumed, wrongly, that it would be converted to an associative array with the dictionary item key as the associative and the dictionary item value as object in the array. For example, the following dictionary in C#…. var myDictionary = new Dictionary<string, string>(); myDictionary.Add("key1", "Hello"); myDictionary.Add("Key2", "World"); ..could be accessed (after JSON serialisation) in Javascript like this: var myWorld = myJsonDictionary["key2"]; Unfortunately, this isn’t the case. When the Dictionary is serialised to JSON it is outputted as an array of key/value...
Continue reading

Getting JQuery and WCF to talk (part two of two)

Introduction In my last article I covered how to get JQuery to call a WCF method. This included the passing of arguments and the handling of any return values. In this, the second part, I will cover the final piece of the JQuery / WCF communication jigsaw, the throwing and handling of faults. Setting up the ErrorHandler When any type of FaultException is raised from a web enabled WCF service the default behavior is to throw a HTTP 400 error. If the includeExceptionDetailInFaults service behavior is enabled then a serialized stack trace is also sent across the wire (I strongly...
Continue reading

Getting JQuery and WCF to talk (part one of two)

Introduction Windows Communication Foundation (WCF) is the swiss army knife of the software communication world. Even though most seem to use it as a replacement for SOAP web services or remoting in their .NET framework applications, it is actually also darn good at talking and being exposed to other none .NET environments. In this and it’s accompanying post I am going to cover the steps required to get JQuery and WCF “talking”. This post will focus on the communication between the two using JQuery **Ajax **(Asynchronous JavaScript and XML). The concluding post will look at error/fault handling between the two....
Continue reading

UML Aggregation vs Compostion

A colleague asked me a few weeks ago for some advice about their UML class diagram. One of the issues they were having was deciding on whether the link between two of the classes should have a “filled-in” or “non-filled-in” diamond. You have probably already guessed that he was really asking about whether the two classes were linked by Aggregation (“non-filled-in”) or Composition (“filled-in”). From my experience, this is a very confusing area of UML for some developers. I have reviewed may class diagrams where the developer seems to have just liked the look of one of the diamonds and...
Continue reading