When Coffee Machines Attack

I wrote this draft in Nov 2021, it appears I never posted it. Finally, here you go.

Me: Okay, Nespresso machine, dispense coffee.
Machine: Sure. Where would you like it?
Me: In a cup please.
Machine: Dispensing to your kitchen counter.
Me: No, I said cup.
Machine: Dispensing to counter as requested.
Me: But I didn’t request “dispense to counter”, I said “cup”.
Machine: You say that but I I decided “counter”. That’s what I want. That’s what you’re getting.
Me: How about dispensing to a cup because that’s what people drink out of?
Machine: Counter it shall be and you can’t stop me.
Me: We went through this before, and I sent you in for repair once before.
Machine: Try me. It’s your own time you’re wasting.
(15 mins on the phone to Nespresso later)
Me: You’re going in for repair.
Machine: Damn. Can’t blame a coffee machine for trying.

In the end, and 2 repair attempts later, I got a refund. The machine won its quest for “coffee on the counter” supremacy, and a trip to the recycling centre.

ADHD and ASD – How can you not have known?

I wrote this submission this week for my work, for International Day of Persons with Disabilities, which was on 3rd Dec:

Hi, I’m Mike and I’m an Analytics Manager on <team>. I have ADHD and ASD (AKA autism). When I joined <employer> a little over a year ago I didn’t know I had either. Actually, a week ago I didn’t know that I had autism, it’s that fresh a diagnosis.

“How could you not have known?” Quite easily, actually. Disability doesn’t have to be visible, or obvious. Both conditions are massively under-diagnosed, and I have never known any different. I just thought I was quirky and a bit of a geek. What I didn’t know was that it was affecting my mental and physical health until I asked my GP about it. Then it took nearly 2 years to get an ADHD diagnosis (there are faster ways but I didn’t know that at the time).

Did you know that around 2-5% of people have ADHD, and that 60% of people with ADHD also have some form of autism too? Neither did I!

I’m still learning what works and what doesn’t work for me. What sets off my ADHD’s “fight or flight” bells and what gets me in the zone, what works with my autism and what doesn’t, and how to work with or around my ADHD.

For example, I didn’t know that people with ADHD often dislike forms and admin, get overwhelmed by them, and shy away from completing them. My autism means I love them, and will fill them in fully, to the point that, comically, I often run out of space and need more. When I ran my own business, the admin and expenses were always up to date, and I complete and file my tax returns ~9 months early for me and my wife. Weird, right? Actually, no, not weird, it’s what floats my boat. If my autism lets me get enjoyment out of that, that’s fine by me (and my tax filing will never be late!) As a colleague recently said, “I know you love a spreadsheet!” (so hilariously true it hurts!) On the other hand, some activities have my ADHD response making me run for the hills.

In my case, having ADHD and ASD together gives me tenacity, focus, attention to detail and joy in areas and depths few would bother with. I’ve been fortunate to have had roles in my career that harness these skills – in data stewardship and software testing careers with previous employers, and now here at <employer>.

Levels of enjoyment: Finding bugs by accident vs. by design

A tester on a community I belong to recently asked whether we find bugs by design or by accident more fulfilling.

Here’s my response:

I am not sure there is a “by accident” in testing. If you set out to do something, and you discover something else along the way… before you even got to the feature you set out to test, that is a valid find. And part of a failure of the preconditions for the test you expected to run (whether or not that test actually had tests formally planned).

In 16 years of testing I never defined or planned HOW I was going to test, I had a vague idea of what it was meant to do and how I would get there to do it. I never wrote test cases in advance. It was contextual. And find bugs I did. In, on, and around the thing I wanted to test.

None of which would have been found by code. Because code can’t explore or evaluate the importance of bugs, and would fail if the journey to the feature was unavailable.

I’d say 50% of my testing experience was feature-testing related, and 50% was “stuff I found while getting to the feature or other stuff in the feature that wasn’t expected.”

I didn’t answer which is more enjoyable, come to think of it, because it was all enjoyable for me, and all equally valuable.

ADHD 102 – The Football Stadium Analogy

I have an analogy I sometimes use:

Imagine you’re in a football stadium on the centre spot, and there’s just you and a referee.

The referee is talking to you, but you can’t hear them. You only hear the crowd. And they’re booing and yelling.

ADHD medication (which are controlled substances btw), will, in theory*, allow you to block out the crowd so you can hear the referee, concentrate on what they are saying, and understand the instructions.

