Black box, white box, and gray box testing techniques differ based on the level of internal knowledge of the system being tested. Black box testing assesses functionality without viewing internal structures. White box testing uses programming knowledge and examines internal logic and structures. Gray box testing combines aspects of black and white box testing by having some but not full internal knowledge. The techniques vary in their advantages like scalability, code coverage, and disadvantages such as redundancy.