Research and Application on MOCK Technique of Automatic Unit Testing

Author
YinChunJiao
Advisor
LiXueJun
School
Anhui University
Major
Computer technology
Classification
TP311.52 Software Development
Degree
Master's thesis
Year
2011
Downloads
84
Citations
1

Request the full text

Abstract

Research on software testing method is an important branch in software engineering. Software testing is the key of software quality ensurance,amounting to 40% or more of the total software development effort is spent on software testing. Automated testing can not only greatly lessen the workload of the tester, but also reduce errors in testing process. And improve testing efficiency is an important way to ensure the quality of software, shorten the development cycle and reduce software engineering investment.The most basic, minimal granularity of testing is unit tests in the testing process. Firstly the paper explores the current prevalent automated unit testing framework in the field, which is difficult to construct test code for complex software, only used for some simple unit tests. Then Tim Mackinnon proposed Mock Object, to simulate the tested object. Mock Object is used to simulate the target object to cut the dependency of the real object. However, besides object oriented functions, there a large amount of process oriented functions, such as traditional C functions, and 3rd party C librariy functions.. These functions do not have the corresponding simulation technology yet。The paper studies the Gmock under existing Mock, analyzes the Mock’s shortages leading to the limitations in simulation (Gmock can only mock object’s virtual functions), introduces Hook on the basis of current technology, and proposes SuperMock based on Hook. Supermock is designed as three modules, namely, user interfaces, engine and the kernel, which can not only simulate the virtual and non-virtual function of objects, also solve the simulation issues of process oriented functions, such as user C function, and third-party C library functions. Also this paper offers the framework design process of Supermock, which is verified by sample analysis, and finally shows the process of SuperMock’s integration with GooGtest, the existing automated unit testing framework, and verifies the unit testing efficiency improving after integrate SUperMock with Googletest.Unlike ordinary Mock Framework, the traditional Mock Framework bases on object which can only simulate virtual function of the object, but Supermock has changed the traditional design of the framework,by locating the target function memory address, hooking it and re-routing to mock function, saving the original instruction before mocking and restoring after mocked. SuperMock makes up for the traditional Mock frameworks lacking of being unable to fully cover, enabling the unit testing on the Mock technologies provide a comprehensive coverage to arbitrary functions. SuperMock extended the implementation of the concept of Mock, enriching and improving unit test theory, which greatly improves the independence of unit testing o

Table of contents

Abstract 3-4 ABSTRACT 4-6 directory 6-8 Chapter 1 Introduction 8-11 <br / > 1.1 issues raised 8 1.2 research status 8-10 1.3 research content 10-11 Chapter 2 units testing and MOCK technology 11-25 2.1 unit test 11-18 2.1.1 unit test definition and meaning 11-12 2.1 .2 automated unit testing framework 12-13 2.1.3 GoogleTest 13-18 2.2 MOCK technology 18-24 2.2.1 Mock the relevant definitions 18-19 2.2.2 GoogleMock 19-22 2.2.3 Mock technical shortcomings of existing 22-24 2.3 Summary 24-25 Chapter 3 HOOK technology 25-33 3.1 concept 25-26 3.2 HOOK principle 26 -27 3.3 HOOK implementation mechanism 27-32 3.4 HOOK technology in software testing application 32 3.5 Summary 32-33 < br /> Chapter 4 HOOK technology -based new MOCK framework SUPERMOCK 33-62 4.1 HOOK -based technology SUPERMOCK 33-35 4.2 SUPERMOCK frame design 35-60 4.2.1 functional Analysis 35-38 4.2.2 system Architecture 38-39 4.2.3 Mock user interface design 39-43 4.2.4 Mock engine design 43-49 4.2.5 Mock -kernel design 49-54 4.2.6 Mock work process design 54-60 4.3 Chapter Summary 60-62 Chapter 5 SUPERMOCK application framework 62-78 5.1 application examples 62-70 5.1.1 Mock traditional C function 63-66 5.1.2 Mock object Functions 66-70 5.2 SUPERMOCK and GOOGLETEST integration 70-77 5.2.1 integration process 71-72 5.2.2 application examples 72-77 5.3 chapter Summary 77-78 Conclusion 78-80 Thanks 80-81 References 81-83

Related dissertations

  1. Design of remote meter reading system based on GPRS network
  2. Code Coverage Analysis and Path Selection Technology Research and Application
  3. Research and Implementation of Automatic Stub Generation Technology in Unit Test
  4. Research on Unit Test Methods of Special Transformer Acquisition Terminal Based on Embedded Linux
  5. Aspect-oriented Programming-based Unit Test Effectiveness Detection System
  6. Research and Design of Automatic Software Fault Locatlization Technology in Unit Test
  7. Design and implementation of online bookstore system based on Struts Framework
  8. Research and Implementation of Automated Testing for Communication-based Train Control Platform
  9. Research on nuclear power software unit test suite reduction
    ZhuLingLi ·Nanhua University ·2013 ·Master's thesis
  10. Research and Implementation on Unit Test Based Network Management System
  11. The Study and Implementation of Unit Test System for C++ Programs
    LiYan ·Shenyang University of Technology ·2007 ·Master's thesis
  12. In the SGSN side GTPC protocol design , implementation, and testing
  13. Motor vehicle management information system development
    LiuJiangTao ·Zhejiang University ·2004 ·Master's thesis
  14. Automated Test Case Generation System and Implementation
  15. Study and Implementation of UMTS Core Network Handover Technology
    ZhangGuoHua ·Southeast University ·2006 ·Master's thesis
  16. Design and Implementation of Database-Oriented Unit Test Frame
    ZuoJian ·Beijing University of Technology ·2006 ·Master's thesis
  17. Research and Realization of Conference Multipoint Controller Based on SIP Protocol
  18. Research and Design of Unit Test Framework Based on Brew Technology
  19. Web e-government applications based on J2EE Design and Implementation
  20. Application of Automated Unit Test Framework in Enterprise Software Development
    LiuGuoQing ·Zhejiang University ·2006 ·Master's thesis