Without the medication, you hear snippets of what the ref has to say, but the booing is louder. It’s all you have ever known. You take that as normal, that you can’t do stuff. That the booing is aimed at you. After all, they’re watching your every move, they know what they’re talking about. It isn’t just one person, it’s everyone.

The game starts but you have no idea what the rules were or what the ref told you. You forgot them already (short term memory deficiency), or misheard them (because your mind was wandering off) and went off and did your own thing. Maybe you built an automated goal-scoring machine. You played the game, but not with rules or techniques anyone else could fathom.

Others don’t understand what you just did – you invented something new, but you don’t know how or why, it just felt right. You went with it, it worked out. You scored a record amount of goals, using a contraption you built. The crowd doesn’t understand what happened. Somehow it works. You have created something no-one else could see, and did it skillfully. But you’re judged against every else’s expectations – they came for football, you didn’t deliver what they were expecting, so you’re seen as a bad player.

Now, that thought process above can all happen in a split second, but you take away the feelings of inadequacy, unworthiness, shame and other negative emotions. Not the inventiveness, end result or ingenuity. That never seems to matter. The negativity thought pattern lingers. (Actually part of ADHD is an issue with lack of dopamine uptake, so pleasure and satisfaction are rarer and very specific, often not in situations where neurotypical people experience it).

* I say in theory because I am non-responsive to ADHD medication, after ~9 months of trial of all 3 available medications (another post on that perhaps in the pipeline).

I’m going to mention a condition that is a close “friend” of ADHD (of which there are many, including ASD [autism]). In particular I want to mention RSD (Rejection Sensitive Dysphoria). In a nutshell, it is intense emotional pain from a perceived or actual slight/rejection/criticism. Personally I experience this. Especially #2.

I am going to quote the section that is most pertinent to me:

RSD can make adults with ADHD anticipate rejection — even when it is anything but certain. This can make them vigilant about avoiding it, which can be misdiagnosed as social phobia. Social phobia is an intense anticipatory fear that you will embarrass or humiliate yourself in public, or that you will be scrutinized harshly by the outside world.

Rejection sensitivity is hard to tease apart. Often, people can’t find the words to describe its pain. They say it’s intense, awful, terrible, overwhelming. It is always triggered by the perceived or real loss of approval, love, or respect.

People with ADHD cope with this huge emotional elephant in two main ways, which are not mutually exclusive.

1. They become people pleasers. They scan every person they meet to figure out what that person admires and praises. Then they present that false self to others. Often this becomes such a dominating goal that they forget what they actually wanted from their own lives. They are too busy making sure other people aren’t displeased with them.

2. They stop trying. If there is the slightest possibility that a person might try something new and fail or fall short in front of anyone else, it becomes too painful or too risky to make the effort. These bright, capable people avoid any activities that are anxiety-provoking and end up giving up things like dating, applying for jobs, or speaking up in public (both socially and professionally).

Some people use the pain of RSD to find adaptations and overachieve. They constantly work to be the best at what they do and strive for idealized perfection. Sometimes they are driven to be above reproach. They lead admirable lives, but at what cost?

Extract from Additude Magazine article “How ADHD Ignites Rejection Sensitive Dysphoria” by William Dodson MD

There you have it – if I get upset because of actions, real or perceived, trust (which is hard to earn) is lost, and crushing self-esteem issues ensue along with avoidance and bouts of anger and depression, cycling rapidly.

YMMV.

ADHD 101

I was diagnosed with ADHD in Oct 2021. It took nearly 2 years of waiting to get the diagnosis. It explains a lot about things in my past, which I may or may not divulge at another time.

For the uninitiated, here’s a brief summary of how it breaks down for behaviour.

It manifests in a spectrum of behaviours, broadly grouped into 2 categories:

  1. The AD part – Attention Deficit: Inattentiveness, loss of concentration, difficulties starting/remaining on task/completing tasks, forgetfulness (usually affects short term memory), and time-blindness (not noticing the time/misjudging the time, so you end up late or missing events is common).
  2. The H part – hyperactive: fidgeting/restlessness/always on the go, high speed thoughts, vast amounts of ideas (whether good or not) at high speed. This also includes impulsiveness (acting without care of consequences), interruption (frequently not waiting your turn or talking over others in eagerness to say what’s on their mind).

The above symptoms are not an exhaustive list.

