基于TTCN-3语言的测试理论与技术研究
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
随着软件的飞速发展与普遍应用,软件质量已经变成重要的研究课题。软件测试是提高软件质量最直接,最有效,也是应用最广泛的方法之一[1]。关于软件测试,研究人员和业内人士一直梦想着[2]:统一的测试理论,100%测试自动化,基于测试的模型和高效的测试工程。当前,软件测试面临的难点有:测试管理的复杂性,测试环境的多样性,难以保证的测试完备性[3]。
     TTCN-3是ETSI(欧洲电信标准化组织)发布的针对测试领域的专用语言。它定义了很多特定抽象简洁的语言元素,有利于测试的分层,分工和复用,为高效的测试工程发展提供了很好的机制,为不同领域的测试提供了一个统一的测试框架,有利于统一的测试理论形成,有利于软件测试自动化推进,有利于测试模型的发展与应用。在概念上,TTCN-3为测试过程提供了很好的抽象与支持。当然,TTCN-3的测试解决方案,有赖于自身的进一步发展与完善。
     针对软件测试的三个难点,本文研究了使用TTCN-3进行测试建模、测试分析、测试执行的理论和技术,提出了一个基于TTCN-3的测试框架。首先,用TTCN-3对抽象的测试对象和测试过程进行建模。然后,解析TTCN-3脚本,提取语义信息,建立起测试过程的可执行对象,接着,通过不同的测试对象适配器,完成对不同测试对象的测试过程。最后,在此基础上完成基于符号执行的分析技术和解释执行、翻译执行技术,改善了TTCN-3测试框架的可用性,提高了测试过程的自动化程度。本文的主要贡献如下:
     1.提出将测试共有特征向TTCN-3测试模型转换的方法,以及使用TTCN-3对GUI测试,Web测试进行建模的方法。由此将不同的测试过程,转换成统一的TTCN-3测试模型;将不同的测试实施过程,转换为统一的TTCN-3编译执行过程。
     2.详细论述了TTCN-3编译器的构造方法,提出了TTCN-3语言的符号执行技术,以及使用符号执行技术进行TTCN-3脚本正确性分析、测试输入自动生成的方法。
     3.详细论述了两种模式执行器(编译-编译-执行模式、虚拟机平台模式)的实现方法及其特点,并由此提出一个集成两种模式的执行器,提出了分析TTCN-3执行器性能的方法,并给出了相关数据。
     4.以Web测试,NFC测试为例,提出了通用编解码器框架,介绍了如何在大规模的工业测试中,应用本文提出的TTCN-3测试框架。
With the rapid development of software and its pervasive applications, software quality has become an important issue. Currently, software testing is one of the most direct and effective, but also the most widely used methods[1] to improve software quality. Researchers and industry have always dreamed of[2]:unified test theory, 100% test automation, test-based modeling, and efficacy-maximized test engineering. The main issues of software testing are:the complexity of test management, the diversity of test environments [3], and the completeness of testing.
     TTCN-3 language is a test domain specific language published by ETSI (European Telecommunications Standardization Organization). TTCN-3 has a number of abstract definitions for the characteristics of testing, which are very beneficial to the hierarchical division of labor and reusability in testing engineering. TTCN-3 can provide a unified test framework for different areas'testing, which is conducive to the formation of the unified test theory, the software testing automation, and the development and application of test-based modeling. The concepts of TTCN-3 provide a good abstraction for the testing process. However, these advantages depend on the development of TTCN-3 itself.
     This dissertation studies the theory and technology of test modeling, testing analysis, and test execution with TTCN-3, and proposes a TTCN-3 based testing framework. First, we use TTCN-3 to model the system under test and test process. And then a compiler is built to parse TTCN-3 script, extract semantic information and build the executable objects of testing process. At last different adapters are developed to complete the same testing process in different environments.The main contributions of this dissertation are:
     1. This dissertation elaborates how to transform the common features of different testing procedures to TTCN-3 testing model. Especially this dissertation describes how to use TTCN-3 to model GUI testing and Web testing. Thus different test procedures can be transformed to unified TTCN-3 testing model; different testing performance can be transformed to the compilation and execution of TTCN-3 codes.
     2. This dissertation describes how to build the TTCN-3 compiler, the symbolic execution method of TTCN-3, and how to perform the TTCN-3 code analysis, test input generation based on the symbolic execution method.
     3. This dissertation describes the implementation details and the differences of two kinds of TTCN-3 executor. One is compile-compile-execute mode, and the other is virtual machine platform. This dissertation also proposes an integrated framework combining these two executors. And then the performance evaluation method of TTCN-3 executors is proposed.
     4. Taking Web testing, NFC testing as examples, this dissertation proposes a general framework of TTCN-3 adaptors, and describes how to apply our framework to industrialized testing.
