I Want To Do Some Enhancements

Many years ago, the development team was set-up in a way that “proper” developers worked on enhancements, whereas Juniors worked on fixing bugs. To be honest, in many situations, fixing bugs is the hardest scenario.

I always like a variety, because doing a particular thing becomes tedious and isn’t giving you a good range of skills.

Julian started moaning about how he wanted to “do some enhancements”. He was itching to prove himself and craved variety.

The managers finally caved in and gave him a set of 4 enhancements to do as a mini-project over the course of a couple of months. When the deadline approached, he had left the company.

When we looked at his changes, only 2 looked even close to finished. They were riddled with bugs. One of them looked like an absolute botched implementation, and when I looked at the code and pasted it into Google, I found the Stack Overflow posts it was taken from.

Julian had just copied and pasted code, tried to change a few things here and there, but couldn’t improve it. I imagine he realised he has made a fool out of himself, so handed in his notice before we uncovered what a mess it was.

In the end, we just scrapped his code completely because it was a waste of time looking at it any further. 

Poor Communication

I love writing stories about poor communication. This isn’t the worst by any means; given that the conversation lasted 7 minutes which is quick compared to some other conversations I have been enraged about. The thing is, it is still too slow. I get the question 4 minutes after him initiating the conversation by saying “Hi”. It took a further 3 minutes to get the actual problem from him.

Why couldn’t he have just said:

Hey dude, when you checked in your code, did you encounter any test failures at all? I am getting these failures <insert link to failing build>.

Ideal Conversation

Then I could understand the problem and context, and viewed the build output to work out what was wrong.

Here is the actual conversation:

[Yesterday 5:38 PM] Andrew
Hi
​
[Yesterday 5:42 PM] Andrew
yesterday you checked in your code into the Main branch
​
[Yesterday 5:42 PM] Andrew
did you face any build errors
​
[Yesterday 5:43 PM] Me
No. It wouldn't have checked in otherwise. What's the problem you're having?
​
[Yesterday 5:43 PM] Andrew
okay..because we are getting some build errors
​
[Yesterday 5:44 PM] Andrew
just wanted to ask you
​
[Yesterday 5:44 PM] Me
What are the errors?

[Yesterday 5:45 PM] Andrew
unit cases are failing 

<Shows screenshot of a message that says “There might be failed tests”. Pretty much useless>
​
[Yesterday 5:45 PM] Andrew
in Configuration Manager

It’s frustrating constantly receiving small messages with barely enough information. I shouldn’t have to ask him twice what the errors are after being told there are errors.

Turns out he had missed the post by a developer stating that everyone must merge Main into their branch. His branch was a whopping 2 months out of date, which is pretty bad practice.

Report API fail

A tester says they are running a Test Case where they need to generate a report using our software. This report utilises a third-party service. The report fails to generate.

There should be errors displayed when you view the details, but it’s completely blank. So if they have correct data, then it’s a bug because it doesn’t work. If they don’t have correct data, then it’s a bug because it doesn’t tell the user what the problem is. It’s a bug either way.

Becky, a Senior tester:

  • Asks him if he has the correct data. Completely misses the point.
  • Then she posts a follow-up question asking him if he has gone directly to the third-party website to get the information. Completely misses the point.

No, Becky, the functionality is that our software contacts the third party API to retrieve this information. Manually going to the website and filling a form out by hand isn’t helpful, or acceptable. It isn’t going to make the test case pass is it?

“ok, we will pass the test because the website works. Nothing to worry about.”

Becky’s mind

Sometimes I think she tries to be dumb on purpose.

Slack Analytics #2: September 2020

In Slack Analytics, I stated:

I have sent 1,700 messages for the entire year.

I was interested to see my output this month. I have been sending a lot of messages to my Apprentice, I’ve been engaging in conversations with managers and testers to discuss many of my bug fixes. Some new Apprentices joined and I have also been helping them. Also, since I don’t get to physically talk much, my Slack usage has gone up.

1,803 messages over 26 days.

In Slack Analytics, I also mentioned the highest number of messages sent by someone was “3,500 across the 18 days she was in the office”.

