At least when you test something before it goes out the door you know it will work.
From the context I assume you are trying to say that when you send hardware out the door you can know that it will work. Was that intended as a joke?
Let me be clearer. The design functions. You build it, you test it, you ship it. Unless it breaks, it will function as designed. If it breaks, it's broken.
Which reminds me about a previous attack on software, this concept that software should be "done right the first time" and not have any of this non-sense updates. This works if you fix the environment. The software will always do what it was intended to do. It doesn't age, it's caps don't dry out, give it the same environment and it will run as designed and shipped forever. But that never happens and expecting your 0 gauge train to run your new 1/4 gauge tracks is rather short sighted.
In software we get this type of support ticket all the time:
"I took your 8 bit shift register and put it in a socket for a 16 bit one and it didn't work!"
Of course, it can have genuine bugs. But so can hardware.
I think most EEs just don't grasp the actual complexity of most software (to be fair, many SEs don't either). I'm not talking about a writing a little firmware to blink lights, drive steppers, etc. I'm talking about real software that takes a large team to write, is 50,000 lines+ (often into the 100,000s or even millions), interacts with many different pieces of hardware and/or other software and services, etc.
It's not reasonable to expect that 100,000 lines of software will ever be perfect. The best you can do is what we do with safety critical software, and even this takes an order of magnitude more time and resources than normal software (and often more). You can test the software to the software requirement and show that it does, indeed, satisfy the requirements, and that it does nothing that operates outside of the requirements. It's enormously time consuming and expensive, but we do it all the time. That's how cars and airplanes, running millions of lines of software, operate day in and day out without killing people.
It still doesn't address errors in the requirements. Garbage in, garbage out.
But comparing electrical engineers and software engineers is a pointless exercise. I'm trained as an SE, but I've played on both sides at one time or another. EEs have their own problems to contend with that makes the job difficult and requires creativity and knowledge to solve, but in terms of sheer complexity there is really nothing at the board level that EEs do that come close to even simple software projects. I'm not talking about how hard the job is, or how much intelligence or knowledge you need, or anything like that. I'm just talking complexity in terms of connections and logic. Most boards have very little logic on them, and for good reason.
The simple truth is that it's FAR more efficient to build the electronics as simply as possible, and bury as much complexity as possible in the software/firmware. So to answer the OP, if you're going to be a modern EE, you'd better know how to write some software because most of your boards that do something interesting will have programmable components on them, and the best EEs will be able to test their boards and maybe even write some simple driver software, just like the best SEs (at least low level guys) are able to do basic hardware/electrical debugging and rework. And if it's a really simple project, maybe you just do the whole thing yourself. A lot of times, they either get bored, the EE work drys up or they just decide they like software better, and boom...they're doing software. I've seen it happens many, many times.
And for those who think there's a "push it out the door" mentality, or some other nonsense going on in the software industry, you can whine all you want but by the time you wake up in the morning, microwave your oatmeal, watch the news, check EEVBlog and drive to work, you've already interacted with software that extends for hundreds of millions of lines. HUNDREDS of millions of lines. How many bugs did you find? Overall, I think that's pretty damn impressive.