A medical differential diagnosis always begins with the patient history. Details of your health, symptoms, and function give the doctor clues to what is going on. Comparing symptoms from before the knee replacement to now can also be helpful.
Infection doesn't happen very often but it must always be considered first. Early treatment is very important to avoid future problems. Pain that doesn't go away, swelling, and redness are signs and symptoms of infection. Wound drainage or failure to heal are also indicators.
There are several tests that can also aid in the diagnosis. If there is wound drainage the area can be tested for local infection. Fluid from inside the joint can also be removed and tested. Lab work such as blood tests can measure your white blood cells for signs of infection.