Why do we need Unit test


Posted in 面试题 onJanuary 03, 2013
The test is the executable specification
Focus on the purpose first, then about the possible implementations
Understand the program‘s behavior by looking at the tests – the tests tell you more than an API description, they show the dynamics, how to use the API.
You develop just enough
You get to the goal as quick as possible
You don‘t develop unnecessary code
There is no code without a test
There is no test without a user requirement
Once you get one test working, you know it is working now and forever
You use the tests as regression tests
The tests give us the courage to refactor
You can prove that everything still works after the refactoring by simply executing the tests
Code quality – only code that is tested is checked into versioning system!
Well-written tests provide documentation on expected and unexpected use
Tests are fined grained – can be run independently
Tests can be aggregated easily
Which tests fail give you a hint of where a bug was introduced
Helps ensure you made a shippable product

Tags in this post...

面试题 相关文章推荐
error和exception有什么区别
Oct 02 面试题
得到Class的三个过程是什么
Aug 10 面试题
*p++ 自增p 还是p所指向的变量
Jul 16 面试题
枚举与#define宏的区别
Apr 30 面试题
如何在Oracle中查看各个表、表空间占用空间的大小
Oct 31 面试题
请编程遍历页面上所有 TextBox 控件并给它赋值为 string.Empty
Dec 03 面试题
Linux机考试题
Oct 16 面试题
广州某公司软件工程师面试题
Dec 22 面试题
为什么要用EJB
Apr 17 面试题
几个判断型的面试题
Jul 03 面试题
一道Delphi面试题
Oct 28 面试题
SOA的常见陷阱或者误解是什么
Oct 05 面试题
百度软件工程师职位
Feb 14 #面试题
软件配置管理有什么好处
Apr 15 #面试题
中间件分为哪几类
Mar 14 #面试题
软件生产职位结构化面试主要考察要素及面试题库
Jun 12 #面试题
一套软件开发工程师笔试题
May 18 #面试题
软件工程师面试题
Jun 25 #面试题
UML设计模式笔试题
Jun 07 #面试题
You might like
双冒号 ::在PHP中的使用情况
2015/11/05 PHP
PHP常用算法和数据结构示例(必看篇)
2017/03/15 PHP
javascript据option的value值快速设定初始的selected选项
2007/08/13 Javascript
javascript firefox兼容ie的dom方法脚本
2008/05/18 Javascript
再谈javascript面向对象编程
2012/03/18 Javascript
js身份证判断方法支持15位和18位
2014/03/18 Javascript
IE下双击checkbox反应延迟问题的解决方法
2014/03/27 Javascript
jQuery判断元素是否存在的可靠方法
2014/05/06 Javascript
js如何判断用户是否是用微信浏览器
2014/06/05 Javascript
javascript的document.referrer浏览器支持、失效情况总结
2014/07/18 Javascript
纯javascript实现简单下拉刷新功能
2015/03/13 Javascript
Bootstrap中的Dropdown下拉菜单更改为悬停(hover)触发
2016/08/31 Javascript
微信小程序访问node.js接口服务器搭建教程
2017/04/25 Javascript
jQuery插件select2利用ajax高效查询大数据列表(可搜索、可分页)
2017/05/19 jQuery
vue实现裁切图片同时实现放大、缩小、旋转功能
2018/03/02 Javascript
微信小程序顶部导航栏滑动tab效果
2019/01/28 Javascript
JavaScript实现单英文金山打字通
2020/07/24 Javascript
JavaScript和TypeScript中的void的具体使用
2019/09/12 Javascript
Vue自定义组件双向绑定实现原理及方法详解
2020/09/03 Javascript
使用Python的Treq on Twisted来进行HTTP压力测试
2015/04/16 Python
Python上下文管理器和with块详解
2017/09/09 Python
python使用Plotly绘图工具绘制柱状图
2019/04/01 Python
详解【python】str与json类型转换
2019/04/29 Python
利用pandas合并多个excel的方法示例
2019/10/10 Python
Django 解决开发自定义抛出异常的问题
2020/05/21 Python
python 下载文件的几种方法汇总
2021/01/06 Python
HTML5里的placeholder属性使用实例和美化显示效果的方法
2014/04/23 HTML / CSS
沪江旗下的海量优质课程平台:沪江网校
2017/11/07 全球购物
高中数学教师求职信
2013/10/30 职场文书
学习新党章思想汇报
2014/01/09 职场文书
巡警年度自我鉴定
2014/02/21 职场文书
小学音乐课教学反思
2016/02/18 职场文书
python 算法题——快乐数的多种解法
2021/05/27 Python
redis客户端实现高可用读写分离的方式详解
2021/07/04 Redis
python装饰器代码解析
2022/03/23 Python
Centos7 Shell编程之正则表达式、文本处理工具详解
2022/08/05 Servers