Follow

Follow
Can you debug life? Or at least do a post-mortem?

Can you debug life? Or at least do a post-mortem?

Alex Schiessl's photo
Alex Schiessl
·Oct 23, 2022·

11 min read

Well, in a programmers life you do a lot of debugging, cause we should be honest there is nor bug free software. Ja ja, the obvious "Hello, world!" you can write bug free or similar stuff, but it most of the time lacks the serious use. They most of the time just PoC's it can be done, but in serious software or for that matter real life you have to deal with bugs.

Serious software has bugs. Period. And as a programmer you have to debug sooner or later. Sometimes you only get the chance to do a post mortem (btw. also in real life, sadly), cause the bug was fixed by someone else (divine intervention, an angels hand or someone saved you) or was so serious that the software was shut down (or snuffed out your life).

Ja, I know a little bit cynical, but in any case, the good thing is, beside the bad things happened, is that you get the opportunity to learn (if you survive ;-)). In my recent Endeavour at work to preserve my newly won insight into Node-Red and python based Jira ticket analysis with KPI generation, I discovered a bug. It was in the html template generation for Confluence. And it was so trivial, you would assume I would have prepared for it. But I didn't.

Of course I had a lot of verification and check code built around the KPI confluence page generation. Also I have built tests to verify the code generation for the special the Confluence html (FYI it can be tricky to do normal html stuff, but you can apply some tricks to get more out of it, than Atlassian allows). All fine. But I didn't checked what happens when I have no data at all. I simply forget to cover this case. Who would have thought that :-(

A little background story to give you context. As it happens, one of our two teams was reassigned (I did mention in a previous post my project is shutting down) to a new project and handed over all remaining work to the one remaining team, till end of October.

So all Team labels in Jira where adjusted to reflect that only one team is doing the rest of the tickets. In my Jira ticket extraction code, I covered for that case, and I wrote no files or better I wrote empty files, depending what was best. Also I made sure to create empty statistics structures, so the reading and calculating part would even work in that case.

But all this preparation and carefully panning ahead, I simply forgot to cover that the aggregating part, the part which generates averages, max, min and such stuff, would work but would produce no usable result. Or to make it more concrete, what is the average of 0 tickets with 0 devs working 0 days on them. Hmm, ja I think you see the problem. I simply forgot to test and cover that case. The result was an empty ({}) json structure, cause nothing was calculated and lastly written in the aggregation file used by the KPI html code generation.

And that's how the bug happened and the KPI html code generation failed. I simply didn't cover this edge case with a test and with code handling to cover this case.

So what have I learned or better re-learned. Testing is good, in fact very good, but it doesn't help if you not cover all test cases. And it is easy to oversee an edge case. I've also learned to keep in mind that nothing in the world is constant (even time, hint leap year). My assumption was I'll always have data from both teams, until I didn't, and the the edge case appeared. So when it comes to assumptions, you better be prepared they are wrong. Make sure you are aware of the edge cases, when your assumptions are wrong.

Also another affect of this bug was, I could fix it, so I have a piece of software I can use in another project, now, with one bug less. You know the saying, at least I've learned it in Germany when I was starting my career:

"If you fix one bug, you potentially introduce 10 new ones!"

I would like to provide you with the code and the fix, but it was code written in the context of my employer, so I'm not at liberty to disclose the code.

And real life?

Ok, back to the topic of the title. So why do I make a relation between life and debugging software. Well, I'd to deal with the big "C" virus. Some of you might have read in my summer update, that I'm a newly work council member in our local work council. Since we have several work council's all over Germany. Each year all the work councils members gather in one location, to meet each other, discuss stuff and plan what we want to achieve in the next year.

This event happened early October for this year. Of course we tried to be careful and look ahead (like I did with my KPI html generation code), so we made preparations, test kits where handed out, rules where agreed on, processes put in place, e.g. mask had to be worn in trains, public transports, hotels and tight meeting rooms. But as in software, despite all these precautions, a bug hit or better the big "C" virus hit.

As bad luck would have it, I was sitting beside a colleague, who had the big "C" and came to the conference any way, disregarding all the processes and rules. For his defense he didn't know that he had it (so he said), cause he only tested himself after he was home and had symptoms, even everyone had two quick test for before and after testing.

