To qualify for R&D tax breaks, IIRC having identified qualifying work for a segment of my firm, there must be elements of hypothesis, experimentation, results, etc that I would consider more science-y 'Research' than just turn the crank software 'Development.' It has to be both. And that has to be documented. And offshore research+development doesn't get you a tax break. The irony is that the R+D tax actually discourages onshore pure development as a 'trade' and encourages a split of onshore R+D and offshore D.
This sort of thing appears to be self-reported; I don't know if it ever gets audited. I don't know if big tech lies or creatively interprets what counts and that has contributed to the issue. But this article sort of over-represents what qualifies as R&D for US tax purposes.