Delta-oriented Development of Software Product Lines

Similar documents
Combining Feature-Oriented and Aspect-Oriented Programming to Support Software Evolution

How To Combine Feature-Oriented And Aspect-Oriented Programming To Support Software Evolution

Fully Abstract Operation Contracts

Generative Software Product Line Development using Variability-Aware Design Patterns

Integration of Application Business Logic and Business Rules with DSL and AOP

Colligens: A Tool to Support the Development of Preprocessor-based Software Product Lines in C

Handling Database Schema Variability in Software Product Lines

Complexities of Simulating a Hybrid Agent-Landscape Model Using Multi-Formalism

Reactive Variability Realization with Test-Driven Development and Refactoring

A Configuration Management Model for Software Product Line

VDM vs. Programming Language Extensions or their Integration

FeatureIDE: An Extensible Framework for Feature-Oriented Software Development

Keywords: - Software Product Lines (SPLs), Product Line Engineering (PLE), Core Assets, Software Product Line Development.

Unification of AOP and FOP in Model Driven Development

JOURNAL OF OBJECT TECHNOLOGY

Integration of Application Business Logic and Business Rules with DSL and AOP

Incremental Model-based Testing of Delta-oriented Software Product Lines

Formal Specification and Verification of Avionics Software

A Model-Driven Approach for Developing Self-Adaptive Pervasive Systems

StaRVOOrS: A Tool for Combined Static and Runtime Verification of Java

Variability in Service-Oriented Systems: An Analysis of Existing Approaches

Software Engineering Reference Framework

Formal Engineering for Industrial Software Development

MDE Adoption in Industry: Challenges and Success Criteria

Rigorous Software Development CSCI-GA

Verification of Software Product Lines Using Contracts

Software Product Lines

The Timing Definition Language (TDL)

Chapter 6: Programming Languages

Dungeon: A Case Study of Feature-Oriented Programming with Virtual Classes

Tool Support for Software Variability Management and Product Derivation in Software Product Lines

Run-time Variability Issues in Software Product Lines

Seamless Method- and Model-based Software and Systems Engineering

Advanced Topics in model-based Software Development

SPLConfig: Product Configuration in Software Product Line

Agile SPL-SCM: Agile Software Product Line Configuration and Release Management

Integration of an open source rule engine to enhance the IHTSDO Workbench testing

CommentTemplate: A Lightweight Code Generator for Java built with Eclipse Modeling Technology

Software testing. Objectives

Table of Contents. CHAPTER 1 Web-Based Systems 1. CHAPTER 2 Web Engineering 12. CHAPTER 3 A Web Engineering Process 24

Trends in Embedded Software Development in Europe. Dr. Dirk Muthig

J a v a Quiz (Unit 3, Test 0 Practice)

Variation Management for Software Production Lines 1

Unified Static and Runtime Verification of Object-Oriented Software

What is a life cycle model?

This is an author-deposited version published in : Eprints ID : 15447

Software Life Cycle. Main issues: Discussion of different life cycle models Maintenance or evolution

Introducing Formal Methods. Software Engineering and Formal Methods

Foundations of Model-Driven Software Engineering

Salion s Experience with a Reactive Software Product Line Approach

Specification and Analysis of Contracts Lecture 1 Introduction

An Approach to Detect the Origin and Distribution of Software Defects in an Evolving Cyber-Physical System

Automatic Generation of Consistency-Preserving Edit Operations for MDE Tools

Chap 1. Introduction to Software Architecture

Software Architecture

Engineering Process Software Qualities Software Architectural Design

Product Derivation Process and Agile Approaches: Exploring the Integration Potential

Debian Packages Repositories as Software Product Line Models. Towards Automated Analysis

How To Write An Slcm Project Plan

The SPES Methodology Modeling- and Analysis Techniques

Federated, Generic Configuration Management for Engineering Data

Software Engineering. Software Development Process Models. Lecturer: Giuseppe Santucci

Programming by Contract. Programming by Contract: Motivation. Programming by Contract: Preconditions and Postconditions

Software Engineering Introduction & Background. Complaints. General Problems. Department of Computer Science Kent State University

Chapter 1. Dr. Chris Irwin Davis Phone: (972) Office: ECSS CS-4337 Organization of Programming Languages

MKS Integrity & CMMI. July, 2007

Configuration Management

Generating Aspect Code from UML Models

