没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
The purpose of this book is not to evangelize that unit testing will save you time and money in your development process and that it will improve the quality of your product, but rather to: Provide the necessary information for you to intelligently balance unit testing with the rest of your development effort and associated costs. Provide guidance on how to develop meaningful unit tests. Consider which technologies you want to utilize as a unit test engine. Consider how unit tests affect the coding style and architecture of your application.
资源推荐
资源详情
资源评论
1
2
By
Marc Clifton
Foreword by Daniel Jebaraj
3
Copyright © 2013 by Syncfusion Inc.
2501 Aerial Center Parkway
Suite 200
Morrisville, NC 27560
USA
All rights reserved.
mportant licensing information. Please read.
This book is available for free download from www.syncfusion.com on completion of a registration form.
If you obtained this book from any other source, please register and download a free copy from
www.syncfusion.com.
This book is licensed for reading only if obtained from www.syncfusion.com.
This book is licensed strictly for personal or educational use.
Redistribution in any form is prohibited.
The authors and copyright holders provide absolutely no warranty for any information provided.
The authors and copyright holders shall not be liable for any claim, damages, or any other liability arising
from, out of, or in connection with the information in this book.
Please do not use this book if the listed terms are unacceptable.
Use shall constitute acceptance of the terms listed.
SYNCFUSION, SUCCINCTLY, DELIVER INNOVATION WITH EASE, ESSENTIAL, and .NET ESSENTIALS are the
registered trademarks of Syncfusion, Inc.
Technical Reviewer: Praveen Ramesh, director of development, Syncfusion, Inc.
Copy Editor: Mary Brunnemer
Acquisitions Coordinator: Jessica Rightmer, senior marketing strategist, Syncfusion, Inc.
Proofreader: Graham High, content producer, Syncfusion, Inc.
I
4
Table of Contents
The Story behind the Succinctly Series of Books ................................................................................. 11
About the Author ....................................................................................................................................... 13
Introduction ............................................................................................................................................... 14
Code Examples ...................................................................................................................................... 14
Screenshots ...................................................................................................................................... 14
Expectations of the Reader.................................................................................................................... 14
Organization of this Book ....................................................................................................................... 14
Chapter 1 Why Unit Test? ....................................................................................................................... 16
Measuring Correctness .......................................................................................................................... 16
Repetition, Repetition, Repetition .......................................................................................................... 17
Code Coverage ...................................................................................................................................... 17
Chapter 2 What is Unit Testing? ............................................................................................................. 18
What is a Unit? ....................................................................................................................................... 18
Pure Units ......................................................................................................................................... 18
Dependent Units ............................................................................................................................... 22
What is a Test? ...................................................................................................................................... 23
Normal Conditions Testing ............................................................................................................... 23
Abnormal Conditions Testing ........................................................................................................... 24
Unit Tests and Other Testing Practices ................................................................................................. 24
Acceptance Test Procedures ........................................................................................................... 25
Automated User Interface Testing .................................................................................................... 25
Usability and User Experience Testing ............................................................................................. 26
Performance and Load Testing ........................................................................................................ 26
Chapter 3 Proving Correctness .............................................................................................................. 27
5
How Unit Tests Prove Correctness ........................................................................................................ 27
Prove Contract is Implemented ........................................................................................................ 27
Prove Computational Results ........................................................................................................... 28
Prove a Method Correctly Handles an External Exception .............................................................. 32
Prove a Bug is Re-creatable ............................................................................................................. 34
Prove a Bug is Fixed ......................................................................................................................... 35
Prove Nothing Broke When Changing Code .................................................................................... 35
Prove Requirements Are Met ........................................................................................................... 35
Chapter 4 Strategies for Implementing Unit Tests .............................................................................. 37
Starting From Requirements .................................................................................................................. 37
Prioritizing Computational Requirements ......................................................................................... 37
Select an Architecture ....................................................................................................................... 38
Maintenance Phase .......................................................................................................................... 38
Determine Your Process ........................................................................................................................ 39
Test-Driven Development ................................................................................................................. 39
Code First, Test Second ................................................................................................................... 41
No Unit Tests .................................................................................................................................... 41
Balancing Testing Strategies ............................................................................................................ 42
Chapter 5 Look before You Leap: The Cost of Unit Testing ............................................................... 43
Unit Test Code vs. Code Being Tested ................................................................................................. 43
Unit Test Code Base May Be Larger Than Production Code........................................................... 43
Maintaining Unit Tests ........................................................................................................................... 44
Does Unit Testing Enforce an Architecture Paradigm? ......................................................................... 44
Unit Test Performance ........................................................................................................................... 45
Mitigating Costs ..................................................................................................................................... 45
Correct Inputs ................................................................................................................................... 45
Avoiding Third-party Exceptions ....................................................................................................... 46
剩余127页未读,继续阅读
资源评论
cjwuhan
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- STM32F103上位机升级,RS485升级、CAN升级
- 前端分析-2023071100789
- 蓝牙BLE扫描、连接及数据传输,做了分包处理,支持大量数据.zip
- 机械设计5th螺旋压榨机sw16非常好的设计图纸100%好用.zip
- 基于RNN的文本翻译模型的设计、实现与优化
- 计算机科学及软件工程面试问题集锦,包括大厂真题,Java基础,数据库,框架,Linux,大数据,常用工具等.zip
- 该项目可以帮助您实现大批量从pdf文件中导出表格数据 .zip
- 153504892134561YX55658-RC522射频卡用户使用手册资料Ver_1.0-190509.zip
- testesttestetew
- DolphinScheduler 分布式调度系统二开达梦数据库初始化sql
- 超大xml解析导入数据库、千万级别大数据导出到Excel 实现核心高性能、分段、分页循环读取-写入-清空内存 解决传统方式的超大数据导致内存溢出.zip
- com.android.vending44.1.17-23-1.apk
- 轻松输出Java应用日志到七牛云大数据日志平台.zip
- 前端分析-2023071100789
- 这是 某宝 卖大几千的压枪源码,不做任何数据读取以及侵入,这里采用外数据采集(IMG), 至今可以使用,无视任何更新(新武器,以及新武器的压枪规则,需要自己调试,在data-config下);.zip
- 前端分析-2023071100789
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功