How is costochondritis detected?

Push on ribs. If the doctor pushes on the ribs or sternum and it reproduces pain, it's likely costochondritis.