Does my Cummins ECM need Trim Codes?

Cummins X15 Common Rail Fuel System

Failing to provide the correct injector Trim Code to the ECM could lead to problems such as lack of power, bad fuel ecoomy, or even DPF blockage. How can you know if your Cummins engine needs Trim Codes? How can you update the Trim Codes following an injector swap?