What is grey-box testing, and how does it differ from black-box and white-box testing?
Answer
Black-box testing derives checks from externally visible behavior without relying on internal implementation, while white-box testing uses knowledge of code structure and paths. Grey-box testing uses partial internal knowledge, such as architecture, database schemas or logs, to design stronger external tests without necessarily exercising code branches directly. These are perspectives on available information, not mutually exclusive test levels, and a tester may combine them for the same feature.
Strong answer includes
- defines the approaches by available implementation knowledge
- gives practical examples of partial internal visibility
- does not confuse box approaches with test levels
Practical example
For example, a tester designing checks for a discount feature doesn't read the discount-calculation code, but does know from the database schema that discounts are stored as a percentage capped at 100 in one table and as a flat amount in another; using that partial knowledge, they specifically craft external test cases combining a 100% percentage discount with a flat-amount coupon to probe an integer-overflow edge case they wouldn't have thought to try from the UI alone.