Experience Reports Ramblings

Threat modelling: Don’t forget your test engineer

I am a test engineer at my current work. After watching a number of talks at Ministry of Testing I also signed up for a secondary role; Cyber Champion. Through this role I’ve been learning about many aspects of cyber security and then running brown bags for our office to help people learn more about the various aspects of cyber security and I’ve also been doing vulnerability scanning. However what I most want to talk about is threat modelling.

If you’ve not heard of it, Threat modelling, at least within the context of software, is an exercise to identify vulnerabilities within your solution. I’ve written some words about it on my Threat Agents site (will explain “Threat Agents” shortly) so I won’t go into too much detail. In short, you put together a data flow diagram then look for vulnerabilities in it. Most people use a mnemonic called STRIDE to achieve this.

If this isn’t familiar then I’d recommend checking out my Threat Modelling write up on my threat Agents site to learn more, or have a look at Ministry of Testing, OWASP or have a quick Google.

Now to the point. Many teams may approach threat modelling by pulling in their senior software engineers, those with the most experience developing the software. However this is a poor idea. Bringing less experienced people to the table could lead to attacks that are “known but unsaid” and therefore easily forgotten or other blind spots that have been learnt throughout the years.

But there’s someone else that you really should bring along. Someone who spends most of their day trying to identify the risks in a feature. Someone who has the nack of finding holesand flaws. Someone who has probably has the widest knowledge of your solution.

Your test engineer.

Next time you are threat modelling, be sure to invite your test engineers. They don’t need to have any security experience or programming background. If they have the ability to spot that “X + Y – Z = Crash”, they are likely to also spot that “R + T – U = Vulnerability”.

If you’ve not done threat modelling before then it can seem quite daunting. Certainly when I was about to have my first sessions I felt pretty anxious that I’d be out of my depth, despite having read and understood plenty on it, including STRIDE. However after completing my first session, I loved it. Not only was it a useful exercise for the business but I really enjoyed threat modelling. As a test engineer I was in my element.

To help people get over that initial hurdle and avoid the risk of setting around a table, looking at a threat model going “errrr” (what my first session would have been without a great coach), I have created a card game called “Threat Agents“.

This takes the elements of STRIDE, adds my quirkiness to them and some structure to help you get going. The game is free to download and get to print off your own copies.


Automation Test Engineers re-enforcing 2 tier engineers

Before I begin, I have spent several years as a software engineer and was decent enough at it. As part of this I would write my own automated tests. Since switching to test, I’ve developed a host of handy test tools, developed simulators and even made my own automation tool that used our SDKs to test stability through a huge range if activities.

My point is, this is coming from someone who has experience of automation, even if I consider myself as a manual tester.

Anyway, the point…

The job market in my city is predominantly junior test engineers or senior automation test engineers. Companies are desperate to hire people who can write and execute automated tests. I would like to ask these companies, why get a dedicated person in to do this?

It might seem a little wild, but why do you need to hire someone for this role? Are these companies not writing automated tests? Or are the developers writing them?

You can probably see where I’m going here. Developers are more than capable of writing automated tests and when surely if a company is trying to follow good working practices like scrum, LeSS, ATTD, BDD, TDD and buzz word driven development, then surely the developers are writing the automated tests as part of the DoD for a PBI/story to move to dev done?

Having now made the case for automated tests to be in the ownership of developers, I now want to talk about why being an automation test engineer is regressive.

There has long been the concern or battle as to whether test engineers are second class engineers. I’m not entirely sure that picking up bits of work that software engineers often dislike or see as beneath them is helping to further the value of dedicated testers.

I’ve definitely felt like my skills and role as a test engineer has been most valued when embedded within the feature team, mostly picking up stories in dev done & awaiting testing. However seeing people taking up roles where they act as the safety net in a separate test group where work is lobbed over the partition kind of saddens me.

People who have invested lots of time, effort and maybe even money into learning automation may be scoffing at me right now. I’m not saying it is wasted effort. Far from it. If you enjoy it, rather than being an automation engineer, what about just being an engineer picking up any PBI like the rest of the team?

