The most often-cited source of Program to an interface, not an implementation. is GoF Design Patterns (1995): https://en.wikipedia.org/wiki/Design_Patterns#Introduction
Chapter 1 is a discussion of object-oriented design techniques, based on the authors' experience, which they believe would lead to good object-oriented software design, including:
- "Program to an interface, not an implementation." (Gang of Four 1995:18)
- Composition over inheritance: "Favor 'object composition' over 'class inheritance'." (Gang of Four 1995:20)
(also: https://www.artima.com/articles/design-principles-from-design-patterns )
I've never heard of any principle recommending "Test the interface, not the implementation".
Unless I'm completely misunderstanding the intention behind this advice, I see no reason for such a principle to exist because it seems to be an unnecessary antagonisation of white-box and black-box testing.
Unlike other GoF principles, there is generally no reason why one type of testing should necessarily exclude the other, and indeed you would ideally have both if time/deadlines allow for it.
Furthermore, each type of testing has its own separate advantages and disadvantages. In many cases using both together, despite some likely testing overlap, can be complementary by providing insight and protection from different perspectives.