Post on 13-Jul-2015
Software Language Evolution
Sander VermolenEelco Visser
This research was supported by NWO/JACQUARD project638.001.610, MoDSE: ModelDriven Software Evolution.
Data Models
Username :: varcharemail :: tinytext
Pagetitle :: varcharauthor Usercontent :: text
Username bob email b.johnson@mail.com
Pagetitle "The first page"content "Hello world"author bob
Version history
Username :: varcharemail :: tinytext
Pagetitle :: varcharcontent :: textauthor User
Username :: varcharemail :: tinytext
Pagetitle :: varchar
Revisionpage PagerevisionText :: textauthor User
Username bob email b.johnson@...
Page 1title "The first page"content "Hello world"author bob
Username bob email b.johnson@...
Page 1title "The first page"
Revision 1page {page 1}revisionText "Hello world"author bob
Coupled Data Evolution
...
$dbh->bz_add_column('attachments', 'submitter_id', {TYPE => 'INT3', NOTNULL => 1}, 0);$dbh->bz_rename_column('bugs_activity', 'when', 'bug_when');_add_bug_vote_cache(); _update_product_name_definition(); _add_bug_keyword_cache();$dbh->bz_add_column('profiles', 'disabledtext', {TYPE => 'MEDIUMTEXT', NOTNULL => 1}, '');_populate_longdescs(); _update_bugs_activity_field_to_fieldid();
if (!$dbh->bz_column_info('bugs', 'lastdiffed')) {$dbh->bz_add_column('bugs', 'lastdiffed', {TYPE =>'DATETIME'});$dbh->do('UPDATE bugs SET lastdiffed = NOW()');
}
_add_unique_login_name_index_to_profiles(); $dbh->bz_add_column('profiles', 'mybugslink', {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'TRUE'});_update_component_user_fields_to_ids();$dbh->bz_add_column('bugs', 'everconfirmed', {TYPE => 'BOOLEAN', NOTNULL => 1}, 1);
$dbh->bz_add_column('products', 'maxvotesperbug', {TYPE => 'INT2', NOTNULL => 1, DEFAULT => '10000'});
$dbh->bz_add_column('products', 'votestoconfirm', {TYPE => 'INT2', NOTNULL => 1}, 0);_populate_milestones_table();$dbh->bz_alter_column('bugs', 'target_milestone', {TYPE => 'varchar(20)', NOTNULL => 1, DEFAULT => "'---'"});$dbh->bz_alter_column('milestones', 'value', {TYPE => 'varchar(20)', NOTNULL => 1});_add_products_defaultmilestone();
if (!$dbh->bz_index_info('cc', 'cc_bug_id_idx') || !$dbh->bz_index_info('cc', 'cc_bug_id_idx')->{TYPE}) {$dbh->bz_drop_index('cc', 'cc_bug_id_idx');$dbh->bz_add_index('cc', 'cc_bug_id_idx', {TYPE => 'UNIQUE', FIELDS => [qw(bug_id who)]});
}if (!$dbh->bz_index_info('keywords', 'keywords_bug_id_idx') || !$dbh->bz_index_info('keywords', 'keywords_bug_id_idx')->{TYPE}) {
$dbh->bz_drop_index('keywords', 'keywords_bug_id_idx');$dbh->bz_add_index('keywords', 'keywords_bug_id_idx', {TYPE => 'UNIQUE', FIELDS => [qw(bug_id
keywordid)]});}
...
EvolvingData Models
add or remove entity
change name of entity
change type of set
8 Basic Transformations
add or remove property
change name of property
change type of property
addRevision
page Pageauthor User
addrevisionText :: text
at Entity Revision / Property pageadd revisionText :: text
RevisionrevisionText :: text
RevisionrevisionText :: text
at Entity Revision / Property pageadd revisionText :: textfrom page.content
at Entity Pageadd Revision
at Entity Revision / Property pageadd revisionText :: textfrom page.content
;
EvolvingData Models
8 Basic transformations
Syntax for the transformations
Positioning language
Specify data model evolutions
DataMigration
Technical Domain
WebDSL
Stratego/XT
JavaJava Persistence API
Object Transformation Library
transform (Page) to (Page) {DropAttribute("author");
}
at Entity Pageremove author
transform (Page) to (Revision) {AddAttribute("revisionText",
getPage().getContent() )}
at Entity Revision / Property pageadd revisionText :: textfrom page.content
More abstract transformations
Type conversions
Java type generation
But wait, there’s more!
DataMigration
HeterogeneousCoupled Evolution
Horizontal GeneralizationDomain
Lists
More types
Abstract types
Vertical GeneralizationConformance level
Heterogeneous Coupled Evolution
ofSoftware Languages
Software Data
Evolving Software LanguageData Model
A GenericArchitecture
Domain Specific Transformation Language
(DSTL)
Transformation Interpreter
Software Migration
Stratego
SDF SDF
Entity* > DataM
Lists
"add" Entity > LocalTransformation"remove" > LocalTransformation
[...]
Id "::" Type > Prop
Lexicals
"substitute" Id > LocalTransformation
''...''
"int" > Type"bool" > TypeId > Type"set of" Type > Type
Multiple productions
"substitute" Type > LocalTransformation
>*
"at" APath LocalTransformation > Transformation
Type checking .../...
Software Language Evolution
Generic architectureDSTL generationEvolution interpreter generationAutomatic migration
Application to data models
Heterogeneous coupled evolution
Software Language Evolution
This research was supported by NWO/JACQUARD project638.001.610, MoDSE: ModelDriven Software Evolution.
Present & Future
Evolution detection
Validation
Usability
Abstractions
Related work
Focus on single domain
Meta modeling[7, 23, 17, 10]
DSLs[23]
Data base schemas[15,4,2,8,1]