The Study and Innovation about Mock Technology in Unit Testing
- Author
- WuXiangQian
- Advisor
- GengXiangYi
- School
- Dalian Jiaotong University
- Major
- Applied Computer Technology
- Classification
- TP311.52 Software Development
- Degree
- Master's thesis
- Year
- 2008
- Downloads
- 73
- Citations
- 5
Abstract
Software quality assurance software testing is a key technology in the software life cycle occupies an important position . Testing process is the process of software development a monotonous, complicated and time-consuming aspects of quality assurance . With the recent expansion of the scale of software , software quality improvement , especially RAD ( rapid application development model ) and software reusability proposed a project increasingly want to test by means of effective automated software testing involved heavy work to improve test efficiency , shorten development cycles and reduce capital investment. Java unit testing framework junit field strong enough to make all simple unit tests. However, due to objects, methods are not independent, the test code is difficult to construct . So the industry put forward Mock Object technique to isolate the object being tested . Mock framework of the existing main JMock and easyMock. And these two frameworks , like all other Mock Mock frameworks are limited to a concept : Mock Object is used instead of the code collaboration object. But the test methods in addition to depend on external objects , it also depends on where the object's own methods and properties . Mock technology to simulate the existing test methods rely on being an external object, but is dependent on the test method itself where the object's methods and properties without a corresponding analog technology . This thesis study was to investigate unit testing related technologies, especially Mock technology , based on the concept proposed mockself , making mock technologies into a comprehensive coverage of the test method relies on all the external things . While achieving a new mock framework : mockself to implement this concept , allowing users to easily mock tested properties and methods of the object itself , and gives examples of the use mockself framework .
Table of contents
Abstract 5-6
ABSTRACT 6-9
introduction 9-11
a question raised 9
two research background and significance 9-10
three topics sources and the main work topics 10-11
Chapter unit testing and mock technology 11 -41
1.1 unit test 11-14
1.1.1 unit test definition and meaning 11
1.1.2 unit testing framework and junit 11 -14
1.2 mock technology and its research status 14-40
1.2.1 mock define the status quo at home and abroad 14-16
1.2.2 EasyMock 16-35
1.2.3 jMock 35-40
Summary 40-41
Chapter MockSelf 41-47
2.1 Introduction 41
2.2 existing mock the lack of technology 41-45
2.2.1 technical failure of an existing mock sample 41 - 44
2.2.2 mock technical deficiencies existing theoretical analysis 44-45
2.3 MockSelf concepts and implementation requirements 45-46
2.3.1 concepts 45-46
2.3.2 functional requirements 46
Summary 46-47
Chapter MockSelf framework to achieve 47-63
3.1 Introduction 47
3.2 requirements Analysis 47-51
3.2.1 original needs analysis 47
3.2.2 use case analysis 47-51
3.3 system analysis 51-54
3.3.1 class diagram 51-53
3.3.2 flowchart 53-54
3.4 system design 54-62
Summary 62-63
Chapter MockSelf application framework 63-70 <br / > 4.1 Introduction 63
4.2 test sample 63-66
4.3 and other testing frameworks fusion 66-67
4.4 technology to replace the traditional mock 67-69
Summary 69-70
Conclusion 70-71
References 71-73
studying Master of academic papers published during 73-74
Thanks 74-75