We are generally not the target users of the software products we work on.
That's not to say we never use our applications or that we have no interest in those who do, but mostly we rely on feedback from elsewhere to tell us whether needs are being met.
Sure, as testers we'll interact with the software and maybe even consider ourselves to be a proxy for users. Yes, we'll probably have people in product and business roles translating, or inventing, customer requirements for us. And, yes, perhaps we'll even dogfood the stuff we build sometimes, to some extent.
I've lost count of the number of times I've asked developers whether they ran the software after their changes and been told that the tests pass. I've lost count of the number of colleagues I've had who work on a service and have little or no idea what clients it has and what kinds of tasks their users are trying to complete or why. I've lost count of the number of times I've been in arguments about the boundaries of a team's responsibility: should we care about just the function of our piece of a larger product or take a wider view on whether a valuable problem is being solved.
We are not the target users and that distance colours our views of what we build.
Yesterday I had a revelation. A colleague asked me to talk to his team about a unit testing manifesto that I created with a developer last year. The talk is a set of unit testing anti-patterns that we see all over the place and heuristics for avoiding them (example). That's not the revelation, though.
It was interesting timing because that same day I had been experimenting with Cursor for adding unit test coverage to a model-based testing tool that I wrote. I had also found that I was coaching Cursor, for example by adding rules or crafting requests or keeping a large conversational context, to avoid some of the very problems that the manifesto covers. But that's not the revelation either.
The revelation is that I was thinking about how I would frame the manifesto session next week and realised that, while we are not the users of our product, we are the users of our tests.
In test code, we aren't proxies for anyone else, we don't have or need indirection through layers of company structure to anyone else, and we aren't holding a can of Pedigree Chum in one hand and our nose with the other on behalf of anyone else.
The tests in our codebases were built for us. We are the stakeholders. They exercise the functionality we decided they should. They cover the input and output domains to the extent we choose. They are as readable and maintainable and comprehensible as we made them.
We understand our problems and our needs intimately. We know what we want, and we know what quality means for us, and we have direct access to create it and we get feedback on it directly. We are the target users.
So why are our tests so often so poor?
Image: https://flic.kr/p/677WBG
Comments
Post a Comment