You can definitely tell if the computer on board needs reprogramming if the computer can no longer communicate with the engine sensor's feedback.
Another occasion that you may reprogram the ECU is when throttle body has been modified, the engine has been turbo charged, different exhaust configuration, and many other things.
For example, if you are sure that your TPS (throttle positioning sensor is working properly based on reliable secondary tester), then it is more likely you will need to reprogram the computer on board.
Most computer on board or ECUs store their program in the flash memory or in erasable programmable read only memory also known as EPROM. There is an after market flash memory re-programmer for practically all of the car ECUs.
The latest ECUs now have their own CPU loaded with firmware and have a better control and allow upgrades.
The rule of thumb is that if the ECU can no longer interpret or return response on the data inputs, it is more likely that the program has been erased and reprogramming is a must.