引文
[1]Glenford Myers, Corey Sandler, Tom Badgett, Todd Thomas. The Art of Software Testing, Second Edition. Wiley,2004.
    [2]Bertolino Antonia. Software Testing Research:Achievements, Challenges, Dreams. in 2007 Future of Software Engineering:IEEE Computer Society,2007.
    [3]Atif M. Memon. A comprehensive framework for testing graphic user interface. Ph.D. thesis, Department of Computer Science, University of Pittsburgh,2001.
    [4]Jim Gray. What Next? A Few Remaining Problems in Information Technology. Jim Gray received the 1998 ACM Turing Award at the ACM awards banquet in NYC on April 15. This is his Turing award lecture.,1998.
    [5]William Perry. Effective methods for software testing, third edition. John Wiley\& Sons, Inc.,2006.
    [6]ETSI. Methods for Testing and Specification (MTS);The Testing and Test Control Notation version 3;Part 1:TTCN-3 Core Language. ETSI ES 201 873-1 v3.2.1 (2007-02).
    [7]ETSI. Methods for Testing and Specification (MTS);The Testing and Test Control Notation version 3;Part 3:TTCN-3 Graphical presentation Format (GFT). ETSI ES 201873-3 v3.2.1 (2007-02).
    [8]ETSI. Methods for Testing and Specification (MTS);The Testing and Test Control Notation version 3;Part 4:TTCN-3 Operational Semantics. ETSI ES 201 873-4 v3.2.1 (2007-02).
    [9]ETSI. Methods for Testing and Specification (MTS);The Testing and Test Control Notation version 3;Part 5:TTCN-3 Runtime Interface (TRI). ETSI ES 201 873-5 v3.2.1 (2007-02).
    [10]ETSI. Methods for Testing and Specification (MTS);The Testing and Test Control Notation version 3;Part 6:TTCN-3 Control Interface (TCI). ETSI ES 201 873-6 v3.2.1 (2007-02).
    [11]M. Beyer, W. Dulz, F. H. Zhen. Automated TTCN-3 test case generation by means of UML sequence diagrams and Markov chains. Ats 2003:12th Asian Test Symposium, Proceedings,2003,102-105
    [12]W. Dulz, F. H. Zhen. MaTeLo-Statistical usage testing by annotated sequence diagrams, Markov chains and TTCN-3. Third International Conference on Quality Software, Proceedings,2003,336-342.
    [13]J. Vain. Implementing Conformiq Qtronic. The IFIP International Conference on Testing of Communicating Systems 2007,2008,2007.
    [14]P. Godefroid, N. Klarlund, K. Sen. DART:Directed automated random testing. Acm Sigplan Notices,2005,40,213-223, Jun.
    [35]Godefroid Patrice, Klarlund Nils, Sen Koushik. DART:directed automated random testing, in Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation Chicago,IL, USA:ACM,2005.
    116] K. Sen, G. Agha. CUTE and jCUTE:Concolic unit testing and explicit path model-checking tools. Computer Aided Verification, Proceedings,2006,4144,419-423.
    [17]Sen Koushik, Marinov Darko, Agha Gul. CUTE:a concolic unit testing engine for C. in Proceedings of the 10th European software engineering conference held jointly with 13th ACM SIGSOFT international symposium on Foundations of software engineering Lisbon, Portugal:ACM,2005.
    [18]Cristian Cadar, Vijay Ganesh, Peter Pawlowski, David Dill, Dawson Engler. EXE: Automatically Generating Inputs of Death. Proceedings of the 13th ACM conference on Computer and communications security,2006.
    [19]Cristian Cadar, Vijay Ganesh, Peter Pawlowski, David Dill, Dawson Engler. EXE: Automatically Generating Inputs of Death. ACM Transactions on Information and System Security,2008,12,1-38.
    [20]Cristian Cadar, Daniel Dunbar, Dawson Engler. KLEE:Unassisted and Automatic Generation of High-Coverage Tests for Complex Systems Programs. Stanford University CSTR 2008-03, May 8 2008.
    [21]Godefroid Patrice. Compositional dynamic test generation. in Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages Nice, France:ACM,2007.
    [22]Patrice Godefroid, Michael Levin, David A Molnar. Automated Whitebox Fuzz Testing. Microsoft ResearchMay 2007.
    [23]Rupak Majumdar, Koushik Sen. LATEST:Lazy Dynamic Test Input Generation. EECS Department, University of California, Berkeley UCB/EECS-2007-36, March 20 2007.
    [24]Peter Boonstoppel, Cristian Cadar, Dawson Engler. RWset:Attacking Path Explosion in Constraint-Based Test Generation in ETAPS Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS 2008) Budapest, Hungary,2008.
    [25]Saswat Anand, Patrice Godefroid, Nikolai Tillmann. Demand-Driven Compositional Symbolic Execution. in Tools and Algorithms for the Construction and Analysis of Systems,2008,367-381.
    [26]Lanzi Andrea, Martignoni Lorenzo, Monga Mattia, Paleari Roberto. A Smart Fuzzer for x86 Executables. in Proceedings of the Third International Workshop on Software Engineering for Secure Systems:IEEE Computer Society,2007.
    [27]Patrice Godefroid, Michael Y. Levin, David Molnar. Active Property Checking. Microsoft Research MSR-TR-2007-91, July 2007 2007.
    [28]Brumley David, Caballero Juan, Liang Zhenkai, Newsome James, Song Dawn. Towards automatic discovery of deviations in binary implementations with applications to error detection and fingerprint generation. in Proceedings of 16th USENIX Security Symposium on USENIX Security Symposium Boston, MA:USENIX Association,2007.
    [29]Shaoyin Cheng, Fan Jiang, Jiajie Wang, Tao Zhang, Xuezhi Xing. DBTG: Demand-Driven Backtracking Test Generation. in The 9th International Conference for Young Computer Scientists (ICYCS'08),2008,1944-1950.
    [30]David Brumley, Pongsin Poosankam, Dawn Song, Jiang Zheng. Automatic Patch-Based Exploit Generation is Possible:Techniques and Implications. in Security and Privacy,2008. SP 2008. IEEE Symposium on,2008,143-157.
    [31]Xuezhi Xing, Lei Zhang, Fan Jiang, Shaoyin Cheng, Xing Jiang. Combined Symbolic and Concrete Execution of TTCN-3 for Automated Testing, in 2008 International Symposium on Information Science and Engieering (ISISE'08),2008,58-61.
    [32]蒋凡,张辉.基于C++语言转换的TTCN-3执行器的设计与实现.中国科学技术大学学报,2007,4.
    [33]张辉蒋凡.基于C++语言转换的TTCN-3测试系统的设计与实现.计算机系统应用,2007,4.
    [34]刘小勇,蒋凡.面向对象的TTCN-3测试系统的实现.计算机工程,2006,3.
    [35]蒋凡,季向东,曾凡平.TTCN-3测试系统的设计与实现.计算机工程,2005,2.
    [36]Xuezhi Xing, Fan Jiang. GUI Test Case Definition with TTCN-3. International Conference on Computational Intelligence and Software Engineering (CiSE 2009), 2009.
    [37]Brad A. Myers. User interface software tools. ACM Trans. Comput.-Hum. Interact., 1995,2,64-103.
    [38]Brad Myers, Scott E. Hudson, Randy Pausch. Past, present, and future of user interface software tools. ACM Trans. Comput.-Hum. Interact.,2000,7,3-28.
    [39]Kai-Yuan Cai, Lei Zhao, Hai Hu, Chang-Hai Jiang. On the Test Case Definition for GUI Testing. In proceedings of the Fifth International Conference on Quality Software(QSIC'05),2005, SEP 19-20,2005.
    [40]蒋凡,魏蓉,郐吉丰.基于扩展有限状态机测试序列生成方法研究.计算机工程与应用,2007,3.
    [ 41 ]黄传动.通信协议的分布式测试方法研究和测试系统实现.中国科学技术大学博士论文,2006.
    [42]Kai Chen, Fan Jiang, Chuan-Dong Huang. A new method of generating synchronizable test sequences that defect output-shifting faults based on multiple UIO sequences. Dijon, France,2006,1791-1797.
    [43]Chuan-Dong Huang, Fan Jiang. Generating minimal synchronizable test sequence that detects output-shifting faults. Zhangjiajie, China,2005,1163-1170.
    [44]Paul Baker. Models and Testing-A Recipe for Improved Effectiveness? in Testing of Software and Communicating Systems,2008,5-6.
    [45]A. C. Dias Neto, G. H. Travassos. Porantim:An approach to support the combination and selection of Model-based Testing techniques. in ICSE Workshop on Automation of Software Test,2009. AST'09,2009,1-9.
    [46]Tony Clark. Model based functional testing using pattern directed filmstrips. in ICSE Workshop on Automation of Software Test,2009. AST'09.,2009,53-61.
    [47]Antti Jaaskelainen, Mika Katara, Antti Kervinen, Henri Heiskanen, Mika Maunumaa, Tuula Paakkonen. Model-Based Testing Service on the Web. in Testing of Software and Communicating Systems,2008,38-53.
    [48]Alain Faivre, Christophe Gaston, Pascale Le Gall. Symbolic Model Based Testing for Component Oriented Systems. in Testing of Software and Communicating Systems, 2007,90-106.
    [49]Jan Tretmans, Ed Brinksma. TorX:Automated Model-Based Testing. in First European Conference on Model-Driven Software Engineering, Nuremberg, Germany, Nuremberg, Germany,2003.
    [50]Paul Baker, Zhen Ru Dai, Jens Grabowski, Oystein Haugen, Ina Schieferdecker, Clay Williams. Model-Driven Testing Using the UML Testing Profile. ISBN 978-3-540-72562-6 Springer Berlin Heidelberg NewYork,2007.
    [51]Zhang Huo-Ming, Yang Jian-Min, Xiao Long-Fei. Hybrid model testing technique for deep-sea platforms based on equivalent water depth truncation. China Ocean Engineering,2007,21,401-416.
    [52]Lettre Guillaume, Lange Christoph, Hirschhorn Joel N. Genetic model testing and statistical power in population-based association studies of quantitative traits. Genetic Epidemiology,2007,31,358-362, May.
    [53]Andreas Spillner. The W-Model Strengthening the Bond Between Development and Test. STAReast 2002, Orlando, Florida, USA,15.-17. May 2002,2002.
    [54]Yuan Qiulu, Wu Ji, Liu Chao, Zhang Li. A Model Driven Approach Toward Business Process Test Case Generation. Wse 2008:Tenth IEEE International Symposium on Web Site Evolution, Proceedings,2008,41-44 125.
    [55]Li Xuandong, Qiu Xiaokang, Wang Linzhang, Lei Bin, W. Eric Wong. UML state machine diagram driven runtime verification of Java programs for message interaction consistency. in Proceedings of the 2008 ACM symposium on Applied computing Fortaleza, Ceara, Brazil:ACM,2008.
    [56]G. Q. Zhang, R. Mei, Z. Jun. A business process of web services testing method based on UML2.0 activity diagram. Iita 2007:Workshop on Intelligent Information Technology Application, Proceedings,2007,59-65 384.
    [57]Mingsong Chen, Xiaokang Qiu, Wei Xu, Linzhang Wang, Jianhua Zhao, Xuandong Li. UML Activity Diagram-Based Automatic Test Case Generation For Java Programs. The Computer Journal,2007, bxm057, August 25,2007.
    [58]I. Schieferdecker, Z. R. Dai, J. Grabowski, A. Rennoch. The UML 2.0 Testing Profile and its relation to TTCN-3. Testing of Communicating Systems, Proceedings,2003, 2644,79-94.
    |59] J. Zander, Z. R. Dai, I. Schieferdecker, G. Din. From U2TP models to executable tests with TTCN-3-An approach to model driven testing. Testing of Communicating Systems, Proceedings,2005,3502,289-303.
    [60]W. Dulz. On-the-fly interpretation of test cases in an automatically generated TTCN-3 test suite. Enase 2008:Proceedings of the Third International Conference on Evaluation of Novel Approaches to Software Engineering,2008,72-80 189.
    [61]郑人杰.计算机软件测试技术.清华大学出版社,1992.
    [62]Lex & Yacc. http://dinosaur.compilertools.net/.
    163] Antlr. http://www.antlr.org/.
    [64]Zhongxing Xu, Jian Zhang. Path and Context Sensitive Inter-procedural Memory Leak Detection. in Quality Software,2008. QSIC'08. The Eighth International Conference on,2008,412-420.
    [65]lp_solver. http://groups.yahoo.com/group/lp_solve/.
    [66]Leonardo de Moura, Nikolaj Bj(?)rner. Z3:An Efficient SMT Solver. in Tools and Algorithms for the Construction and Analysis of Systems,2008,337-340.
    [67]Yices. http://yices.csl.sri.com/.
    [68]Clark Barrett, Cesare Tinelli. CVC3. in Computer Aided Verification,2007,298-302.
    [69]陈火旺,王戟,董威.高可信软件工程技术.电子学报,2003,30卷第12A期,2003年12月.
    [70]Yan Jiong, Wang Ji, Chen Huo-wang. Automatic Generation of Markov Chain Usage Models from Real-time Software UML Models. In Proceedings of 4th International Conference On Quality Software, Braunschweig, GERMANY, (QSIC'2004).IEEE Computer Society Press, September 2004,pp.22-31.
    [71]肖健宇,张德运,董皓,陈海诊.UML状态机到B形式化规约的转换.微电子学与计算机,2005,2005年第22卷第8期.
    [72]Jens Grabowski Zhen Ru Dai, Helmut Neukirchen, Holger Pals. From Design to Test with UML. The IFIP International Conference on Testing of Communicating Systems 2004,2004.
    [73]Z. R. Dai, J. Grabowski, H. Neukirchen. TIMEDTTCN-3 based graphical real-time test specification. Testing of Communicating Systems, Proceedings,2003,2644, 110-127.
    [74]Wang Zhiliang, Wu Jianping, Yin Xia, Shi Xingang, Tian Beihang. Using TIMED TTCN-3 in interoperability testing for real-time communication systems. Testing of Communication Systems, Proceedings,2006,3964,324-340.
    [75]I. Schieferdecker, B. Stepien, A. Rennoch. PerfTTCN, a TTCN language extension for performance testing. Testing of Communicating Systems, Vol 10,1997,21-36.
    [76]Ina Schieferdecker, Eckard Bringmann, Jurgen Grobmann. Continuous TTCN-3: testing of embedded control systems. in Proceedings of the 2006 international workshop on Software engineering for automotive systems Shanghai, China:ACM, 2006.
    [77]陈意云,华保健,葛琳,王志芳.一种用于指针程序安全性证明的指针逻辑.计算机学报,2008,2008年3月第31卷第3期.
    [78]解释器. http://en.wikipedia.org/wiki/Interpreter_%28computing%29.
    [79]Perl. http://en.wikipedia.org/wiki/Perl.
    [80]Python. http://en.wikipedia.org/wiki/Python_programming_language.
    [81]MATLAB. http://en.wikipedia.org/wiki/MATLAB.
    [82]Ruby. http://en.wikipedia.org/wiki/Ruby_programming_language.
    [83]UCSD Pascal. http://en.wikipedia.org/wiki/UCSD Pascal.
    [84]Java. http://en.wikipedia.org/wiki/Java_(programming_language).
    [85]Smalltalk. http://en.wikipedia.org/wiki/Smalltalk.
    [86]T. Kistler, M. Franz. A tree-based alternative to Java byte-codes. International Journal of Parallel Programming,1999,27,21-33, Feb.
    [87]Kade Hansson. Trees Versus Bytes. BComp Honours thesis, http://central.kaserver5.org/Kasoft/Typeset/JavaTree/index.html.
    [88]Christian H. Stork, Peter S. Housel, Vivek Haldar, Niall Dalton, Michael Franz. Towards Language-Agnostic Mobile Code. in BABEL'01, First International Workshop on Multi-Language Infrastructure and Interoperability (Satellite Event of PLI 2001). vol.59,2001, pp.142-157.
    [89]RFC862. http://tools.ietf.org/html/rfc862.
    [90]Echo. http://en.wikipedia.org/wiki/Echo_protocol.
    [91]Bernard Stepien's TTCN. http://www.site.uottawa.ca/-bernard/ttcn.html.
    [92]蒋凡,王建学,章磊,陈军成.TTCN-3语言类型系统到c++语言的翻译方案.计算机工程与应用,2009,4.
    [93]杨敬峰,蒋凡.协议测试标准TTCN—3的实现.计算机工程与应用,2004,3.
    194] HTTP Test Tool. http://htt.sourceforge.net/.
    [95]龚正虎.计算机网络协议工程.长沙:国防科学技术大学出版社,1993.
    [96]Ron Patton. Software Testing. Sams Publishing,2005.

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700