Again, she still leads the monthly charts, but this time has 3,709 over 21 days, so it’s basically stayed the same.

Now this is interesting. How can you make everyone work at home, yet her message count hasn’t increased that much? I was expecting to see several people have counts that eclipse this figure. 

Slack only allows you to see Last 30 Days, or All Time, so I don’t think I can get access to see the change pre and post lockdown. You would imagine taking away face-to-face communication will increase everyone’s usage.

I guess there are two ways to actually slack-off work. Using Slack to send banter messages to your colleagues, or just not working. So message counts could go up because more people can get away with not actually working, or it can go down because they really are slacking-off work.

The new Apprentices have been pretty quiet so far, and I would have thought they would be constantly messaging people since they wouldn’t have a clue that was going on. There’s a developer that is really quiet when we were in the office and he never seems to publicly post anything on Slack. I tend to forget he exists.

DeveloperDays activeMessage Count
Apprentice A22 286
Apprentice B21 525
Quiet Developer23429
Slack Analytics

Biassed Twitter Picture Algorithm

People are accusing Twitter’s algorithm of being racist, which is sometimes a problem when it comes to algorithms based on Machine Learning.

If you don’t train the algorithm with a representative data set, then it can cause failures. e.g. if your data set only has pictures of males, then the algorithm will have problems when it is then tested out on pictures of females.

This sure is an interesting thread.

Originally, Dantley who works at Twitter, states the background is swaying the algorithm to choose the white guy. Then Graham has followed up with a set of tests.

In his reply, he has 4 pictures. If you click each one, you can see the original image. The image is very tall, which means Twitter has to crop it in order to display in the tweet. It seems that it crops the image around something interesting in the pictures. So it should detect 2 people and then needs to choose one to display in the preview. In each of the 4 examples, it is choosing the white man.

Dantley follows it up with an experiment of his own, by placing them in the same outfit, but he also removed their hands. This was probably just easier to edit, rather than swapping clothes and adding their hands back in. The black guy is then chosen.

I wonder what the outcome of this is going to be. Some people, including Dantley suggest it should crop the image, but I don’t want a massively tall image on my timeline. Maybe they have some other way of handling it that I’m not thinking of.

Blackmail Hiring

A manager was talking about a former software tester, Aaron, who was regarded by many as a waste of time. He struggled to learn simple things, and you often had to explain concepts to him multiple times.

Many times I sat with him, and essentially did his work for him. I heard similar complaints from other colleagues.

The confession the manager made was: that Aaron actually failed the interview process. It was just that his friend Richard had recommended him, and when Richard realised that Aaron wasn’t going to be offered the job, Richard threatened to resign. So to appease him, Aaron was hired.

The thing is, Richard ended up leaving the company less than half a year later, whereas Aaron remained for years. Eventually, his manager lost patience with him, and Aaron initially moved teams and line manager.

His new manager wasn’t so patient, and issued him with a Performance Improvement Plan. Aaron’s position was finally untenable, so he finally resigned. No idea why we didn’t act earlier, but he should never have been employed in the first place.

The Name

I was peeking at Code Reviews and I saw this code.

retrievalUser.Surname = Formatters.ToTitleCase(usersName.Item as string);
retrievalUser.GivenName = Formatters.ToTitleCase(usersName.Item as string);

Notice how the code for both Surname and GivenName is exactly the same.

How can that possibly work? If “usersName.Item” is the full name like Alan Taylor, then surely if the UI shows GivenName and Surname, then it will be displayed as “Alan Taylor Alan Taylor” which is obviously not their name.

If this is some temporary code, then why haven’t they added a code comment next to the code to highlight that this needs replacing? Something like “Currently, the API only returns the full name so we cannot determine the users Surname and GivenName until version 2.1”.

Also, is it even correct to Title Case someone’s name? If you have a name like McDonald, wouldn’t this become Mcdonald? There’s probably loads of other examples too. I think the Dutch “van” is lowercase like “Robin van Persie”.

So there’s not much right with these 2 lines of code.

Crap C# Set property

