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...

面试题 相关文章推荐
比较基础的php面试题及答案-填空题
Apr 26 面试题
如何获取某个日期是当月的最后一天
Dec 05 面试题
神路信息Java面试题目
Mar 31 面试题
"火柴棍式"程序员面试题
Mar 16 面试题
网络方面基础面试题
Nov 16 面试题
Internet体系结构
Dec 21 面试题
Linux操作面试题
Feb 11 面试题
Linux面试题LINUX系统类
Nov 19 面试题
远程调用的原理
Jul 05 面试题
Python里面如何实现tuple和list的转换
Jun 13 面试题
JSF界面控制层技术
Jun 17 面试题
什么是servlet链?
Jul 13 面试题
百度软件工程师职位
Feb 14 #面试题
软件配置管理有什么好处
Apr 15 #面试题
中间件分为哪几类
Mar 14 #面试题
软件生产职位结构化面试主要考察要素及面试题库
Jun 12 #面试题
一套软件开发工程师笔试题
May 18 #面试题
软件工程师面试题
Jun 25 #面试题
UML设计模式笔试题
Jun 07 #面试题
You might like
基于JavaScript实现继承机制之原型链(prototype chaining)的详解
2013/05/07 Javascript
cookie 最近浏览记录(中文escape转码)具体实现
2013/06/08 Javascript
Extjs改变树节点的勾选状态点击按钮将复选框去掉
2013/11/14 Javascript
js中的eventType事件及其浏览器支持性介绍
2013/11/29 Javascript
jquery ajax应用中iframe自适应高度问题解决方法
2014/04/12 Javascript
addEventListener 的用法示例介绍
2014/05/07 Javascript
JavaScript获取当前网页最后修改时间的方法
2015/04/03 Javascript
jQuery 翻页组件yunm.pager.js实现div局部刷新的思路
2016/08/11 Javascript
AngularJS中$http使用的简单介绍
2017/03/17 Javascript
基于JavaScript实现评论框展开和隐藏功能
2017/08/25 Javascript
vue axios登录请求拦截器
2018/04/02 Javascript
基于Vue自定义指令实现按钮级权限控制思路详解
2018/05/23 Javascript
AngularJS发送异步Get/Post请求方法
2018/08/13 Javascript
vue中引用swiper轮播插件的教程详解
2018/08/16 Javascript
JQuery发送ajax请求时中文乱码问题解决
2019/11/14 jQuery
[01:14]英雄,所敬略同——2018完美盛典宣传视频
2018/12/05 DOTA
Python time模块详解(常用函数实例讲解,非常好)
2014/04/24 Python
python统计一个文本中重复行数的方法
2014/11/19 Python
使用python调用zxing库生成二维码图片详解
2017/01/10 Python
Python正则表达式分组概念与用法详解
2017/06/24 Python
给你选择Python语言实现机器学习算法的三大理由
2017/11/15 Python
详解flask入门模板引擎
2018/07/18 Python
Windows10下Tensorflow2.0 安装及环境配置教程(图文)
2019/11/21 Python
python脚本实现mp4中的音频提取并保存在原目录
2020/02/27 Python
使用pth文件添加Python环境变量方式
2020/05/26 Python
python 30行代码实现蚂蚁森林自动偷能量
2021/02/08 Python
HTML5移动端手机网站开发流程
2016/04/25 HTML / CSS
奥地利购买珠宝和手表网站:ELLA JUWELEN
2019/09/03 全球购物
机电专业体育教师求职信
2013/09/21 职场文书
师范毕业生自我鉴定
2014/01/15 职场文书
家具促销活动方案
2014/02/16 职场文书
初三学习决心书
2014/03/11 职场文书
仓库规划计划书
2014/04/28 职场文书
机关门卫的岗位职责
2014/04/29 职场文书
企业廉洁教育心得体会
2016/01/20 职场文书
关于pytest结合csv模块实现csv格式的数据驱动问题
2022/05/30 Python