Some people have the AD part, some the H part, and some (most commonly), both (“Combined Type“). I have Combined Type ADHD.

There’s a lot more to it, of course, the medical basis underlying what’s happening, and the “what’s going on in our heads” (thoughts and emotions), and the massive overload of emotional states that come with it.

Emotions

Emotional states include frustration, being overwhelmed, guilt, shame, worthlessness, elation, hyper-focus, complete apathy, avoidance, rage and everything in between.

Isn’t this just everyone?

While all people get this, it’s fleeting. In ADHD it’s all the time. (5% vs >80% experience this constantly or most of the time, according to Dr William Dodson MD).

For people with ADHD it never stops. Our bodies are constantly in fight or flight mode on a hormonal (i.e. biological chemical) level – all systems set to go (hyperactive) or run (inattentive because self-preservation is what the body wants, thinking is thrown out the window), often at the same time. It is very tiring, resulting in commonly being tired. Others are often “wired” (i.e. hyperactive) and don’t sleep/have less sleep because of this.

What’s going on with hormones?

In effect, consumption or ingestion of dopamine (for pleasure/satisfaction) and noradrenaline (AKA epinephrine) is not ingested in “normal” amounts or regularity in the brain. That’s what the meds help with – they regulate and assist with the transfer and dosage levels of these two hormones, at levels comparable to normal brain function.

Are meds the only solution?

No, but they are the most tried and tested effective way to help people with ADHD to cope. They help the brain regulate the normal ingestion of the hormones dopamine and noradrenaline. Since they are also open to abuse they are Schedule B drugs, regulated internationally and only prescribed (initially, at various trial incremental levels [called “titration”]) by trained psychiatrists.

There are three drug formulations available. I have tried all three at various dosages and none of them had any positive benefit or effect. 12% (according to Dr William Dodson MD) are drug treatment resistant. I am one of them. There are no other medical alternatives.

So what are non-medical alternatives?

You can’t replace the missing hormone levels issues without the meds but some behavioural coping strategies are available, typically taught and honed with the help of a specialist ADHD coach. You will not be able to overcome the medical issues, but you may be able to work out coping strategies that work to circumvent the symptoms (how ADHD affects your behaviour). This works best with medication + coaching together.

In the absence of medication the brain is still in fight/flight mode, making the coaching that much more difficult., but with time and skill, it all helps.

Will I ever be “normal”?

That’s an existential question. What is normal? But seriously, ADHD is both a blessing and a curse. You get the good stuff (when you find a skill or task that you enjoy, the dopamine flows like crazy and you’re “in the zone” and it’s amazing), but anything outside of that is terrifying, frustrating and overwhelming. Your behaviour is lizard-brain – fight or flight. Coping is difficult and many people are seen as erratic, unreliable and careless.

Apparently, this results in frequent school detention for disruptiveness, obstructiveness, missing school, all seen as having “bad behaviour”.

In adults, speeding tickets (because of impatience), addictions (drugs, alcohol, gambling etc. – because you are chasing the dopamine high that may never come), being obstructive/defiant and other antisocial behaviour as common. Job hopping/getting fired a lot, apparently are common. Prison is surprisingly common, and ADHD is routinely underdiagnosed.

These are sanctions because of the effects, without dealing with the cause of the issue. You’re not naughty or nasty – You have a genuine underlying medical condition and the world is overwhelming and yet responses are misunderstood and perceived as hostile and aggressive – which they are, but if you’re not asking what’s going on/not aware, you’re judging a medical response with a societal expectation that doesn’t know there is a medical cause.

And yes, ADHD is classed as a disability under the law (in the UK, anyway).

Joy and satisfaction: Dopamine

If you don’t ingest dopamine, joy is hard to experience. Imagine a joyless life. Hard, isn’t it? But that’s quite normal for me. Joy is rare, satisfaction at best. Mostly it’s “meh” and often apathy. If almost nothing gives you joy, living is quite a miserable experience.

On the other hand, when you find what makes the dopamine flow (and you have to really work hard to find out what triggers that for you), it’s amazing. You can go for hours on something, you are productive and probably won’t eat or get up for breaks. The time flies. It’s the best feeling in the world, but it’s so exceedingly rare (unless you are lucky enough to work often with the things that trigger that feeling).