Software Development Process

Logistics. Software Testing. Logistics. Logistics. Plan for this week. Before we begin. Project. Final exam. Questions?

A METHOD FOR REWRITING LEGACY SYSTEMS USING BUSINESS PROCESS MANAGEMENT TECHNOLOGY

A Review of an MVC Framework based Software Development

Mining a Change-Based Software Repository

Overview Motivating Examples Interleaving Model Semantics of Correctness Testing, Debugging, and Verification

Overview. Software engineering and the design process for interactive systems. Standards and guidelines as design rules

Development of Enterprise Architecture of PPDR Organisations W. Müller, F. Reinert

WHITE PAPER DATA GOVERNANCE ENTERPRISE MODEL MANAGEMENT

Myths About Service-Oriented Architecture Demystifying SOA. producers can coexist, and still have no dependence on each other.

Use software to define silicon p. 15

RUP. Development Process. Iterative Process (spiral) Waterfall Development Process. Agile Development Process. Well-known development processes

An Aspect-Oriented Product Line Framework to Support the Development of Software Product Lines of Web Applications

Chapter 1: Introduction

A Mind Map Based Framework for Automated Software Log File Analysis

Transcription:

Delta-oriented Development of Software Product Lines Ina Schaefer Institut für Software Systems Engineering Technische Universität Braunschweig i.schaefer@tu-braunschweig.de Philipps-Universität Marburg 27. Juni 2011

Software Product Lines A product line is a family of products designed to take advantage of their common aspects and predicted variabilities. [Weiss; 1999] A product line is a set of systems sharing a common set of features that satisfy the specific needs of a particular market segment. [Clements, Northrop; 2001] 2

