计算机科学 ›› 2016, Vol. 43 ›› Issue (2): 216-223.doi: 10.11896/j.issn.1002-137X.2016.02.046

• 软件与数据库技术 • 上一篇    下一篇

面向数据库模式变更的代码演化推荐方法

张武能,李宏伟,沈立炜,赵文耘   

  1. 复旦大学计算机科学技术学院 上海201203;上海市数据科学重点实验室复旦大学 上海201203,复旦大学计算机科学技术学院 上海201203;上海市数据科学重点实验室复旦大学 上海201203;江西师范大学计算机信息工程学院 南昌330022,复旦大学计算机科学技术学院 上海201203;上海市数据科学重点实验室复旦大学 上海201203,复旦大学计算机科学技术学院 上海201203;上海市数据科学重点实验室复旦大学 上海201203
  • 出版日期:2018-12-01 发布日期:2018-12-01
  • 基金资助:
    本文受国家“863”高技术研究发展计划项目(2013AA01A605),国家自然科学基金项目(61402113)资助

Method of Code Evolution Recommendation for Database Schema Change

ZHANG Wu-neng, LI Hong-wei, SHEN Li-wei and ZHAO Wen-yun   

  • Online:2018-12-01 Published:2018-12-01

摘要: 许多软件依赖数据库来存储信息。数据库模式的变更可能导致程序代码中与数据库相关的SQL语句代码不能正常执行,因而找出一种能够直接定位到需要修改的SQL语句代码并推荐出这些代码可能的修改方案的方法是十分必要的。提出的面向数据库模式变更的代码演化推荐方法首先自动检测出软件系统数据库模式发生的变更,随后采用程序切片技术得出与数据库操作相关的程序切片;确定受到数据库模式变更影响的程序切片后,利用源程序转换流程图算法将程序切片转化为程序流程图;根据程序流程图的分支条件得出SQL语句所有可能的特定执行路径;最后采用图映射的方法对每条路径的SQL语句进行变更语句推荐,推荐出新数据库模式下可执行的SQL语句。为了验证该方法的可行性,实现了一个用于自动检测数据库模式变更并能推荐出SQL语句演化后代码的插件工具。

关键词: 数据库模式,演化,SQL语句,程序切片,程序流程图

Abstract: Many software store information relies on database,while the database schema change will lead to some source code SQL statements associated with the database cannot be performed properly.Thus finding a way to locate the SQL statement code which needs modifying and to recommend possible changes to these programs is necessary.We proposed a code evolution recommendation method for database schema changes.Firstly,the method detects software system database schema change,and uses the program slicing technique to get source code fragments related to the ope-ration of the database.Then it determines the program slicing impacted by the database schema change,and uses algorithm for generating flowchart from source program to get program flowcharts.SQL statements may have some distinct execution paths according to program flow branches condition.Finally,it uses figure mapping method for each SQL statement to recommend executable SQL statements under the new database schema.In order to verify the feasibility of the method,the article implemented a plug-in tool used to detect the database schema changes,and to recommend executable SQL statement under new database schema.

Key words: Database schema,Evolution,SQL statements,Program slicing,Program flow chart

[1] Lin D Y,Neamtiu I.Collateral evolution of applications and databases[C]∥Proceedings of the joint international and annual ERCIM workshops on Principles of software evolution (IWPSE) and software evolution (Evol) workshops.ACM,2009:31-40
[2] Qiu D,Li B,Su Z.An empirical analysis of the co-evolution of schema and code in database applications[C]∥Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering.ACM,2013:125-135
[3] Field J,Ramalingam G,Tip F.Parametric program slicing[C]∥Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages.ACM,1995:379-392
[4] Han Zhe,Chen Shi-hong.Analysis on follow region and algorithm for construction program dependence graph[C]∥China National Computer Conference.2009:499-507(in Chinese) 韩喆,陈世鸿.跳转语句跟随域分析与程序依赖图构造算法[C]∥中国计算机大会.2009:499-507
[5] Weiser M D.Program slices:formal,psychological,and practical investigations of an automatic program abstraction method[D].Ann Arbor,MI:University of Michigan ,1979
[6] Shan Yong-ming.An automatic method for generation controlflow graph from source program[J].Journal of Chinese Compu-ter Systems,1996,17(10):45-49(in Chinese) 单永明.一种源程序到控制流图的自动生成方法[J].小型微型计算机系统,1996,17(10):45-49
[7] Wang Wen-yong,Wang Xue-dong,Xiang Yu,et al.Research on automatic construction of program flow graph for assembley embedded software[J].Computer Science,2005,32(2):173-175(in Chinese) 汪文勇,王学东,向渝,等.汇编嵌入式软件程序流程图自动生成的研究[J].计算机科学,2005,32(2):173-175
[8] Mou Zhan-sheng,Zhang Hong-jun,Hu Li-fang.Research andRealization on the Automatic-converting Algorithm from Source Program to Flowchart[J].Computer Development & Applications,2008,21(7):28-30(in Chinese) 牟占生,张红军,胡丽芳.源程序到流程图自动转换算法的研究与实现[J].电脑开发与应用,2008,21(7):28-30
[9] Song Y,Peng X,Xing Z,et al.Automatic adaptation of software applications to database evolution by graph differencing and AOP-based dynamic patching[C]∥2012 IEEE 36th Annual Computer Software and Applications Conference (COMPSAC).IEEE,2012:111-118
[10] Ottenstein K J,Ottenstein L M.The program dependence graph in a software development environment[J].ACM Sigplan Notices,1984,19(5):177-184
[11] Ambler S W,Sadalage P J.Refactoring databases:Evolutionary database design[M].Pearson Education,2006
[12] Maule A,Emmerich W,Rosenblum D S.Impact analysis of database schema changes[C]∥Proceedings of the 30th international conference on Software engineering.ACM,2008:451-460
[13] Curino C A,Moon H J,Zaniolo C.Graceful database schema evolution:the prism workbench[J].Proceedings of the VLDB Endowment,2008,1(1):761-772
[14] Curino C A,Moon H J,Ham M,et al.The PRISM Workwench:Database Schema Evolution without Tears[C]∥IEEE 25th International Conference on Data Engineering,2009(ICDE’09).IEEE,2009:1523-1526
[15] Curino C,Moon H J,Zaniolo C.Automating Database SchemaEvolution in Information System Upgrades[C]∥Proceedings of International Workshop on Hot Topics in Software Upgrades.2009:1-5
[16] Curino C,Moon H J,Deutsch A,et al.Automating the database schema evolution process[J].The VLDB Journal ,2013,22(1):73-98
[17] Gobert M,Maes J,Cleve A,et al.Understanding Schema Evolution as a Basis for Database Reengineering[C]∥2013 29th IEEE International Conference on Software Maintenance (ICSM).2013:472-475
[18] Chytil M,Polk M,Neˇcask M,et al.Evolution of a Relatio-nal Schema and Its Impact on SQL Queries[J].Studies in Computational Intelligence,2014,511(2):5-15
[19] Cleve A,Gobert M,Meurice L,et al.Understanding database schema evolution:A case study[J].Science of Computer Programming,2015,97:113-121

No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!