I haven’t wrote a nerdy blog with code for a while. So let’s discuss C# Properties. A basic example could look like this:

private int _amount = 0;

public int Amount
{
   get { return _amount; }
   set { _amount = value; }
}

Here we have a property called Amount and the value is a number (int = Integer). You can get the value to see what it is, and you can set a new value. You could test it out with code like this:

Amount = 50;
MessageBox.Show($"Amount: {Amount}");

We set the Amount to 50. Then display the value in a message box. So this will display “Amount: 50”.

I saw a poor implementation of this basic C# feature. When I have come across crap code, I’ve sent it to my Apprentice to see if he understands why it is bad. This one caught him out.

This example looks similar, but notice the set method. It has a hardcoded value of 0 rather than the C# keyword “value”.

private int _amount = 0;
public int Amount
{
   get { return _amount; }
   set { _amount = 0; }
}

So what happens when you do this?

Amount = 50;
MessageBox.Show($"Amount: {Amount}");

Instead of showing “Amount: 50”, it actually shows “Amount: 0“. This can easily lead to bugs, or simply confuse a developer for a few minutes. The only way the value can actually be set in that implementation is via the “backing field”, the variable called _amount. This code will show “Amount: 50”

_amount = 50;
MessageBox.Show($"Amount: {Amount}");

Bonus SQL

I saw some bad SQL which I also sent to my Apprentice. I sent him this, hoping he’d maybe test it out, or maybe read up on bit fields, but he couldn’t tell me what was wrong with it.

declare @VerificationStatus bit
set @VerificationStatus = 2

A “bit” stores a value 0 or 1. So how can it be set to 2?

When you set it to 2, it doesn’t give you an error, it just sets it to 1. Any non-zero number is set to 1. This wasn’t the intention of the developer, he should have used an int. If he had tested his code, he would have seen it insert the wrong value into the table.

Could Not Find The File

I’ve no idea what the use case was, but someone wanted to use a really old test system, but when they tried to install it, they got an error message “Could not find the file Client_5.14.Zip”

After asking for help, he was told to copy the client patch from a back-up server, and place it on the Patch Server. Then when he tries installing the software, the version will now be found on the Patch Server.

He then claimed he had just done that but was getting the same error.

Now, logic says that he has done that wrong. How can you place a file in the correct place but the error still says it cannot find it. So either:

  1. He has placed the file on the wrong server
  2. He has placed the wrong file on the right server
  3. He has the correct file on the right server, but it’s the wrong filename or folder location.
  4. Some other combinations, but you get the idea.

So I remote onto the server and look at the folder. Order by date. There’s a folder created today called “5.14”. 

  1. So it’s a folder not a zip file.
  2. It has the wrong name. It should be “Client_5.14” not “5.14”
  3. It has the wrong file contents in the folder.

No idea where he got the files from, or why he thought that would work.

Product Names

Let’s say that the company I work for is “ACME” (classic fake company name). Our existing product is called “ACME Pro”, and our upcoming product is ACME-One. 

In the past, we have had inconsistent branding, with the company name written as ACME, Acme, and acme. We have tried to be more consistent and have discussed the importance that the new product is only ever gonna be “ACME-One” and the hyphen is very important.

Colin has been doing some work in ACME Pro, but it has some kind of integration with ACME-One. He had a database change and was populating the new table with values “Acme Pro” and “ACME One”.

I point out that the casing is wrong with the first product, and he has missed the important hyphen in the second product.

It would take him a few seconds to change it, whereas leaving it like that means it will probably be wrong for a long time and annoy pedantic/perfectionist people like me.

He replies “this isn’t user facing text, so it is not an issue”.

He really doesn’t care about quality. Also, one of the database columns is literally called DisplayName. Who is the text displayed to? If it isn’t an actual end user, it’s going to be an employee using some kind of configuration tool; and that is still a type of user. 

It’s also annoying for writing SQL queries, because you may type “where DisplayName = “ACME-One” but it won’t find it because the stored data is missing the hyphen. So you have to be aware of the misspelling in order for data to be returned.