Improving Wetware

Because technology is never the issue

Architectural Consistency - How hard can it be?

Posted by Pete McBreen 29 Jan 2023 at 03:38

Working with Rails and Phoenix has made me more conscious of a related set of software architecture mistakes I am seeing in other systems…

  • How hard can it be to have consistent table names in a relational database? Preferably have plural table names, or if you prefer have singular names, but please do not have a mismatch with some table names plural and others single.
  • How hard can it be to have a consistent name for the primary key of a table, something simple like id?
  • How hard can it be to have a consistent name for the foreign keys in a table, something like other_table_id? (Please remember when doing this that the foreign key is to a specific row so the other_table will be singular)
  • How hard can it be to have consistent convention for naming the common CRUD methods to access records in the database?

Over 20 years ago we were talking about Software Patterns and Coding Idioms, but many systems I have looked at in the past 10 years have failed to get some or all of the above items wrong, leading to interesting defects and confused developers.

Python Requests library and SSL

Posted by Pete McBreen 14 Jan 2023 at 22:47

When using the simple requests calls, separate SSL session is negotiated for each request.

>>> import requests
>>> resp = requests.get('') ;  print(resp.elapsed, resp.status_code)
0:00:00.344494 200
>>> resp = requests.get('') ;  print(resp.elapsed, resp.status_code)
0:00:00.320507 200

To avoid this, and to get faster subsequent response times, you can create a session object that will then keep the connection alive (but the default keep-alive for Apache is only 5 seconds)

>>> s = requests.Session()
>>> resp = s.get('') ;  print(resp.elapsed, resp.status_code)
0:00:00.333475 200
>>> resp = s.get('') ;  print(resp.elapsed, resp.status_code)
0:00:00.105773 200

So by using the Session capabilities, subsequent https requests in a test suite can save the SSL negotiation cost, which on my laptop down to this blog server is of the order of 200ms. Not a massive saving, but when a test suite needs to hit an API 100 times to test out the various options, the difference is noticeable.

Prioritization and Cycle Time

Posted by Pete McBreen 07 Jan 2023 at 21:31

Many of the agile processes make a nod towards cycle time, which is typically associated with the time taken from when developers start working on an item and the time when the item is released to production. While this is a useful measure for finding out how long on average developers take to complete work, it is not the full picture.

Defining Cycle Time as just the time when developers are working makes it seem that the time is of the order of a week or so. Admittedly I have seen scrum teams on a two week sprint cycle take multiple sprints to complete items, so even on a simplified cycle time measure many teams are slow.

The full, user’s experienced cycle time however is from the when an item is first recognized, understood, written up into backlog, queued for prioritization, queued for development, developed and released. Although it is hard to get a good handle on the first few stages, I commonly see open JIRA tickets that are 12 months or older, and that is in the unprioritized backlog. From a user viewpoint this is abysmal, sending in a request and not hearing back for a long time.

The prioritization needs to be done in a way that allows for fast feedback to the users. One way of doing this is to adjust the workflow so that there is a two stage writeup, and the initial request can then be simplified and routed for evaluation as soon as it is created. This initial prioritization puts the requests into one of four buckets.

  • Do Now, team parks whatever it is working on and work on the item. Typically only needed for items that have a major, imminent business impact.
  • Do Next, team will pick up this item next after finishing the current work items.
  • Do Later, item gets queued into the backlog for consideration later.
  • Decline, item gets marked as declined, not a part of the backlog.

An immediate Decline is useful as it allows the user to either make a better case for the item or know that it is not going to change so the user needs to accept the current process and/or come up with a workaround.

The Do Later items need to be worked on by the user, business domain experts, analysts and managers to better understand the item, the value and associated costs so that the relative importance of the items in the backlog can be assessed. As part of this there has to be an agreed maximum age of items in the backlog to keep the size manageable. Items that get too old need to be Declined, as they are lower value than all the other items that could be worked on.

The top items in the backlog are effectively in the Do Next category, so if no new high priority items have been put into the Do Next category, then the team can work on the top priority from the Do Later backlog.

The size of the Do Next category has to be managed by the user, business domain experts, analysts and managers group, so that it only contains items that are truly higher value than the top items in the Do Later backlog. The size of the team that is working sets the limit on the number of items in the Do Next category. It has to be small so that the initial evaluation can be immediate, a good starting point is five or one less than the team size if that size is less than five.