If you do love your testing and want to keep testing, like myself, there is plenty work to do. Use programming skills that you’ve learnt to automate some of your tests. For example creating a script to further load the system or maybe to help parse results from log files. How about pairing with a developer so they write the functionality whilst you write tests.

Even without the coding, a tester’s skillset is still massively valuable. Get yourself involved in backlog refinement. Go larvae hunting. Coach your team. Get involved in security. Help your team shift left.

Going forward, rather than replacing a team of manual testers with a team of automation testers, let’s use our skillset to identify risks, bugs and possible UX concerns as early as possible.


Do we trust our code?

Often a user story, PBI or whatever can include a number of alternate paths, scanerios or examples. The team has ideally listed them during backlog refinement and 3As.

When a diligent software engineer picks up the item, they can write their automatic acceptance tests and also provide manual testing as well, listing the testing in changes changeset notes.

So when an engineer, whatever their job title, picks up testing of the work, do they perform acceptance testing? Is there value in this?

In an ideal world, this can be considered busy work that we can skip. We should be able to trust our code when it is committed and instead focus our efforts on testing that is more valuable like exploratory testing to find defects or learn about the feature and its quirks or nuances. We can focus on performance, scalability and more complex testing.

But this requires us to trust our code. Something that historically isn’t the case… hence why we have testing! (and bugs)

So what can we do to remove the need for mindlessly going through a truth table, long list of ACs or a wad of scenarios? I don’t know and this is what I hope to learn. However I do have a few ideas of things to explore:

  • Code coverage analysis for automated tests with our available build tooling to discover if this can give a (genuinely) useful metric at a day to day level.
  • Automated test coverage within code reviews to discover if someone who doesn’t develop the code can identify what is adequately covered by automated testing.
  • Pair programming with a developer and tester to discover if this helps both improve coverage and visibility of coverage. Perhaps writing automated tests.


Releasing bugs is a team effort

In modern development we have many layers of automated testing and there’s manual functional and exploratory testing. We’re shifting testing further and further left to catch things early – ideally before a line of code is written. So why do so many applications that we use day-to-day have bugs? Why aren’t we as members of the engineering team catching everything?

Of course many of the bugs that are in production software have been caught and triaged. We simply decided not to fix them. However I plan to look at how we manage to miss bugs.

It takes a real team effort for a bug to get into the wild.

I’ve been talking about bugs a bit lately and know that I am not alone in taking an escape from a feature I was involved in as a personal failure. I felt this way as a developer and I still feel that way as a test engineer. However I know that not only is it not fair to blame any one individual, it should be an opportunity to learn. From this I’ve put together the series of mistakes and failures required by the entire team in order to ship a bug.

Missed when writing the story

I don’t want to dwell here as I feel that when writing a user story you are focused on the expected behaviour that can be found through example mapping or thinking about user workflow. That isn’t to say that you shouldn’t be conscious of these sort of issues.

Missed during planning / refinement

Before a story is picked up by a developer, we would expect it to have been refined and reviewed. Multiple members of the team should have been involved in looking at it. However for an escape to happen, it is likely that it was missed during these sessions.

Way to go team – you missed it.

Missed during 3As / kick off

Regardless of your way of working, hopefully there was some conversation when the story was picked up. This is the last chance to catch a bug before development starts and often one of the most detailed discussions. As well as ensuring that we understand the acceptance criteria, we really want to be thinking about the edge cases here.

Way to go amigos – you missed it.

Missed in developer testing

Any self-respecting software engineer will be testing their own work, both manually and using automated tests.

Way to go dev – you missed it.

Missed in code review

Code reviews are more than nitpicking over names or formatting. They most important goal is to spot mistakes that the developer may have made.

Way to go reviewer – you missed it.

Missed in test phase

Whilst many people will look exclusively at this stage, it isn’t the sole responsibility of the tester of a story to find / prevent bugs. Nonetheless,

Way to go tester – you missed it.

Missed in showcase / sign off

Many workflows out there have some sort of sign off to say the story is done. If your workflow has such a state then clearly the PO has signed off on this buggy story.

Way to go PO – you missed it.

Missed in general use of the software by engineers

Unless you’ve a super fine tuned CD pipeline, there’s a likelihood that members of your team or the wider group will have used the feature.

Way to go team – you missed it.

