How would a defective heart valve be detected? Ecg?

Exam/echocardiogram. First of all, a complete history and physical examination is essential. If a "defective heart valve" is suggested by history or evident on physical examination, an echocardiogram (ultrasound) should be obtained.
Listening. A heart valve that either leaks or is too narrow is usually suspected by a doctor listening to the heart with a stethoscope and hearing a murmur. Further investigation, which is not always needed, is best done with an echocardiogram, a safe and painless test using sound waves. An ECG is not typically helpful for valve problems.