Like other claims HMRC are looking for the project to address an area of uncertainty in science or technology, a given piece of software being new does not make it R&D, there must be something new underlying it. To that end as well as the main guidance on what constitutes R&D there are additional guidelines with respect to software on the HMRC website.
Where HMRC are risk assessing or challenging a software claim they make take advice from HMRC's own corporate IT directorate known as CDIO however it will ultimately be a tax inspector on one of the R&D teams who will contact you and make any decisions.