Missed in release / sanity testing

Of course not all teams do this, depending on your workflow and deployment system but if you’re doing testing before release, it hasn’t caught it. Before you say “it was out of scope”, ask yourself why the scope doesn’t catch it and whether its even worth doing.

Way to go tester – you missed it.

Way to go all – you missed it!

Escapes can and will happen. When it does you should look to learn, not blame, and if you do really want to play the blame game, it should never be one person.


Value of a bug report

Over the years I have seen an increase in the idea of not reporting defects within Jira, Azure DevOps, Bugzilla etc and having a conversation instead.

If it is an issue within the story itself and an AC failure then I certainly see the merit in skipping the bug report. It can be busy work to write up behaviour, send it to the developer and for them to go “ah sod – I forgot about that” and quickly fix it. However as a counter point, from my time as a developer I did find it easier when things were written down as my memory recall from verbal communication isn’t the best. As a tester, unless the story comes back to test quickly, I want some kind of record.

This post is about more than pointing out that as humans we have different preferences. My concern is when entering a bug that isn’t currently planned to be fixed is considered busy work. This includes bugs found in areas that isn’t related to the current feature, or is quickly reviewed sat together & consider too low priority. I still always want to log a bug here.

Documenting why a bug isn’t worth fixing

I’m sure we’ve all been there where a defect is seen when you’re up against it. It is a real edge case and doesn’t have a significant user impact. The developer realises that it will be in a high risk area of code and a chunk of effort to fix & test it. Quickly it is clear that it isn’t worth doing right now. This is made in the knowledge that not fixing it now means that it probably won’t get done at all. So why enter a bug?

Think about the case where 6 months down the line and someone else sees this for the first time. They raise it with their PO and its agreed as a nice fix to put in. The scope isn’t quite understood so a developer goes away to investigate it. Half a day later they come to the same conclusion as before but aren’t all that confident in their understanding and want to get a second opinion from another team. “Oh that rings a bell. Yeah, real can of worms.”

The 15 minutes saved by skipping writing this down has saved a lot of time here!

What about when the customer reports it?

Very much in the same line of thinking as above, what about when the rather angry customer phones tech support complaining that half the time they try saving to their shared space, they get an error and need to retry.

Tech Support haven’t heard of the issue. It isn’t in the bugs / known issues list available to them. So naturally they investigate. A chunk of time later it comes to Engineering. They try and reproduce it and confirm it is a bug. It is then scoped and fixed by a team.

The team involved in the fix decide that a bug escape review (or whatever your company calls it) should be held. How was this missed?

If only that bug was entered eh? Tech Support may have known already. The team responsible for fixing it would have known who to speak to about it.

Bugs can be useful for learning

I’ve mainly worked with large, complicated software. This means there’s tech debt and a deep history of why some of our more complicated code exists. When it comes to developing a feature that has been around the block a few times, unless you yourself are familiar with it then it can be good to know about the gotchas and challenges. Similarly when identifying the risk and scope of testing, what bugs and challenges have we seen in the past?

A searchable pool of defects that includes changeset notes, a discussion on how to fix an issue or why it isn’t fixable can be pretty handy here! I’ve learnt about some of the nuances of the protocols used by our solution through developer’s bug comments.

I also believe that just knowing about the quantity of bugs in software is important. Zero bug software isn’t saying zero bugs are in the application – give me 30 minutes and I’ll prove otherwise – but that we’re leaving zero bugs in an open state. Just as zero bug development shouldn’t be misinterpreted as developing bug-free software, it shouldn’t be misinterpreted as don’t bother entering bugs!

As engineers we are all responsible for quality but how do we gauge that if we’re not recording bugs. How can we say that we have an understanding of our software’s quality level when there is no visibility of how many bugs we have accepted.

Within the world of cyber security it is known that you can mitigate, accept, transfer or avoid vulnerabilities. The same is true of bugs. Marking a bug as won’t fix is accepting the risk and impact on a customer should they encounter it.

The next time you or someone on your team says “don’t bother entering a bug”, make sure that everyone involved in the decision knows that they are keeping quality issues to themselves and they may be screwing over their colleagues down the line.

ACs passed. Able to place mug on the table. User story moved to done.