I would not replace it - too costly and involved. Send it off for testing to ECU Testing. They will test it, report to you what they find and repair it if you agree to their charges. The added bonus if they repair it is there is no programming involved, just plug and play.
The alternatives are:
1. Buy a second hand ECU - must be matching part number - and it MUST have been reset BEFORE it was taken off the car. If it has not been reset to remove the original code, you cannot reprogram it without more specialised diagnostic equipment. Tech 2 can do it of course so you would need to tow it to the dealer and pay their costs. If it has been reset first then Vaux-com or Op-com can do it but you will need the 4 digit security code, again from a dealer for around £30, to access the system.
2. Buy an ECU kit. All parts MUST come from the same car and you will get a body module, CIM, key and key reader, engine Ecu and so on. Then you swap all the parts with no programming. Again, MUST be correct part numbers or ABS/airbag light will come on and then reprogramming.
Much easier to send for testing, I think.
https://www.atpelectronics.co.uk/pages/ecu-testing.html
http://www.ecutesting.com/