Product Lines in Industry Industrial-scale Approach for Reuse in Software Engineering Members of Product Line Hall of Fame: (http://www.splc.net/fame.html) HP, Ericsson, Nokia, GM Powertrain, Boeing, Bosch, Lucent, Philips, Toshiba Commercially successful, e.g., HP Owen Firmware Cooperative: 1/4 of the staff, 1/3 of the time, and 1/25 of the bugs (compared to previous single application engineering) 3

Product Line Development Feature Family Engineering Model Product Line Artifacts Base Feature Configuration Application Engineering Product 4

Product Line Development Feature Family Engineering Model Product Line Artifacts Base Feature Configuration Automated Product Derivation Product 4

Outline Delta Modeling Delta Modeling and Model-based Development Delta-oriented Programming in DeltaJava Incremental Product Line Analysis Pure Delta-oriented Programming 5

Delta Modeling of Product Lines Core Product Product Delta1 [...] Product Deltan Product for valid feature configuration. Developed with Standard Techniques Modifications of Core Product. Application conditions over product features. Partial ordering for conflict resolution. I. Schaefer, A. Worret, A. Poetzsch-Heffter: A Model-based Framework for Automated Product Derivation. Workshop on Model-driven Approaches to Product Line Engineering (MAPLE), August 2009 6

Configuration For a Feature Configuration: Determine product deltas with valid application condition. Determine linear ordering of product deltas compatible with partial ordering. Apply changes specified by product deltas to core product in the linear order. 7

Feature-based Variability Example: Trading System Software Product Line 8

Feature-based Variability Example: Trading System Software Product Line Payment Features 8

Component Modeling Component Core Model (for Cash Payment): Inv Inventory Cash Desk Inventory Inv Inv Bank Cash Desk! + Cash Desk Component Delta Model (for Card Payment): Inv Cash Desk! Bank Bank Bank Credit Card + + Delta-oriented Inv Development of Software Product Lines 9

Component! Modeling + (2) Inv Bank Cash Desk Bank Credit Card Configured Component Model (for Cash and Card Payment): Inv Bank Inventory Cash Desk Bank 10

Delta Modeling Evolutionary Development by Adding Product Deltas Explicit Treatment of Combinations of Features by Complex Application Conditions Proactive, Reactive and Extractive SPL Development Usable with Different Modelling Formalisms and Implementation Techniques Model Refinements are Orthogonal to Variability Modeling. 11

Model-based Development Feature Modelling Feature Model configure Feature Configuration create Modelling Level 1 Core Model1 Delta Models1 configure Product Models1 refine refine Modelling Level 2 Core Model2 Delta Models2 configure Product Models2 refine [...] refine Implementation Core Module Delta Modules configure Product Impl. I. Schaefer: Variability Modelling for Model-driven Development of Software Product Lines. Intl. Workshop on Variability Modelling of Software-intensive Systems (VaMoS 2010), Linz, January 2010. 12

Model-based Development Feature Modelling Feature Model configure Feature Configuration create Modelling Level 1 Core Model1 Delta Models1 configure Product Models1 refine refine Modelling Level 2 Core Model2 Delta Models2 configure Product Models2 refine [...] refine Implementation Core Module Delta Modules configure Product Impl. I. Schaefer: Variability Modelling for Model-driven Development of Software Product Lines. Intl. Workshop on Variability Modelling of Software-intensive Systems (VaMoS 2010), Linz, January 2010. 12

Model Refinement A Component Design can be refined to Class Diagrams: Each Component in Core Model is realized by a Class Core Diagram. Component Delta Models are realized by Class Delta Diagrams. For each Component: 1 Class Core Diagram Δ- Set of Δ- Class Implementation Delta Diagrams 13

Core Class Diagram Inv Inventory Cash Desk! + -Order Cash Desk Keyboard Cash Desk Bank Bank Display Inv tory Cash Desk Bank Bank 14

Core Class Diagram Inv Inventory Cash Desk Cash Desk! Refinement of Core Cash Desk Component Bank Bank + -Order Cash Desk Keyboard Display Inv tory Cash Desk Bank Bank 14

Class Delta Diagram ConnectionAgent Cash Desk Inventory Inv Bank +bool validatepaymentdata(int, int, float) + +Bank getbank() +void registerbank(bank) +! Credit Card + Inv Bank Cash Desk + Bank CashDesk Credit Card Inventory Inv CashDesk Cash Desk +void activatenoncashcontrollers() -Bank +void deactivatenoncashcontrollers() + Bank Cash Desk+void creditcardscanned(int) Bank +void CreditCardScanned(int) +void creditcardpinentered(int) +void CreditCardPinEntered(int) -void connectwithbank() -connectwithbank() * + +void startpaymentprocess() +!! + Keyboard CashDeskDisplay Card Reader CardReader + Printer +void enable() +void disable() +void enterpincode() 15

Class Delta Diagram ConnectionAgent Cash Desk Inventory Inv Bank +bool validatepaymentdata(int, int, float) + +Bank getbank() +void registerbank(bank) + Inv Cash Desk! Bank + Bank CashDesk Credit Card + Refinement of Inventory Inv Cash Desk Component Delta Model CashDesk Cash Desk +void activatenoncashcontrollers() -Bank +void deactivatenoncashcontrollers() + Bank Cash Desk+void creditcardscanned(int) Bank +void CreditCardScanned(int) +void creditcardpinentered(int) +void CreditCardPinEntered(int) -void connectwithbank() -connectwithbank() +void startpaymentprocess() Printer * + +!! + Keyboard CashDeskDisplay Card Reader CardReader Credit Card +void enable() +void disable() +void enterpincode() + 15

Commutativity Modelling Level i Core Modeli Delta Modelsi refine Modelling Level i+1 Core Modeli+1 Delta Modelsi+1 configure configure Product Modelsi refine Product Modelsi+1 If Model Refinement and Model Configuration are compatible, it holds that: refine(configurei((corei, Δsi),fc)) = configurei+1(refine (Corei, Δsi),fc)

Compatibility Additions of Modeling Elements are refined to Additions only. Removals of Modeling Elements are refined to Removals only. Modifications of Modeling Elements are refined to Additions, Modifications and Removals, such that for each Modification operation mod(e)of a Modelling Element e, it holds that apply(refine(e), refine(mod e)) = refine(e ) 17

Model-based Development Feature Modelling Feature Model configure Feature Configuration create Modelling Level 1 Core Model1 Delta Models1 configure Product Models1 refine refine Modelling Level 2 Core Model2 Delta Models2 configure Product Models2 refine [...] refine Implementation Core Module Delta Modules configure Product Impl. 18

Model-based Development Feature Modelling Feature Model configure Feature Configuration create Modelling Level 1 Core Model1 Delta Models1 configure Product Models1 refine refine Modelling Level 2 Core Model2 Delta Models2 configure Product Models2 refine [...] refine Implementation Core Module Delta Modules configure Product Impl. 18

DeltaJava - A PL for SPL Extension of Java with Core and Delta Modules Core Product is implemented by Core Module. Product Deltas are implemented by Delta Modules. A Product Implementation is obtained by Application of Delta Modules to Core Module. Type System ensures Safety of Delta Application. I. Schaefer, L. Bettini, V. Bono, F. Damiani, N. Tanzarella: Delta-oriented Programming of Software Product Lines. Proc. of 14th Software Product Line Conference (SPLC 2010), Korea, September 2010. 19

Example Product Line Feature Model: Expression Product Line Data Operations Lit Add Neg Print Eval 20

Core Module A core module contains a set of Java classes. core Print, Lit { class Lit implements Exp{ int value; Lit(int n) { value=n; } void print() { System.out.println(value); } } class Test { Exp a; void run() { a=new Lit(3); a.print(); } } } 21

Delta Modules Modifications on Class Level: Addition, Removal and Modification of Classes Modifications of Class Structure: Changing Super Class and Constructor Adding/Removing Fields/Methods Modifying Methods (wrapping with original call) Application Condition in when clause: Boolean Constraint on Features in Feature Model Partial Ordering of Delta Modules by after clauses 22

Delta Module for Add delta DAdd when Add { adds class Add { Exp expr1; Exp expr2; Add(Exp a, Exp b) { expr1=a; expr2=b; } } } 23

Delta for Add and Print delta DAddPrint after DAdd when Add && Print{ modifies class Add { adds void print() { expr1.print(); System.out.print(" + "); expr2.print(); } } } modifies class Test { adds Exp e; modifies void run() { original(); e=new Add(a, a); e.print(); } } Direct access to run method before modification. 24

Product Generation For a Feature Configuration: Determine product deltas with valid application condition in when clauses. Determine linear ordering of product deltas compatible with partial ordering in after clauses. Apply changes specified by product deltas to core product in the linear order. 25

Product Lit, Add, Print class Lit { int value; Lit(int n) { value=n; } void print() { System.out.print(value); } } class Add { Exp e1; Exp e2; Add(Exp a, Exp b) { e1=a; e2=b; } void print() { e1.print(); System.out.print(" + "); e2.print();} } class Test { Exp a; Exp e; void run() { a=new Lit(3); a.print(); e=new Add(a,a); e.print(); } } 26

DeltaJava Product Lines Starting from a Simple Core (Proactive Development) features Lit, Add, Neg, Print, Eval configurations Lit && Print && (Add Neg Eval ) core Lit, Print { [... ] } delta DEval when Eval { [...] } delta DAdd when Add { [...] } delta DAddPrint after DAdd when Add && Print { [...] } delta DAddEval after DAdd when Add && Eval { [...] } delta DNeg when Neg { [...] } delta DNegPrint after DNeg when Neg && Print { [...] } delta DNegEval after DNeg when Neg && Eval { [...] } Listing 5: Product Line Implementation in DELTAJAVA starti to implement all valid products. The feature model is described 27

modifies interface Exp { removes eval;} DeltaJava modifies class Lit Product { removes eval;} Lines (2) modifies class Add { removes eval;} } Starting from a Complex Core Listing (Extractive/Reactive 6: Removing Eval Development) from Complex C features Lit, Add, Neg, Print, Eval configurations Lit && Print && (Add Neg Eval ) core Lit, Print, Add, Eval { [... ] } delta DRemEval when!eval && Add { [...] } delta DRemAdd when!add { [...] } delta DRemAddEval when!add &&!Eval { [...] } delta DNeg when Neg { [...] } delta DNegPrint after DNeg when Neg && Print { [...] } delta DNegEval after DNeg when Neg && Eval { [...] } Listing 7: Product Line Implementation in DELTAJAVA starti features are not selected. Further, the delta modules DNeg, DN in the previous Delta-oriented implementation Development of Software areproduct required. Lines 28

