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

面试题 相关文章推荐
请说出你所知道的线程同步的方法
Apr 19 面试题
请描述一下”is a”关系和”has a”关系
Feb 03 面试题
一套带答案的C++笔试题
Jan 10 面试题
枚举和一组预处理的#define有什么不同
Sep 21 面试题
SQL Server 2000数据库的文件有哪些,分别进行描述
Mar 30 面试题
什么是数据抽象
Nov 26 面试题
C#实现启动一个进程
Oct 01 面试题
性能测试工程师的面试题
Feb 20 面试题
不同浏览器创建XMLHttpRequest方法有什么不同
Nov 17 面试题
介绍一下Mysql的存储引擎
Feb 12 面试题
MySQL面试题目集锦
Apr 14 面试题
介绍一些UNIX常用简单命令
Nov 11 面试题
百度软件工程师职位
Feb 14 #面试题
软件配置管理有什么好处
Apr 15 #面试题
中间件分为哪几类
Mar 14 #面试题
软件生产职位结构化面试主要考察要素及面试题库
Jun 12 #面试题
一套软件开发工程师笔试题
May 18 #面试题
软件工程师面试题
Jun 25 #面试题
UML设计模式笔试题
Jun 07 #面试题
You might like
PHP下通过QRCode类库创建中间带网站LOGO的二维码
2014/07/12 PHP
php文件下载处理方法分析
2015/04/22 PHP
php中strlen和mb_strlen用法实例分析
2016/11/12 PHP
jquery 经典动画菜单效果代码
2010/01/26 Javascript
jQuery中判断一个元素是否为另一个元素的子元素(或者其本身)
2012/03/21 Javascript
Js+Flash实现访问剪切板操作
2012/11/20 Javascript
js实现网页标题栏闪烁提示效果实例分析
2014/11/20 Javascript
js插件设置innerHTML时在IE8下提示“未知运行时错误”解决方法
2015/04/25 Javascript
JavaScript中获取HTML元素值的三种方法
2016/06/20 Javascript
封装获取dom元素的简单实例
2016/07/08 Javascript
jsp 网站引入外部css或者js失效问题解决
2016/10/31 Javascript
jquery滚动条插件(可以自定义)
2016/12/11 Javascript
AngularJS开发教程之控制器之间的通信方法分析
2016/12/25 Javascript
jQuery命名空间与闭包用法示例
2017/01/12 Javascript
ES6学习教程之对象的扩展详解
2017/05/02 Javascript
Vue.js框架路由使用方法实例详解
2017/08/25 Javascript
node下使用UglifyJS压缩合并JS文件的方法
2018/03/07 Javascript
js使用Promise实现简单的Ajax缓存
2018/11/14 Javascript
IE11下处理Promise及Vue的单项数据流问题
2019/07/24 Javascript
原生微信小程序开发中 redux 的使用详解
2021/02/18 Javascript
把JSON数据格式转换为Python的类对象方法详解(两种方法)
2019/06/04 Python
Python 多线程搜索txt文件的内容,并写入搜到的内容(Lock)方法
2019/08/23 Python
Python垃圾回收机制三种实现方法
2020/04/27 Python
在pycharm中使用matplotlib.pyplot 绘图时报错的解决
2020/06/01 Python
keras的ImageDataGenerator和flow()的用法说明
2020/07/03 Python
CSS3网格的三个新特性详解
2014/04/04 HTML / CSS
Merchant 1948澳大利亚:新西兰领先的鞋类和靴子供应商
2018/03/24 全球购物
J2ee常用的设计模式?说明工厂模式
2015/05/21 面试题
各营销点岗位职责范本
2014/03/05 职场文书
房屋买卖委托书格式范本格式
2014/10/13 职场文书
2015年元旦晚会活动总结(学生会)
2014/11/28 职场文书
交通安全月活动总结
2015/05/08 职场文书
2015年妇女工作总结
2015/05/14 职场文书
城南旧事电影观后感
2015/06/16 职场文书
放飞理想主题班会
2015/08/14 职场文书
八年级作文之友谊
2019/12/02 职场文书