Does science need philosophy?  Jason Brennan incisively critiques philosophers’ case for the affirmation.  How the “gotcha” works:

A: “Science doesn’t need philosophy! Science gets by on its own.”
B: “How do you know that the universe is uniform? How do you know that
the scientific laws won’t just change tomorrow for no reason? How do you
know that just because past electrons have all behaved one way that
future electrons will behave the same way? How do you know that your
experiments aren’t modifying the behavior of the things you observe in
such a way that makes your conclusions irrelevant for predicting outside
behavior? How do you know…”
A: “Well…”
B: “And you’re doing philosophy!”
Gotcha! Call this kind of argument the “gotcha!” argument. You ask a
person who is skeptical of the value of philosophy a question about
science, and she responds by doing philosophy. So, therefore, isn’t
philosophy valuable?

What’s wrong with the argument:

The problem, though, is that the conversation could continue as follows:

B: “Ok, you got me. Those are interesting questions and science
itself doesn’t really answer them. So, do philosophers have good answers
to these questions? Have they solved these problems?”
A: “Well…no, not really. I mean, I think my latest article in Synthese
helps, but basically everyone disagrees with me, and pretty much every
possible answer to these questions has really good arguments for it and
really good arguments against it. Not only do we lack any consensus in
philosophy on the interesting questions, but, if I’m honest with myself,
it’s entirely reasonable for us to lack consensus, because none of the
work is compelling enough to deserve widespread acceptance.”
B: “Great. I’m going to go back to doing science and just ignoring you.
Maybe let us know if you manage to settle anything in the next 2500
years.”
A: <sniff>

Reading Jason made me realize that a parallel “gotcha” does work.  Only this time, it’s not philosophy mounting the offensive, but common sense.  Here’s my revised dialogue:

A: “Science doesn’t need common sense! Science gets by on its own.”
B: “How do you know that the universe is uniform? How do you know that
the scientific laws won’t just change tomorrow for no reason? How do you
know that just because past electrons have all behaved one way that
future electrons will behave the same way? How do you know that your
experiments aren’t modifying the behavior of the things you observe in
such a way that makes your conclusions irrelevant for predicting outside
behavior? How do you know…”
A: “Well…”
B: “And you’re relying on common sense!”
B: “Ok, you got me. Those are interesting questions and science
itself doesn’t really answer them. So, does common sense have good answers
to these questions? Have they solved these problems?”
A: “Basically.  Common sense affirms all the assumptions science takes for granted: The uniformity of nature.  The stability of causal laws over time.  The existence of the physical world, the validity of sense perception, the reliability of human reason, and so on.”
B: “But what about all the common-sense claims science has refuted?”
A: “Science only achieves this by using more fundamental common-sense claims to undermine less fundamental common-sense claims.  For example, the validity of sense perception is a more fundamental common-sense principle than the apparent flatness of the Earth.  So when observations show the Earth is round, the common-sense response is to change our mind about the shape of the Earth, not the validity of the senses.  The same goes for, say, special relativity.  It’s weird, but it’s what our eyes tell us when we scrupulously measure.”
B: <hmm>

More here, here, and here.