Deltas vs. Feature Modules [AHEAD, Batory et al. 2004] Feature-oriented Programming Delta-oriented Programming Expressiveness Design from Base Module Design from Any Product Domain Features Optional Feature Problem Bijection between Features and Feature Modules Rearrange Code, Multiple Impl., Derivative Modules Delta Modules for Feature Combinations Direct Implementation of Interaction Safe Composition External Tools, Type Systems Partial Order for Conflict Resolution, Type System Evolution Refactoring Addition of Delta Modules Table 1: Summary of Comparison Jak DELTAJAVA DELTAJAVA Simple Core Complex Core 29 # feature LOC # delta LOC # delta LOC

Deltas vs. Feature Modules (2) # feature modules Jak DELTAJAVA DELTAJAVA Simple Core Complex Core LOC # delta modules LOC # delta modules LOC EPL [1] 12 98 7 123 6 144 EPL [26] 6 98 5 117 5 124 Calculator [7] 10 75 6 76 6 78 List [7] 4 48 3 58 2 59 GraphPL [25] 19 2348 20 1407 19 1373 Table 2: Evaluation Results (LOC is the number of lines of code) Summary. Feature-oriented programming is a general software engineering approach based on the principles of stepwise development that has been used to implement software product lines. In contrast, delta-oriented programming is specifically designed for this task such that it differs from feature-oriented programming as summarized in Table 1. 5 Evaluation 30

