A traditional union with collectively-bargained pay grades and seniority probably wouldn’t work in hi-tech but an even more traditional mediaeval style guild could work very well indeed.
And what is an interview if not a test? Or are you advocating written exams only - I don't see why this would be better than a well designed interview process.
You don’t have to do it over and over for each job you apply for?
It also takes some onus off the hiring team to ascertain the technical abilities of prospective hires. “Just get me a guild member!” Now you can interview on other qualities...
I think most (but not all) fields would find a traditional union too limiting and frustrating these days, not to mention the issues with corruption they are plagued with in the US. A flexible and modern hybrid with a guild type system, more like a framework than a prescriptive structure, could get a lot of people on board.
Sysadmins have guild-style organizations (see: USENIX, LOPSA) but they've not had as much impact on hiring and income as would like to be believed. If anything, they've served as a filter for HR, who immediately tried to weaponize it.
I'm not saying a traditional union is the Way, but tech workers as a whole are severely lacking a cohesive voice, any voice. The egregious hiring practices, which have been turned into a game at the highest levels, are symptoms of this madness. When was the last time a doctor had to bring Frankenstein's monster back from the grave with no tools while blindfolded? In tech, that's a fairly typical interview question.
It shows in the amount of overwork-related discussions, shrugged off as part of being a highly-paid, salaried employee. All the while, sharing on LinkedIn this great new shiny your company's CEO really, really wants people to see.
Pay has not been an issue, but overwork has been, and so has the interview process. A union/guild backing could help with this.