Softwareproduktlinien Teil 12: Analyse von Produktlinien. Sven Apel (Universität Passau) Gunter Saake (Universität Magdeburg)



Ähnliche Dokumente
Softwareproduktlinien Teil 12: Analyse von Produktlinien

Softwareproduktlinien Teil 12: Analyse von Produktlinien. Christian Kästner (CMU) Sven Apel (Universität Passau) Gunter Saake (Universität Magdeburg)

Softwareproduktlinien - Analyse von Produktlinien

Softwareproduktlinien - Analyse von Produktlinien

How To: Wie entwickle ich mit SharpDevelop Anwendungen für die PocketPC-Platform

Programmentwicklung ohne BlueJ

Softwareproduktlinien Teil 4: Versionsverwaltungs- und Buildsysteme

Implementierung v. Software-Produktlinien - Einführung und Überblick

Grundlagen der Programmierung Prof. H. Mössenböck. 14. Schrittweise Verfeinerung

Zählen von Objekten einer bestimmten Klasse

Programmieren in C. Macros, Funktionen und modulare Programmstruktur. Prof. Dr. Nikolaus Wulff

Softwareproduktlinien Teil 1: Einführung und Überblick

Delegatesund Ereignisse

Software-Engineering und Optimierungsanwendungen in der Thermodynamik

Objects First With Java A Practical Introduction Using BlueJ. Mehr über Vererbung. Exploring polymorphism 1.0

Übung 1 mit C# 6.0 MATTHIAS RONCORONI

Softwareproduktlinien Teil 11: Verbesserte Präprozessoren

Grundlagen der Programmierung Prof. H. Mössenböck. 10. Klassen

Objektorientierte Programmierung

Einfache Arrays. Annabelle Klarl. Einführung in die Informatik Programmierung und Softwareentwicklung

Einführung in die Programmierung

II. Grundlagen der Programmierung. 9. Datenstrukturen. Daten zusammenfassen. In Java (Forts.): In Java:

Python SVN-Revision 12

Fakultät Angewandte Informatik Lehrprofessur für Informatik

Hochschule Darmstadt Informatik-Praktikum (INF 1) WS 2015/2016 Wirtschaftsingenieur Bachelor 5. Aufgabe Datenstruktur, Dateieingabe und -ausgabe

1 Vom Problem zum Programm

Propädeutikum. Dipl.-Inf. Frank Güttler

Constraint-Algorithmen in Kürze - Mit der Lösung zur Path-Consistency-Aufgabe 9

Zusammenfassung des Handzettels für Programmieren in C

Einführung in Java. PING e.v. Weiterbildung Andreas Rossbacher 24. März 2005

Rene Schneider GEBIT Solutions GmbH. Integrity - ein innovatives Tool zur Acceptance-Test-Automatisierung

Unterprogramme. Funktionen. Bedeutung von Funktionen in C++ Definition einer Funktion. Definition einer Prozedur

Praktikum Datenbanksysteme. Ho Ngoc Duc IFIS - Universität zu Lübeck

Java Einführung Abstrakte Klassen und Interfaces

C++ Tutorial: Timer 1

Einkommensaufbau mit FFI:

Klausur in Programmieren

Einführung in Javadoc

12. Vererbung. Prof. Dr. Markus Gross Informatik I für D-ITET (WS 03/04)

Modellierung und Programmierung 1

Software Product Lines

Pragmatik von Programmiersprachen

Einführung in wxwidgets & wxdev-c++


Programmierung in C. Grundlagen. Stefan Kallerhoff

Informatik - Übungsstunde

1. Übung zu "Numerik partieller Differentialgleichungen"

ROOT Tutorial für D. Liko

Einführung in die Programmierung für Wirtschaftsinformatik

Listening Comprehension: Talking about language learning

Lösungsvorschlag zum Übungsblatt 1 zur Vorlesung Informatik II / WS2001/02

Java Tools JDK. IDEs. Downloads. Eclipse. IntelliJ. NetBeans. Java SE 8 Java SE 8 Documentation

Neue Features in C# 2.0

Preisliste für The Unscrambler X

Algorithmen und Datenstrukturen

