In XP, there are two kinds of tests - "Acceptance Tests" and "Unit Tests". The Acceptance tests ensure that the code conforms to the requirements, end-to-end. The Unit tests are written against each individual part of the code as it is being developed. You also take significant steps to isolate the code that is being tested from the rest of the program.
Unit Tests are mostly white-box in that they are written in conjunction with the source-code. The first test proves that you can't get away with just doing nothing. After you have written the first test, you will examine your code, and write a second test that illuminates a failure condition within that code. You then work until that test ceases to fail, and continue the cycle until you can't think of anything more to test.