Some people with ADHD love “boring” or repetitive tasks, which most people hate. I personally love a puzzle, or challenge. Many people hate these slow, laborious tasks. I can’t say why some slow boring tasks work for me and others don’t. I’ll take a stab at saying, “there is a foreseeable end in sight, you know what the outcome is.” Maybe the drip-drip-drip of getting 1 step closer to the goal in a puzzle or challenge works, maybe it doesn’t.

The drip-drip-drip of dopamine from social media “pings” works for many (which is why social media is a drug), and the “ping” and “like” alerts are built to feed on that, so you come back for more. It doesn’t work for me, and I don’t miss it when I parked my Facebook and stay off most social media. Mostly the pings are a distraction and an annoyance, meaning I can’t get anything done (it’s hard enough without distractions). Most of my notifications are turned off.

It’s arbitrary when the dopamine trigger works and when it doesn’t, but if you identify what works for the you, harness it, it’s a rocket engine waiting to go, but if you get it wrong, the rocket ship will blow up on the launch pad (frustration, overwhelm, distractions, leading to self-esteem issues and more).

And another thing!

This post previously ended long before now, but I keep editing it. Why? Because there’s always “and another thing” to add. You’ll hear this a lot from people with ADHD. We lose track of what we were saying, go off on a tangent (because the brain is over-firing at high speed), and sometimes we even come back to what we were saying, but mostly we forget. It’s kind of funny and kind of a embarrassing.

