TestSurgeon is a profiler that monitors the execution of unit tests to collect data on what code is being tested and how. It provides a test similarity metric and visualization to help restructure unit tests. It works by picking a "red" test method, ranking similar "blue" tests, and visualizing their execution differences. This helps define fixture initialization between similar tests and discard superfluous tests. TestSurgeon aims to reduce test size and improve maintenance by spotting differences between tests.