The obvious way to test the SRBs and SSME would be to fly an unmanned Shuttle mission. Any alternative meant developing a one-off rocket just for the tests.
NASA considered doing unmanned Shuttle flights from the beginning.
STS-1 pilot John Young, discussing the topic, in his 2006 interview with collectSPACE:
They wanted to fly the thing unmanned. I went to many, many meetings
where they wanted to fly the thing unmanned, but finally the program
manager up at Headquarters, John Yardley, he said he wasn't going to
come across California with nobody in the spacecraft.
So, we got to fly it manned. It's probably the safe way to do it. We
looked at California and there were all kinds of places you can land
out there...
Robert Crippen, his copilot, agrees in this Space.com interview:
But John and I were both proponents of us being onboard, because we
thought the flight had a bigger chance of success, and it would have
been very difficult to make it unmanned on the first one.
On the first four flights, the two-man crew had ejector seats to increase survivability.
Back then, there were rumors that there was only one real obstacle to making an unmanned Shuttle flight: there was no way to extend the landing gear remotely.
The same thread had another post that ties in with that:
In speaking with a number of the 1970s shuttle program guys (Engineering and Ops), there was at least an impression that there was a contingent of astronauts and managers that fought hard to keep an overtly unmanned flight option off the shuttle, despite how simple it would be to build in. This was supposedly done to ensure that pilot astronauts would not be regarded as superfluous later on - if we don't need them to fly it now, why have them fly it later? This would therefore reduce the importance of the pilots relative to the mission specialists. I've seen some documentation in the JSC archives (it may have even been among the "Young-grams" lending some credence to at least the existence of such a faction, if not their reasoning.
In the end, NASA did develop the means to do unmanned missions. The Remote Control Orbiter cabling first flew on STS-121.