Programmiervorkurs SS 2011 Technische Universität Darmstadt Jan Hendrik Burdinski, Felix Kerger

Übung zur Vorlesung Programmieren in C

Testen mit JUnit. Motivation

Java: Vererbung. Teil 3: super()

Pascal Schärli

Musterlösungen zur Klausur Informatik 3

U08 Entwurfsmuster (II)

Design by Contract with JML

Klassendefinitionen verstehen

Programmiersprachen Einführung in C. Unser erstes C-Programm. Unser erstes C-Programm. Unser erstes C-Programm. Unser erstes C-Programm

Luis Kornblueh. May 22, 2014

Fotogalerie mit PWGallery in Joomla (3.4.0) erstellen

Einführung in die Programmierung

5. Tutorium zu Programmieren

Methoden. von Objekten definiert werden, Methoden,, Zugriffsmethoden und Read-Only

Feature-Komposition auf Bytecode-Ebene

Übung Grundlagen der Programmierung. Übung 03: Schleifen. Testplan Testergebnisse

Gebundene Typparameter

Betriebssysteme: Konzepte, Dienste, Schnittstellen (Betriebssysteme und betriebssystemnahe Programmierung)

Software development with continuous integration

10.6 Programmier-Exits für Workitems

Distributed Computing Group

Vererbung & Schnittstellen in C#

Unterrichtsmaterialien in digitaler und in gedruckter Form. Auszug aus:

Nuetzlicher Kleinkram

Software Engineering II

Programmieren in Haskell Einführung

Computeranwendung und Programmierung (CuP)

Suchmaschinen. Universität Augsburg, Institut für Informatik SS 2014 Prof. Dr. W. Kießling 23. Mai 2014 Dr. M. Endres, F. Wenzel Lösungsblatt 6

miditech 4merge 4-fach MIDI Merger mit :

Übersicht Programmablaufsteuerung

Mit Legacy-Systemen in die Zukunft. adviion. in die Zukunft. Dr. Roland Schätzle

Java Einführung Umsetzung von Beziehungen zwischen Klassen. Kapitel 7

Das erste Programm soll einen Text zum Bildschirm schicken. Es kann mit jedem beliebigen Texteditor erstellt werden.

Software Engineering Klassendiagramme Assoziationen

