Programmers are told “depend on interfaces, not implementations.” But, given a program, is it possible even to assess objectively whether such advice has been followed?
Programmers frequently talk in ways like this about dependence, but the very term, like many used in software engineering, has hitherto eluded precise definition. In this work, we resolve a variety of confusions about dependence, and present a formal definition unifying multiple varieties of software dependence, grounded in Halpern and Pearl’s theory of actual causation. This definition is parameterized by the formal system characterizing the property of interest, and by constraints on “reasonable changes” to the program. By picking different choices of formal system, one can specialize our definition to characterize dynamic dependence (slicing), static dependence (correctness), and dependence of performance properties. Overall, our work provides a path to making conversations about software dependence fully objective, and might serve as a basis for future work automatically checking forms of dependence which were previously too abstract or high-level to be candidates for tools.