There may be two reasons for giving extra credit. One would be to boost a low test score, the other would be to encourage achievement beyond the given assignment. I don’t usually recommend extra credit just to boost scores. However, it may be a useful way to encourage the “good” students to delve deeper into a subject or project that is an extra. If part of a class has the ability to do all their assigned work and have time left over, it is wise to fill that time with something productive. At the same time, asking a few students to do an extra research project, write an extra composition, and so on can produce negative attitudes if there is no “payback”.