Applicability A set of delta-modules is applicable to a class table if all removed or modified classes exists. for every delta modifies-clause, all removed methods and fields exist. all modified methods exists. if added classes, methods and fields do not exist. 31

Well-formedness 1. The core configuration is a valid feature configuration. 2. No delta module has a valid application condition for the core configuration. 3. The partial order ensures that for every feature configuration, the set of delta modules with valid application condition a. is applicable to the respective intermediate product b. and conflict-free (all conflicting modifications are ordered). 32

Constraint-based Type System Type check and generate constraints for core and delta modules in isolation. A product is type checked by generating the product constraints (application of the delta module constraints to the core product constraints) checking the derived product constraints against the product s class signature table. I. Schaefer, L. Bettini, F. Damiani: Compositional Type-Checking for Delta-oriented Programming. Intl. Conference on Aspect-oriented Software Development (AOSDʼ11), March 2011. 33

Implementation Based on Xtext Language Development Framework Using XPAND for Code Generation Ecplise plugin with syntax highlighting, background parsing with error marking, code completion Stand-alone compiler 34

Implementation Based on Xtext Language Development Framework Using XPAND for Code Generation Ecplise plugin with syntax highlighting, background parsing with error marking, code completion Stand-alone compiler 34

Implementation Based on Xtext Language Development Framework Using XPAND for Code Generation Available at http://deltaj.sourceforge.net/ Ecplise plugin with syntax highlighting, background parsing with error marking, code completion Stand-alone compiler 34

Behavioral Specifications We consider design-by-contract specifications with class invariants and method contracts. Core module can be specified as a standard Java program using JML. Delta modules are specified by Specification Deltas Addition and removal of invariants Addition and removal of method contracts Modification of method contracts Delta-oriented Software Product Lines 35

Verification of DeltaJava SPL We use the KeY System for deductive verification of DeltaJava SPL. Input to KeY: Java Program with JML Specifications (generated from DeltaJava SPL) KeY generates proof obligations in dynamic logic and supports automatic and interactive verification. Delta-oriented Software Product Lines 36

Verification with KeY Delta-oriented Software Product Lines 37

Verification with KeY Delta-oriented Software Product Lines 37

Verification with KeY Delta-oriented Software Product Lines 37

Incremental Analysis Product P + Spec Proof Daniel Bruns, Vladimir Klebanov, Ina Schaefer: Verification of Software Product Lines with Delta-oriented Slicing. Intl. Conference on Formal Verification of Object-Oriented Software (FoVeOOS 2010), Revised Selected Papers, Springer, January 2011. Delta-oriented Software Product Lines 38

Incremental Analysis Product P + Delta Application Code-Deltas Spec-Deltas Product P + Spec Spec Proof Daniel Bruns, Vladimir Klebanov, Ina Schaefer: Verification of Software Product Lines with Delta-oriented Slicing. Intl. Conference on Formal Verification of Object-Oriented Software (FoVeOOS 2010), Revised Selected Papers, Springer, January 2011. Delta-oriented Software Product Lines 38

Incremental Analysis Product P + Spec Delta Application Code-Deltas Spec-Deltas 1. Determine valid proof obligations by Delta-oriented Slicing Product P + Spec Proof Daniel Bruns, Vladimir Klebanov, Ina Schaefer: Verification of Software Product Lines with Delta-oriented Slicing. Intl. Conference on Formal Verification of Object-Oriented Software (FoVeOOS 2010), Revised Selected Papers, Springer, January 2011. Delta-oriented Software Product Lines 38