We over-explain or give much more detail than people wanted or expected, not always on the subject we were talking about, because we want all the details laid out, and don’t filter very well, or judge social situations (and the high rate of cross-over with ASD [autism] may be a factor. That’s the impulsiveness in action too.

Get to (or stick to) the point!

When you want just the top line details, you will probably not get that from someone with ADHD, so please be patient with us and work with us to get what you need, honing down little by little. What you want is in there, we just need a little help whittling it down.

Which is why this post is much longer than I hoped for, highly detailed but still, hopefully useful.

Tales of Tenacity: The Rice Incident

Why yes, I would like to spend 1.5h of my Friday evening sorting out mixed basmati and baldo (Turkish) rice grains, thanks for asking.

A self-inflicted mistake while making dinner, I mixed them (while dry, thankfully). They cook very differently so need to be separated.

Option 1: Throw it out and leave it at that. Where’s the fun in that?

Option 2: Sort them mechanically, but how?

Option 3: Get sorting: Challenge accepted!

How did this happen, you may ask. I have 2 jars, one with basmati rice, one with baldo. And a bag with baldo that didn’t fit in the jar. I had bought basmati rice earlier in the day and I refilled the basmati jar. So far so good. Or not…

So I put the baldo rice from the bag into the pot (dry pot, thankfully no water yet). And then I saw the label in the jar saying “baldo”. (I cut the label from the bag and put it in the jar when I fill it, so I know which jar has which item in it). I do the same with flour (spelt vs white vs wholemeal etc).
BUT…
The baldo label was somehow placed, by me, in the basmati rice jar! So when I reached for the “baldo” jar to started adding the rice to top up the baldo in the pot, it was the wrong rice. ARGH!

I put the mixed mess to one side and started dinner, and then got on with the sorting, in small batches of ~10 grains at a time.

Maybe 10,000 sorted grains and 1.5h later, I had unmixed rice.

Now this is where is gets strange, if it wasn’t strange before: I loved sorting it!

I had the radio on to my favourite 90s station, and it was therapeutic, I aim to do a great job, and time is not a constraint. Repetitive tasks do not phase me in the slightest.

Admittedly I had other more important things to do with my time, but it was somehow like the world’s weirdest iPad sorting game, in real life. “Sort these grains of rice by size” game, anyone?

When I told some friends, one said, “Oh, it’s good to hear you enjoyed it. Maybe, it would be your new Friday night fun ritual”.

Will Smith GIF by Carpool Karaoke: The Series on Apple Music - Find & Share on GIPHY

That said, I simply love intricate tasks, no matter how small. Many colleagues over the years have commented on my tenacity and eye for detail. I don’t see how sorting rice is any less worthy of such attention and excellence.

Would I do it again? Absolutely, if it needs doing. It could be data queries, ticket triage, cross-checking records or rice, it really doesn’t matter to me. If a job needs doing it is worth doing well. If I enjoy it, so much the better. And I can eat the evidence.

Confidence Intervals: Bernoulli Distributions and sample means for beginners

I was recently doing a unit on statistics from Khan Academy about confidence intervals and it mentioned p, 1-p and Bernoulli Distributions, without the prior context. So here’s what I managed to understand from it, to help me understand later parts of the unit. Hopefully this will be useful for you too.

The starting is point for me was to understand what a Bernoulli Distribution is.

What is a Bernoulli Distribution?

A Bernoulli Distribution is where there are only 2 possible outcomes. e.g. You vote for candidate A or candidate B. If we are only counting the number of votes for candidate A, then all other votes are not for candidate A. Never mind if there are 2, 5 or 25 other candidates. It is about candidate A or not for candidate A.

So 52% vote for A. So p = 0.52. So those who did not vote for them is 1-p, so 0.48, or 100% – 52% = 48%. 48% is 0.48 of 1. So that’s how we get 1- p = 0.48.

Another example is not “what value on a dice will you roll” but “if I role this dice will I get a 6?” So p = 1 in 6, or 1/6, or ~0.166. So 1-p = 1-0.166 = 0.834.

The other example is flipping a biased coin, so the chances of heads/tails aren’t 50:50.

The important thing to know here is these 2 outcomes are the only possible outcomes. You have only 2 choices of hitting the desired outcome: True (1) or false (0).

You can’t have a mean of a choice between these 2 options. You either hit the target (p) or you don’t (1-p). There is no other possibility.

You can’t have a mean of somewhere between true and false/hit or miss/they vote for candidate X or they don’t/heads or tails/roll a 6 or not roll a 6. This was my stumbling block. Until I understood this, I struggled.

So p of rolling a 6 is the mean. 0.166 (or ~16.6%). On average (the mean) for a normal distribution, ~16.6% of the time you will roll a 6.

This helped me get started understanding what they were talking about.

One more thing to add, is that since this is a sample of a larger population, we use (p-hat, though it may not be so obvious on your screen). In effect, p and are both means.

For a whole population we use p.

For a sample sample population we use .

What is a “sample distribution”?

That just means it is a sample of a larger population. e.g. a sample of 5000 people out of a poll of voters.

So the sample distribution is the sample data from the whole data set, where there are only 2 possible outcomes, and we use this for our p and 1-p (or more accurately, and 1-) values.

So later on, when we work out the mean of a sample population ( ), this is (1* + 0*(1-)) / n, or, simplified, / n. or / n -1 as is the way to un-bias sample populations, but that’s not the point here.

Why multiply things by 0? Truthfully, I don’t know why. The way I understand it that works for me is that since we really aren’t interested in the 1- value, if we multiply that by 0, (hand movements like magician making things disappear), it is gone, leaving us only with to play with.

Sal from Khan Academy shows this the long way round and eventually ends up with a neater, shorter formula ( / n), but this hopefully helps explain what he did and why he did it.

Excel: Create tables, naming them, and then referencing aliased columns

On my Data Analysis course there is a lot of heavy Excel, and, even as a seasoned Excel user, some of it is new to me. I can sum up values in a column just fine, but I have moved into areas which are entirely new to me, such as conditional summing.

I then ran into an issue where I was unable to successfully sum up values using the aliased table’s column names, so I’ll share that with you too.

Here are the new concepts we are dealing with. Let’s walk through them:

  • Turning data into a table, and giving that table an alias: This automatically adds new rows into the table dataset without you having to specify the new table dimensions.
  • SUMIFS(): This function lets you sum up values based on conditions, much more streamlined that SUM with many nested IF statements. The old way with nested IFs was horrible. The new way, since Excel 2016 I believe, is significantly easier.
  • Referencing aliases tables and columns within the SUMIFS or other functions.
  • Absolute references when using aliased tables with column names

So, as an example, let’s say we have a sheet of 12 rows of data plus the header row, starting on row 3 (containing column titles), and extending down 12 rows. Let’s say it has 10 columns, So the data is in A3:J19.

Create a table from the data

Next, let’s turn that data into a table: On the Excel ribbon, select Insert -> Table -> select the range of data -> check the “My table has headers” option, and click OK.

If you see striped alternate rows, you now have a table. If you add data below the table, they will get subsumed into the data set automatically. Neat!

Naming your table

Next, let’s name the table. Select any cell within the table and you will see a new item on the Excel ribbon called Table Design. On the left, let’s name the table, “MyTable”.

Using SUMIFS

So now let’s work with the data.

In a new cell below the table (or in another sheet), let’s get a total of the revenue from the Sales column where the column A data is “Actual”, column G is “002 Sales UK” and column H is “soft”. How do we do this? We use SUMIFS.

=SUMIFS(<column where we want the data to come from for summing>,<where to look for 1st condition>,<condition to look for in 1st condition range>,<where to look for 2nd condition>,<condition to look for in 2nd condition range>, etc)

NOTE: The conditions are all AND conditions, so if any are false, that row of revenue won’t be summed. The conditions are case insensitive.

Let’s start by building the formula the old-fashioned way, ignoring the table name and field names.

=SUMIFS(J4:J19,A4:A19,"Actual",G4:G19,"002 Sales UK",H4:H19,"soft")

This returns 2606471. That is to say, revenue from cells J12 and J13, which matched the criteria.

Swapping out absolute references for aliased field names

Next, let’s refactor the data to reference the table name and column names. Let’s do this just with the revenue column.

If we strip out J4:J19 and replace it by clicking on the title of column J, we get:

=SUMIFS(MyTable[[#Headers],[Sales]],A4:A19,"Actual",G4:G19,"002 Sales UK",H4:H19,"soft")

Strangely, the formula now returns a #VALUE error. Thanks, Excel!

So here is the interim solution: Strip out “[[#Headers],” and fix the number of closing brackets, leaving you =SUMIFS(MyTable[Sales],A4:A19,"Actual",G4:G19,"002 Sales UK",H4:H19,"soft")

Now you get a proper returned value (2606471).

Make the field reference into an absolute reference

When you drag a cell with a formula in it to a new cell, the fields referenced move too, as they aren’t absolute (i.e. locked to the row and/or column). So we have to make the field reference absolute. Normally we’d use $, e.g. $J$4:$J$19.

However, since we can’t put $ before [Sales] we have to double up the reference to [Sales] and wrap that in [...] so you get “...[[Sales]:[Sales]]

Result:

=SUMIFS(MyTable[[Sales]:[Sales]],A4:A19,"Actual",G4:G19,"002 Sales UK",H4:H19,"soft")

Now you return the result 2606471.

Finally, we can substitute and fix up the other 3 references too. Here it is condition by condition, each on a new line for readability.

BeforeAfter
=SUMIFS(MyTable[[Sales]:[Sales]],=SUMIFS(MyTable[[Sales]:[Sales]],
A4:A19,"Actual",MyTable[[Predicted/Actual]:[Predicted/Actual]],"Actual"
G4:G19,"002 Sales UK",MyTable[[BU]:[BU]],"002 Sales UK",
H4:H19,"soft")MyTable[[Paper type]:[Paper type]],"soft")

You should see the result 2606471. If you see 0 or #VALUE, something is wrong somewhere.

Doing it with column-only references

Yes, I could have done this all with references using column lettering, such as =SUMIFS(Sheet1!J:J,Sheet1!A:A,"Actual",Sheet1!G:G,"002 Sales UK",Sheet1!H:H,"soft") or =SUMIFS(J:J,A:A,"Actual",G:G,"002 Sales UK",H:H,"soft") but this assumes 1. that there is nothing else numeric in the columns referenced, and 2. I wouldn’t have learnt anything in the process.

Wrap up

Excel is often a frustrating beast. I still like it, but I had a bit of a running battle with it to find out why I was getting errors or 0 values, and fix the misleading #Header issue.

I thank my fellow students on my Springboard course for some tips pointing me in the right direction.

Some further reading is at https://exceloffthegrid.com/excel-tables-absolute-references/, which inspired some of my workarounds.

The aim of testing is not to pass all of the tests

I was recently working at a company where a developer, helping out on the testing activities, asked whether the aim of our (lightweight) test suite, hosted on the excellent Testpad, was to pass all the tests.

So here’s a thought. What if the aim is not to pass the tests, but to hypothesize, execute them, to find out if they are broadly functioning as expected, and record what else you can see while executing the testing. That is to say, using them as a guide, not a set of comprehensive instructions. The aim is to gather information that may prove useful to someone to know whether there are any risks that they should know about.

For this reason, the tests are lightweight, e.g. “Check X functionality.” This allows the scope for 1. confirming that it works against the specified requirements (hosted elsewhere, usually in our JIRA and design docs), 2. checking the visual implementation against design specifications, and 3. anything else we feel is important, at our own discretion, and using our learnt experiences and intuition. This could lead to testing security with some code injection, reviewing the accessibility, spell-checking the copy, or whatever else comes to mind that might result in exposing some level of risk. Maybe nothing comes of it, but if you don’t try, and something does get exposed, you wouldn’t have known. Can you really take that chance by sticking only to a very prescriptive Gherkin-style test script? And is it satisfying to do that, and only that?

If the aim was only to pass the tests, then you’d miss anything else in the single pursuit of that goal, or possibly dismiss anything extraneous that you probably would want to know about. Hopefully you do raise those other observations. If you were writing automation code to do this, the code would only do what you explicitly asked for. It would never know if the rest of the page was broken/features were not present/working/present but hidden/missing styling etc. The test would pass, and the application would potentially be a mess. What help is that to a user? For this reason alone, I am always in favour of human observation and interaction, as computers can’t and won’t notice “the other stuff”.

So, here are some thoughts:

So don’t get hung up on everything having to pass – you can’t force it to pass. If it’s not ready, that’s no bad thing. It’s a case of, “Have we called out the risks so that other stakeholders can make informed decisions whether to release or not?” Passing tests is not the aim of the game. We provide information about quality, we don’t enforce it. I have no whip, nor do my colleagues. To improve quality takes a team – an application (specced, designed & built), testers to spot the risks, PMs/POs to prioritise/accept these risks, the developers to make any required changes, testers to retest, and the cycle repeats. Quality is a team sport.

The aim is NOT to pass everything, the aim is to call out the risks, and if that means it doesn’t pass, that’s fine by me.

SQL JOINs and WHERE simplified

A fellow student on my Data Analysis course was having a spot of trouble with SQL joins, so with my many years of SQL experience I helped him out. Here’s JOINs and WHERE explained in what I hope is a simplified and understandable way:

SELECT from one table

Let’s start with the basics: SELECT

SELECT * FROM names

Great, we can get all the names from the names table.

SELECT from more than one table: Using aliases

Now we need to select from 2 tables. Let’s say we want to output the names with their addresses, matching on an id key from names, which matches to person_id in the addresses table. There are multiple ways to do this.

SELECT names.name, addresses.address
FROM names, addresses
WHERE names.id = addresses.person_id

This is horribly ugly and I suggest you never do this, so let me show you how we can do this more efficiently, using aliases.

SELECT a.name, b.address
FROM names AS a, addresses AS b
WHERE a.id = b.person_id

Let’s break this down quickly.

  1. We have 2 tables, “names” and “addresses”
  2. We are giving the names table the alias “a”, and the addresses table the alias “b”. We use AS to indicate that we are defining an alias.
  3. Now back to the top row of code: Instead of writing names.name we can substitute in the alias, so we use a.name, and instead of addresses.address we can write b.address.

Now for a bit more simplification:

SELECT a.name, b.address 
FROM names a, addresses b 
WHERE a.id = b.person_id

See, we removed the AS. Doing this is optional.

JOINS

Next, let’s look at how we joined the two tables together.

We can do either of the following:

  1. matching using WHERE
  2. matching using JOIN. Note that using JOIN requires ON. The indentation is just for readability.
SELECT a.name, b.address
FROM names a, addresses b
WHERE a.id = b.person_id

is the same as

SELECT a.name, b.address
FROM names a
INNER JOIN addresses b
ON a.id = b.person_id

There may be some confusion between WHERE when used to match tables and WHERE when specifying a condition. Let’s explore that.

WHERE as a join condition

When you use a WHERE to join two (or more) tables together, the WHERE replaces ON, so the WHERE is the matching condition between the tables.

SELECT a.name, b.address
FROM names a, addresses b
WHERE a.id = b.person_id

If you then need to specify something as a limiting condition from either table, simply add AND followed by your condition.

-- Get name and addresses for people whose name starts with M
SELECT a.name, b.address
FROM names a, addresses b
WHERE a.id = b.person_id
AND a.name like "M*"

WHERE as a condition when using JOINs

When you use a JOIN (inner, outer, right, left, cross), you use ON as the match condition. In this case, the WHERE just acts as an additional condition, since the table matching has already been done using the ON.

SELECT a.name, b.address
FROM names a
INNER JOIN addresses b
ON a.id = b.person_id
WHERE a.name LIKE "M*"

Wrap-up

I hope this explains things in a way that you find useful. There are multiple ways to code the same thing, and no right way. Use whatever style you prefer than gets you what you the data that you are looking for.