一句话:通过对126个GitHub Java项目的实证分析,以共同变更为指标检验面向接口编程能否降低依赖。
面向接口编程(programming to an interface, PTI)是面向对象软件开发中的常见建议,预期可带来抽象简化、降低对实现的依赖并提高灵活性。然而接口不可变、过度类层次可能增加复杂度,以及“推测性泛化”代码坏味等问题,使PTI的实际收益需要实证检验。为推进对PTI的经验认识,作者对GitHub上126个Java项目开展实证研究,重点以共同变更(cochange)为度量,评估PTI在降低依赖方面的收益。摘要未报告具体量化结果,但该研究旨在从大规模项目数据中检验PTI的依赖降低假设。
A popular recommendation to programmers in object-oriented software is to "program to an interface, not an implementation" (PTI). Expected benefits include increased simplicity from abstraction, decreased dependency on implementations, and higher flexibility. Yet, interfaces must be immutable, excessive class hierarchies can be a form of complexity, and "speculative generality" is a known code smell. To advance the empirical knowledge of PTI, we conducted an empirical investigation that involves 126 Java projects on GitHub, aiming to measuring the decreased dependency benefits (in terms of cochange).
@inproceedings{paperbot5283,
title = {Empirical Study of Programming to an Interface},
author = {Benoit Verhaeghe and Christopher Fuhrman and Latifa Guerrouj and Nicolas Anquetil and Stephane Ducasse},
booktitle = {ASE},
year = {2019},
doi = {10.1109/ase.2019.00083}
}