What is Bona Fide Resident Test?

Legal Definition
The bona fide residence test, like the physical presence test, comprises one way that an individual can qualify for the foreign earned income exclusion. In order to qualify for the bona fide residence test, an individual needs to reside in a foreign country for an uninterrupted period that includes an entire tax year. In addition, the bona fide residence test takes into account factors such as the individual's intention, the purpose of the trip, and the length and nature of the stay. There are special deductions and exclusions that accompany this only if the individual is a U.S citizen or U.S resident Alien and has a tax treaty. The bona fide residence is not always the same as the domicile. The domicile is defined as one's permanent home.
-- Wikipedia