Incremental Analysis Product P + Spec Delta Application Code-Deltas Spec-Deltas 1. Determine valid proof obligations by Delta-oriented Slicing Product P + Spec Proof 2. Proof Reuse for changed proof obligations Proof Daniel Bruns, Vladimir Klebanov, Ina Schaefer: Verification of Software Product Lines with Delta-oriented Slicing. Intl. Conference on Formal Verification of Object-Oriented Software (FoVeOOS 2010), Revised Selected Papers, Springer, January 2011. Delta-oriented Software Product Lines 38

Specification of Base Account public class BaseAccount { /*@ @ public instance invariant balance >= 0; @*/ int balance; public BaseAccount(){ balance = 0; } /*@ @ public normal_behavior @ requires x > 0; @ assignable balance; @ ensures balance >= \old(balance); @*/ public void update(int x){balance += x; } } Balance of a Base Account is always positive. Method Contract Instance Invariant Delta-oriented Software Product Lines 39

Specification of Delta Sync delta DSyncUpdate after Dretirement, Dinvestment when Sync { modifies class Account { add invariant @ public instance invariant lock!= null; adds Lock lock; add contract @ public normal_behavior @ requires x > 0; @ assignable balance, lock; @ ensures balance >= \old(balance); adds void sync_update(int x) {[...] } } } Delta-oriented Software Product Lines 40

Specification of SyncAccount by Application on Code and Specification Deltas public class BaseAccount { /*@ @ public instance invariant balance >= 0; @ public instance invariant lock!= null; @*/ Lock lock; int balance; public BaseAccount(){ balance = 0;} Balance of a synchronized account is always positive. /*@ @ public normal_behavior @ requires x > 0; @ assignable balance; @ ensures balance >= \old(balance); @*/ public void update(int x){ balance += x; } } @ public normal_behavior @ requires x > 0; @ assignable balance, lock; @ ensures balance >= \old(balance); void sync_update(int x) {[...]} } } Delta-oriented Software Product Lines 41

Example delta DSyncUpdate after Dretirement, Dinvestment when Sync { modifies class Account { add invariant @ public instance invariant lock!= null; adds Lock lock; add contract @ public normal_behavior @ requires x > 0; @ assignable balance, lock; @ ensures balance >= \old(balance); adds void sync_update(int x) {[...] } } } Delta-oriented Software Product Lines 42

Example delta DSyncUpdate after Dretirement, Dinvestment when Sync { modifies class Account { add invariant @ public instance invariant lock!= null; adds Lock lock; add contract @ public normal_behavior @ requires x > 0; @ assignable balance, lock; @ ensures balance >= \old(balance); adds void sync_update(int x) {[...] } } } Prove Invariant for methods accessing lock Delta-oriented Software Product Lines 42

Example delta DSyncUpdate after Dretirement, Dinvestment when Sync { modifies class Account { add invariant @ public instance invariant lock!= null; adds Lock lock; add contract @ public normal_behavior @ requires x > 0; @ assignable balance, lock; @ ensures balance >= \old(balance); adds void sync_update(int x) {[...] } } } Prove Invariant for methods accessing lock Prove Contract and Existing Invariants Delta-oriented Software Product Lines 42

Core DOP Strengths: Any product can be core product. Feature combinations in application conditions. Explicit ordering for conflict resolution. Usable with different modelling and implementation languages. 43

Core DOP (2) Weaknesses: Selection of core product (e.g., for mandatory exclusive features). Only partial generalization of FOP. Limited support for product line evolution (e.g., if core product is no longer valid). 44

Pure DOP Core Product Product Delta1 [...] Product Deltan Product for valid feature configuration. Modifications of core product. Application conditions over product features in when clauses. Partial ordering for conflict resolution in after clauses. I. Schaefer, F. Damiani: Pure Delta-oriented Programming. 2nd Intl. Workshop on Feature-oriented Software Development (FOSDʼ10), October 2010. 45

Pure DOP Core Product Product Delta1 [...] Product Deltan Product for valid feature configuration. Modifications of core product. Application conditions over product features in when clauses. Partial ordering for conflict resolution in after clauses. I. Schaefer, F. Damiani: Pure Delta-oriented Programming. 2nd Intl. Workshop on Feature-oriented Software Development (FOSDʼ10), October 2010. 45

