计算机科学 ›› 2017, Vol. 44 ›› Issue (11): 91-97.doi: 10.11896/j.issn.1002-137X.2017.11.014

• 2016 年全国软件与应用学术会议 • 上一篇    下一篇

基于数据库事务的不变式推导

曾虹驰,彭鑫,赵文耘   

  1. 复旦大学软件学院 上海201203,复旦大学软件学院 上海201203;复旦大学上海市数据科学重点实验室 上海201203,复旦大学软件学院 上海201203;复旦大学上海市数据科学重点实验室 上海201203
  • 出版日期:2018-12-01 发布日期:2018-12-01
  • 基金资助:
    本文受国家自然科学基金(61370079)资助

Deriving Invariants from Database Transactions

ZENG Hong-chi, PENG Xin and ZHAO Wen-yun   

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

摘要: 作为数据处理和并发控制的基本单位,数据库事务被广泛应用于软件系统的业务逻辑中。通过收集运行时数据库事务中的数据,推导这些数据之间满足的不变式,建立相应的数据契约关系,是软件维护过程中对系统的内部状态进行监控的重要方法之一。目前,在不变式推导领域,主要的方法和工具都是基于代码进行分析的,缺少与基于数据分析相关的研究和成果。为了解决这一问题,首先提出了基于数据的推导代数等式形式的不变式的算法,然后设计并实现了基于数据库事务的不变式推导的原型工具,最后通过相关实验分析和验证了原型工具的有效性。实验结果表明,原型工具有良好的推导准确率和运行性能,能够弥补现有工具和方法在基于数据的分析领域的不足。

关键词: 数据库事务,不变式推导,代数等式

Abstract: As the basic unit of data processing and concurrency control,database transaction is widely used in business logic of software applications.It is a significant method in software maintenance for monitoring internal state to derive invariants and establish corresponding data contracts based on data collected from database transactions at runtime.Currently,in the field of invariant derivation,most researches and tools are just based on deriving invariants from source code, while there is lack of researches on deriving invariants from data.To solve this problem,this paper firstly introduced an algorithm for deriving invariants in the form of algebraic equations.Moreover,a prototyping tool was designed and implemented to collect data from database transactions at runtime and derive invariants among these data.With experiments,the prototyping tool is proved to be effective both on accuracy and performance,which fills the gap of inva-riants derivation based on data.

Key words: Database transaction,Invariant derivation,Algebraic equation

[1] WANG H Z.Quality management of big data:problems andprogress [J].Science & Technology Review,2014(34):78-84.(in Chinese) 王宏志.大数据质量管理:问题与研究进展[J].科技导报,2014(34):78-84.
[2] PERKINS J H,KIM S,LARSEN S,et al.Automatically patching errors in deployed software[C]∥Proceedings of the ACM SIGOPS 22nd Symposium on Operating systems Principles.ACM,2009:87-102.
[3] 吴世忠.软件漏洞分析技术[M].北京:科学出版社,2014:26-28.
[4] MEYER B.Design by Contract[M].Prentice Hall,2002 .
[5] MEYER B.Eiffel:The Language[M].Prentice-Hall,Inc., 1992:20-30.
[6] LEAVENS G T,BAKER A L,RUBY C.Preliminary Design of JML:A behavioral interface specification language for Java[J].ACM SIGSOFT Software Engineering Notes,2006,31(3):1-38.
[7] SCHILLER T W,DONOHUE K,COWARD F,et al.Case stu-dies and tools for contract specifications[C]∥Proceedings of the 36th International Conference on Software Engineering.ACM,2014:596-607.
[8] ERNST M D,COCKRELL J,GRISWOLD W G,et al.Dynamically discovering likely program invariants to support program evolution[J].IEEE Transactions on Software Engineering,2001,27(2):99-123.
[9] LEMIEUX C.Mining temporal properties of data invariants[C]∥2015 IEEE/ACM 37th IEEE International Conference on Software Engineering (ICSE).IEEE,2015:751-753.
[10] HANGAL S,LAM M S.Tracking down software bugs using automatic anomaly detection[C]∥Proceedings of the 24th International Conference on Software Engineering.ACM,2002:291-301.
[11] ERNST M D,PERKINS J H,GUO P J,et al.The Daikon system for dynamic detection of likely invariants[J].Science of Computer Programming,2007,69(1):35-45.
[12] 金路.高等数学(第3版上)[M].北京:高等教育出版社,2008.
[13] NGUYEN T V,KAPUR D,WEIMER W,et al.Using dynamic analysis to discover polynomial and array invariants[C]∥2012 34th International Conference on Software Engineering (ICSE).IEEE,2012:683-693.
[14] P6Spy.https://github.com/p6spy.
[15] 蔡雪焘.Java开发利器:Hibermate开发及整合应用大全(珍藏版)[M].北京:清华大学出版社,2006:579-583.
[16] COBB J,JONES J A,KAPFHAMMER G M,et al.Dynamic invariant detection for relational databases[C]∥Proceedings of the Ninth International Workshop on Dynamic Analysis.ACM,2011:12-17.

No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!