public class SternchenRechteckGefuellt {

Übungsstunde: Informatik 1 D-MAVT

Einführung in die Robotik Einführung. Mohamed Oubbati Institut für Neuroinformatik. Tel.: (+49) 731 / mohamed.oubbati@uni-ulm.de

Große Übung Praktische Informatik 1

Die Kunst des Programmierens...

Vorkurs C++ Programmierung

Ferienakademie Programmierkonzepte für Multi-Core Rechner. Tools: Profiler

Inhalt. Fragestellungen. ...we make the invisible visible... Analysen und deren Anwendung Erfahrungen

Transkript:

Softwareproduktlinien Teil 12: Analyse von Produktlinien ChristianKästner (Universität Marburg) Sven Apel (Universität Passau) Gunter Saake (Universität Magdeburg) inkl. Folien von

Das Problem

Database Engine

Printer Firmware

Linux Kernel

Variability = Complexity

33 optional, independent features a unique variant for every person on this planet

320 optional, independent features more variants than estimated atoms in the universe

Correctness?

Maintenance? Comprehension?

Checking Products 2000 Features 100 Printers 30 New Printers per Year Printer Firmware

Checking Products 8000 Features? Products Linux Kernel

Checking Product Line Implementation with 10000 Features #ifdef, Frameworks, FOP, AOP, Linux Kernel

Analyse von Featuremodellen

Fragen an das Featuremodell main Eng g. Do Feature Modell Wiederverwendbare Implementierungsartefakte Application Eng. Feature Auswahl Generator Fertiges Program 16

Fragen an das Featuremodell Feature Modell Ist das Modell konsistent? Welche Features muß man auswählen? Welche Features darf man nicht auswählen? Wieviele gültige Produkte gibt es? Sind zwei Featuremodelle äquivalent?

Fragen an das Featuremodell Feature Modell Feature Auswahl Ist das Modell konsistent? Welche Features muß man auswählen? Welche Features darf man nicht auswählen? Wieviele gültige Produkte gibt es? Sind zwei Featuremodelle äquivalent? Ist eine Feature Auswahl gültig? Welche Features werden durch eine partielle Konfiguration bereits festgelegt? g

Wiederholung: Feature Modelle & Aussagenlogik. Repräsentation von Feature Modellen als Liste von Konfigurationen Aussagenlogischer Ausdruck Feature Diagramm SPL OS ( Ui Unix Win ) ( Ui Unix Win ) ( Txn Write )

Analysen von Featuremodellen Ist Featureauswahl gültig? {Root, Base, F1, F4} {Root, Base, F2, F3} Variablen in Formel ersetzen true wenn Feature in Auswahl, sonst false Formel ergibt true für gültige Auswahl

Ist das Modell konsistent? Gibt es mindestens eine Variante? Formel erfüllbar? Anfrage an SAT SolverSolver SAT(FM)

Tote Features Gegeben ein Feature Model Welche Features können ausgewählt werden? Welche Features müssen ausgewählt werden? Feature F auswählbar wenn SAT(FM ^ F) Feature F abwählbar wenn Feature F abwählbar wenn SAT(FM ^ not(f))

Partielle Konfigurationen Gegeben eine partielle Konfiguration Welche Features können noch ausgewählt werden? Welche Features müssen ausgewählt werden? Ausgewählte Features in Formel aufnehmen, dann wie Tote Features Feature F noch auswählbar wenn SAT(FM ^ PK ^ F) Feature F noch abwählbar wenn SAT(FM ^ PK ^ not(f))

Variantenzahl Wieviele gültige Konfigurationen gibt es? Beispielkonfigurationen Ist diese Zahl sinnvoll? Wofür?

Änderungen von Feature Modellen Welche Konsequenzen hat eine Änderung? Refactorings, Spezialisierungen, Generalisierungen Refactoring wenn: Tautologie(FM1 <=> FM2) = not SAT(not (FM1 <=> FM2))

Demo: Reasoning in FeatureIDE

Analyse der Implementierung

Fragen an die Implementierung main Eng g. Do Feature Modell Wiederverwendbare Implementierungsartefakte Application Eng. Feature Auswahl Generator Fertiges Program 28

Fragen an die Implementierung Kann ein Code Block ausgewählt werden? Ändert ein Feature etwas am Gesamt Code? Wiederverwendbare Implementierungsartefakte

Presence Conditions true WORLD BYE true

Presence Conditions line 1 #ifdef A line 2 #ifndef B line 3 #endif line 4 #elif defined(x) line 5 #else line 6 #endif true A A ^ not B A not A ^ X not A ^ not X

Toter Quelltext line 1 #ifdef A line 2 #ifndef A line 3 #endif line 4 #elif defined(x) line 5 #else line 6 #endif true A A ^ not A A not A ^ X not A ^ not X Kann nicht ausgewählt werden Analyse: SAT(pc(block i))

Fragen an die Implementierung und das Featuremodell main Eng g. Do Feature Modell Wiederverwendbare Implementierungsartefakte Application Eng. Feature Auswahl Generator Fertiges Program 33

Toter Quelltext line 1 #ifdef A line 2 #ifdef B line 3 #endif line 4 #elif defined(x) line 5 #else line 6 #endif true A A ^ B A not A ^ X not A ^ not X Kann nicht ausgewählt werden Kombinierte Analyse von (A v B) ^ not (A ^ B) Analyse: SAT(FM ^ pc(block i)) Featuremodell und Implementierung (Wo liegt der Fehler?)

Weitere Fragestellungen Welche Quelltextblöcke werden nie kompiliert? Welche Featuremodule werden nie kompiliert? Welche Features haben keinen Einfluss auf den Quelltext? Kombinierte Analyse von Featuremodell und Implementierung

Typsysteme y für Produktlinien

Outline Variability aware type systems (that is, for product lines) Type system demo with CIDE Variability aware parsing From our research: Typechef, checking correctness of Linux

Correctness?

Variability Aware Type Checking: Properties / Theorems / Guarantees Novalid productcontains contains typeerrors errors. Soundness: No valid product has run time type errors

Type Checking #include <stdio.h> char *msg = "Hello World"; int main() {Reference printf(msg); } Type errors to prevent: referenced variable ibl does not exist

Variability Aware Type Checking #include <stdio.h> #ifdef WORLD char *msg = "Hello World"; #endif #ifdef BYE char *msg = "Bye bye!"; #endif main() { printf(msg); }

Variability Aware Type Checking #include <stdio.h> #ifdef WORLD char *msg = "Hello World"; #endif #ifdef BYE char *msg = "Bye bye!"; #endif int main() { printf(msg); } Reference? Conflict?

Variability Aware Type Checking Presence conditions: true WORLD BYE true #include <stdio.h> #ifdef WORLD char *msg = "Hello World"; #endif #ifdef BYE char *msg = "Bye bye!"; #endif int main() { printf(msg); } Reference? Conflict?

Variability Aware Type Checking true WORLD BYE true > true true #include <stdio.h> #ifdef WORLD char *msg = "Hello World"; #endif #ifdef BYE char *msg = "Bye bye!"; #endif int main() { printf(msg); } Reference? true > (WORLD v BYE) (WORLD BYE) Conflict?

Reachability: pc(caller) > pc(target) Conflicts: (pc(def1) ( (d pc(def2)) true WORLD BYE true > true true #include <stdio.h> #ifdef WORLD char *msg = "Hello World"; #endif #ifdef BYE char *msg = "Bye bye!"; #endif int main() { printf(msg); } Reference? true > (WORLD v BYE) (WORLD BYE) Conflict?

Feature model P WORLD BYE true WORLD BYE FM -> (true > true) true #include <stdio.h> #ifdef WORLD char *msg = "Hello World"; #endif #ifdef BYE char *msg = "Bye bye!"; #endif int main() { printf(msg); } Reference? FM -> (true > (WORLD v BYE)) FM -> (WORLD BYE) Conflict?

AST with Variability Information WORLD BYE WORLD 47 BYE Extended Reference lookup mechanism

Surface Complexity Inherent Complexity SAT Problem

Demo: Type system in CIDE

Demo: Type system in CIDE public class Test { } private static String msg_hi = "Hello world! ; private static ti String msg_bye = "Bye bye!"; public static void main(string[] args) { } System.out.println(msg_hi); System.out.println(msg_bye);

FOP / AOP Ähnliche Prüfungen für FOP/AOP

-> Glue-Code-Modul

Variability Aware y Aware Parser Type System Static Analysis Bug Finding Testing Model lch Checking Theorem Proving

Variability Aware <Foo> We have seen variability aware type systems. Generalize! <Foo> guarantees sth. for a product Variability aware <Foo> guarantees sth. for all valid products

Variability Aware Static Analysis Static analysis tools study properties of programs, by approximating their behavior In compilers: non void methods always return a value Out of compilers: no dereference of null pointers Prove that: No valid product has methods with missing returns o a d p oduct as et ods t ss g etu s No valid product dereferences null pointer

Variability Aware Parsing No valid product contains syntax errors. Produce AST, to support other analyses

TypeChef

Parsing Unpreprocessed C Code is Hard Macro expansion needed for parsing Undisciplined annotations* Alternative macros??? * Study of 40 open source C projects: 16 % of all annotations are undisciplined 60

An Overview of TypeChef C with #define, #include, #if Partial Preprocessor C with #if Variability Aware Parser AST with Variability Analysis (e.g., Type System) 61

Prototype: Performance on Boa Type check entire SPL: 1 minute (Solving 3193 equations: 6 seconds) Break even at 20 variants Up to 2 110 variants Each 4 seconds compile time (= 10 26 years) Variant A SoftwareProductLine Generation Variant B Variant C 62 TypeChef: Toward Type Checking #ifdef FOSD'10 Variability in C

Performance: Linux >7000 files: avg 30 secs parsing time per file 85 hours total Up to ~2 6000 10 1800 variants: we are immensely faster Challenges for evaluation Extracting feature model Build scripts are also conditional and unstructured SAT solving still not a problem

Variability Aware are Parser Checking Product Line Checking Products Aware Type System Static Analysis Bug Finding Testing Model Checking Theorem Proving Product Line