Pure DOP Core Product Product Delta1 [...] Product Deltan Product for valid feature configuration. Modifications of core product. Application conditions over product features in when clauses. Partial ordering for conflict resolution in after clauses. I. Schaefer, F. Damiani: Pure Delta-oriented Programming. 2nd Intl. Workshop on Feature-oriented Software Development (FOSDʼ10), October 2010. 45

Pure DOP Core Product Product Delta1 [...] Product Deltan Product for valid feature configuration. Modifications of core product. Application conditions over product features in Product when clauses. line specification contains application conditions and ordering. Partial ordering for conflict resolution in after clauses. I. Schaefer, F. Damiani: Pure Delta-oriented Programming. 2nd Intl. Workshop on Feature-oriented Software Development (FOSDʼ10), October 2010. 45

Pure DOP Product Line Feature Model: Expression Product Line Data Operations Lit Add Neg Print Eval 46

e tions delta DLit{ adds interface Exp { } Eval adds class Lit implements Exp { } int value; } Lit(int n) { value = n; } } } on Product Line Delta delta Modules DLit{ adds interface Exp { n embedding of LFJ LP J in Section Listing 4. 1: Delta delta module DLitPrint{ for Lit feature oactive, extractive and re DOP is a conceptual delta DLitPrint{ modifies interface Exp { void print(); ing } } modifies class Lit implements Exp { adds void print() { System.out.println(value); delta DLitEval{ } Pure DOP, we use the } adds class Lit implements Exp { int value; Lit(int n) { value = n; } Listing 1: Delta module for modifies interface Exp { void print(); } modifies class Lit implements Exp { adds void print() { System.out.println(value); } } 47

Product Line Specification features Lit, Add, Neg, Print, Eval configurations Lit & Print deltas [ DLit, DAdd when Add, DNeg when Neg ] [ DPrint, DEval when Eval, DAddPrint when Add, DAddEval when (Add & Eval), DNegPrint when Neg, DNegEval when (Neg & Eval) ] Listing 5: Pure DOP specification of the EPL 48

Product Line Specification features Lit, Add, Neg, Print, Eval configurations Lit & Print deltas [ DLit, DAdd when Add, DNeg when Neg ] [ DPrint, DEval when Eval, DAddPrint when Add, DAddEval when (Add & Eval), DNegPrint when Neg, DNegEval when (Neg & Eval) ] Application ordering is defined by Sequence of delta sets. Deltas in the same set must be commutative. Listing 5: Pure DOP specification of the EPL 48

FOP and PureDOP Lightweight Feature Java [Delaware et al.; FOAL 09/FSE 09] FMD ::= feature ϕ {cd rcd} feature module rcd ::= refines class C extending C { fd; md rmd } class refinement rmd ::= refines ms {s; Super(); s; return y;} method refinement Figure 3. LFJ: syntax of feature modules CT (C)= CT(C) CD APPLY(δ(C), CT(C)) if C dom(dmt(δ)) if δ(c)=adds CD if C modifiesdom(δ) where APPLY(δ(C), CT(C)), the application of the delta clause δ(c)=dc = modifies C { } to the class definition CT(C)= CD, is the class definition Delta-oriented CD Development definedof as Software follows: Product Lines 49

FOP and PureDOP Lightweight Feature Java [Delaware et al.; FOAL 09/FSE 09] FMD ::= feature ϕ {cd rcd} feature module rcd ::= refines class C extending C { fd; md rmd } class refinement rmd ::= refines ms {s; Super(); s; return y;} method refinement Figure 3. LFJ: syntax of feature modules Embedding of LFJ into LPΔJ - Defines same set of products: feature ϕ {cd rcd} = delta CT(C) ϕ { adds cd rcd if} C dom(dmt(δ)) refines CT (C)= classcd C extending C { fd; ifmd δ(c)=adds rmd } = CD modifies APPLY(δ(C), C extending CT(C)) C if{ Cadds modifiesdom(δ) fd adds md rmd } refines ms {s; Super(); s; return y;} = where APPLY(δ(C), CT(C)), the application of the delta clause δ(c)=dc = modifies modifies C ms {s; { } original(); to the class s; return definition y;} CT(C)= CD, is the Figure class 4. definition Translation CD of defined a feature as follows: module to a delta module 49

Extractive PL Development Listing 9: Delta module removing the features Lit, Add, Neg, Print, Eval configurations Lit & Print deltas [ DLitNegPrint when (!Add & Neg) ] [ DLitAddPrint when (Add!Neg) ] reactive ules to re comditions to capxisting product a prodct connsform ding to [ DNeg when (Add & Neg), DremAdd when (!Add &!Neg) ] [ DNegPrint when (Add & Neg), DLitEval when Eval, DAddEval when (Add & Eval), DNegEval when (Neg & Eval) ] Listing 10: Pure DOP specification of the 50

Extractive PL Development reactive ules to re comditions to cap- Existing Products Listing 9: Delta module removing the features Lit, Add, Neg, Print, Eval configurations Lit & Print deltas [ DLitNegPrint when (!Add & Neg) ] [ DLitAddPrint when (Add!Neg) ] xisting product a prodct connsform ding to [ DNeg when (Add & Neg), DremAdd when (!Add &!Neg) ] [ DNegPrint when (Add & Neg), DLitEval when Eval, DAddEval when (Add & Eval), DNegEval when (Neg & Eval) ] Listing 10: Pure DOP specification of the 50

Extractive PL Development reactive ules to re comditions to cap- Existing Products Listing 9: Delta module removing the features Lit, Add, Neg, Print, Eval configurations Lit & Print deltas [ DLitNegPrint when (!Add & Neg) ] [ DLitAddPrint when (Add!Neg) ] Feature xisting product a prodct connsform ding to Removal [ DNeg when (Add & Neg), DremAdd when (!Add &!Neg) ] [ DNegPrint when (Add & Neg), DLitEval when Eval, DAddEval when (Add & Eval), DNegEval when (Neg & Eval) ] Listing 10: Pure DOP specification of the 50

Product Line Evolution Expression Product Line Data Operations Lit Add Neg Sub Print Eval e 5. Feature model for evolved Expression Product Line 51

Product Line Evolution Listing 6: Delta modules for Sub feature features Lit, Add, Neg, Sub, Print, Eval configurations Lit & Eval & choose1(neg,sub) deltas [ DLit, DAdd when Add, DNeg when Neg, DSub when Sub ] [ DLitPrint when Print, DLitEval, DAddPrint when (Add & Print), DAddEval when Add, DNegPrint when (Neg & Print), DNegEval when Neg, DSubPrint when (Sub & Print), DSubEval when Sub ] Listing 7: Pure DOP specification of the evolve 52

Product Line Evolution Listing 6: Delta modules for Sub feature features Lit, Add, Neg, Sub, Print, Eval configurations Lit & Eval & choose1(neg,sub) deltas [ DLit, DAdd when Add, DNeg when Neg, DSub when Sub ] [ DLitPrint when Print, DLitEval, DAddPrint when (Add & Print), DAddEval when Add, DNegPrint when (Neg & Print), DNegEval when Neg, DSubPrint when (Sub & Print), DSubEval when Sub ] Listing 7: Pure DOP specification of the evolve 52

Product Line Evolution Listing 6: Delta modules for Sub feature Change in Feature Model New and Reconfigured Delta Modules features Lit, Add, Neg, Sub, Print, Eval configurations Lit & Eval & choose1(neg,sub) deltas [ DLit, DAdd when Add, DNeg when Neg, DSub when Sub ] [ DLitPrint when Print, DLitEval, DAddPrint when (Add & Print), DAddEval when Add, DNegPrint when (Neg & Print), DNegEval when Neg, DSubPrint when (Sub & Print), DSubEval when Sub ] Listing 7: Pure DOP specification of the evolve 52

Pure DOP vs. Core DOP Core DOP PL can be transformed to Pure DOP PL by introducing core product in first delta module. Pure DOP PL can be transformed to Core DOP PL by adding empty product to Core DOP PL. 53

Conclusion Summary: Delta Modeling of Software Product Lines Pure Delta-oriented Programming Incremental Product Line Analysis Delta-oriented Programming with Delta Java Future Work: Patching and Transforming DOP Product Lines Familiy-based and Compositional Analyses Development Guidelines for DOP Product Lines 54

Future Work Transformation of Core DOP Product Lines (to only additive versions) Patching Pure/Core DOP Product Lines Development Guidelines for DOP Product Lines Familiy-based and Compositional Analyses for DOP Product Lines 55