Do you think science inspires science fiction? Or the other way around?

Do writers take science to it’s next logical step? Or do scientists toil for years to make their favorite ideas from science fiction novels and movies come to life through the power of research and perseverance?

Probably a bit of both.