Partially safe evolution of software product lines - SAMPAIO, Gabriela Cunha (2017)
Software product lines (SPLs) are sets of related systems that are built based on reusable artifacts. They have three elements: a variability model, that has feature declarations and dependencies among them; implementation artifacts and a conﬁguration knowledge, that maps features to their implementation. SPLs provide several advantages, like software quality and reuse improvements, productivity gains and the capacity to customize a system depending on customers needs. There are several challenges in the SPL development context. To build customizable software and meet all customer needs, SPLs tend to increase over time. The larger a SPL becomes, the higher is the complexity to evolve it. Therefore, it is not trivial to predict which products are aﬀected by a change, specially in large SPLs. One might need to check if products had their behaviour preserved to avoid inadvertently aﬀecting existing users in an evolution scenario. In refactoring and conservative extension scenarios, we can avoid this problem by checking for behavior preservation, either by testing the generated products or by using formal theories. Product line reﬁnement theories support that by requiring behavior preservation for all existing products. This happens in a number of situations, such as code reﬁnements. For instance, in function renaming transformations, all existing products behave exactly as before the change, so we can say that this transformation is safe. Another example of SPL reﬁnement would be changing a feature type from mandatory to optional. In this case, we increase variability, but preserving all products from the original SPL. Although several evolution scenarios are safe (or technically reﬁnement), in many others, such as bug ﬁxes or feature removals, there is a high chance that only some of the products are reﬁned. In these scenarios, the existing theories would give no support, since we can not assume behaviour preservation holds for all products. To support developers in these and o ther non reﬁnement situations, we deﬁne partially safe evolution for product lines, that is formalised through a theory of partial reﬁnement that helps to precisely understand which products should not be aﬀected by an evolution scenario. This provides a kind of impact analysis that could, for example, reduce test eﬀort, since products not aﬀected do not need to be tested. Additionally, we formally derive a catalog of partial reﬁnement templates that capture evolution scenarios, and associated preconditions, not covered before. Finally, we evaluate the proposed templates by analyzing commits from two product line systems (Linux and Soletta) and we found evidence that those templates could cover a number of practical evolution scenarios.