Anyway sh*t happens. Naturally everyone who was in close contact with that colleague got the "red" warning (Official German Virus Warning App - I don't want to promote or was sponsored, just want to give you the chance for your own research) on their Phones, that we had contact with an invected person. Btw. that is the problem with such kind of warning apps. They most of the time warn you after the effect and only if the invected person reports that he/she was invected within the app. :-(

Well in my case I gladly did the 4th buster shot a few days before my travels, but apparently not early enough, cause I got affected, too. Not so bad as my colleague, but I had a cough, was very tired and had a lack of energy. That slowed my progress at work and in my private project.

Well, so how can you debug such a problem in real life. IMHO you can't. Humans are simply to unpredictable. There is not much logic involved, to much emotions. Software does not have emotions (as of yet) and acts logic. As I said humans do sometimes stupid things, even they should have known better or applied logic. As in my case, a colleague, who should have done the test bevor he traveled to the conference and should have canceled the trip. Or we as group should have not relied that every one is healthy and hence nothing will happen. Can't chance it now, but at least I did a post-mortem and found some things I will do better next time or will suggest we as a group should handle differently.

First of all if there is a virus like big "C" and you come together from all over the country, no one should be admitted to the conference area until a recent negative PCR test is provided. In addition Masks have to be worn all the time, if you not sitting on your place with enough room around you. So basically the general rules for every large meeting, which where in place till April this year, but got canceled and forgotten, because the big "C" wasn't so deadly anymore. And the long term effect, are not accepted, yet, as illness.

And personally I won't attend any big meetings and conferences anymore, unless I'm sure we as a group and I personally are protected as good as possible with such kind of rules. Ja I know life is full of risks, and I can die of food poisoning or an accident, tomorrow. But it is a different thing to do things with or without precautions.

Ok, as usual that's my opinion on my personal experience and my situation. I know some of you might feel or think different. That's totally Ok with me. Simply keep in mind, that we are different persons, have different experiences, different upbringings, different culture, different feelings about it, different perspectives and most importantly different filters in our heads, as Vera F. Birkenbihl once said: "Same information, same experience, different perception because of our different filters in our heads!"

So, to end my not so dev-like blog post, a short update on projects.

Update from work

Let's start with work. As already mentioned, my current project is winding down. Shop closes for me in 31st of October. As written in my last post I prepared the anonymous data and code extraction, to preserve it for upcoming new projects. Currently I've to do all the necessary administrative work for a project closing down. Offboardings, remove of rights and roles, write documentation and have know how transfer meetings with the new Scrum Master and new Project Lead. After that I'm done and it is another page in my history book.

What comes next, I do not know. For now, I do help out in the work council, since there are changes coming from the company which need a lot of discussions. Also I got the good advice from by boss, to look into the "SAFe" agile framework and possible do a certification for that. Cause it could be in my future to work in a new project, which uses or requires know how about that framework.

Update from private projects

They were slowed down, too, because of the conference and the outcome of it. But in the meanwhile I continued on my Football Scoreboard and it slowly but surly comes along. The control panel is working, I do fine adjustments, like enabling and disabling buttons depending on the state. Optimizations for using it on my iPad. Fixing bugs. Code Refactoring. And still to find a good way to write tests for UI testing, beside Selenium.

The overlay part is getting enriched more and more. I've managed to implement the PoC of doing the Touchdown Overlay. This is now the blueprint for the other scoring events. No much progress on the rest of the events, like flag, timeouts, aso. Also I'm not so happy with my graphics. They look fine, but a but chunky and inconsistent. Anyhow, technical dept for the backlog.

Also I found a new P5js library called "tween". Which might help me to bring a little more life in the overlay. Currently when the scoreboard or the source events are rendered, they simply pop up. With this library you can have effects, like "easein", "easeout", aso. In addition there is another P5js library "Timer", which gives you an easy timer implementation, so you don't have to deal with "setTimeout" or "setInterval". Well I've to make an assessment, how much effort it costs to introduce this complexity into the current software. It might be go to the backlog for further enhancements.

I'd also a little hickup, cause another collegue at the conference suggested I should use either the local storgage (with and event listener for changes) or web-sockets. Anyhow, I did some experiments with the local storage. But local browser storage, is not feasible, cause it works only in the same browser, but I want to use a tablet for the control panel and a Raspi-Pi as server for the Overlay. Hence local storage wouldn't work.

For the web-sockets part, I'm sure this would be the best solution, but since I've no experience with it and I don't know how to use it in my case, yet. I leave this one for further improvements in the backlog. My focus for now is to finish and release the Scoreboard as Open Source rather sooner than later. And if it happens so, that someone is willing to participate and review/improve my Football Scoreboard, I'm the last to say no to a Pull Request. They are welcome.

Another great, well expensive, thing happened as well. I finally was able to score another Raspi-Pi 4B 4GB, with an original red/white case, cables, heatsink, 16GB SD card and powersupply for 133€. But if you keep in mind the retail price of all the components before the prices exploded, it is at least 30-40% more expensive than before. But I've my 3rd Raspi-Pi 4B, now. Hence I can work on completing my little k3s cluster, with 1 controller and 2 workers. So over the Christmas break I can have my little HW project I can tinker with.

Also I want to try out DietPI OS for the k3s cluster. It is apparently smaller and less bloated as the Raspberry OS lite. Well, another project for Christmas. And after one year delay it is time to complete my k3s cluster, so I can move all my container services from my Mac Mini 2007 and retire him.

And of course I still have all the other project from my Top 5 projects I have in my mind till the next summer hiatus.

Ok, that's it for this month. As always apply this rule: "Questions, feel free to ask. If you have ideas or find errors, mistakes, problems or other things which bother or enjoy you, use your common sense and be a self-reliant human being."

Have a good one. Alex

 
Share this