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

面试题 相关文章推荐
如何打开WebSphere远程debug
Oct 10 面试题
Java TransactionAPI (JTA) 主要包含几部分
Dec 07 面试题
精伦电子Java笔试题
Jan 16 面试题
介绍一下SQL注入攻击的种类和防范手段
Feb 18 面试题
C#面试题
May 06 面试题
斯福泰克软件测试面试题
Feb 16 面试题
客服端调用EJB对象的几个基本步骤
Jan 15 面试题
如何将无状态会话Bean发布为WEB服务,只有无状态会话Bean可以发布为WEB服务?
Dec 03 面试题
在Ajax应用中信息是如何在浏览器和服务器之间传递的
May 31 面试题
有abstract方法的类一定要用abstract修饰吗
Mar 14 面试题
Exception类的常用方法
Jun 16 面试题
Delphi软件工程师试题
Jan 29 面试题
百度软件工程师职位
Feb 14 #面试题
软件配置管理有什么好处
Apr 15 #面试题
中间件分为哪几类
Mar 14 #面试题
软件生产职位结构化面试主要考察要素及面试题库
Jun 12 #面试题
一套软件开发工程师笔试题
May 18 #面试题
软件工程师面试题
Jun 25 #面试题
UML设计模式笔试题
Jun 07 #面试题
You might like
PHP函数常用用法小结
2010/02/08 PHP
php curl基本操作详解
2013/07/23 PHP
PHP正则提取不包含指定网址的图片地址的例子
2014/04/21 PHP
PHP编写RESTful接口
2016/02/23 PHP
Yii框架表单模型和验证用法
2016/05/20 PHP
yii2实现Ueditor百度编辑器的示例代码
2018/11/02 PHP
JavaScript 常见对象类创建代码与优缺点分析
2009/12/07 Javascript
关于Ext中form移除textfield方法:hide(),setVisible(false),remove()
2010/12/02 Javascript
JS Replace()的高级使用方法介绍
2013/06/29 Javascript
JavaScript中的object转换函数toString()与valueOf()介绍
2014/12/31 Javascript
jQuery插件jcrop+Fileapi完美实现图片上传+裁剪+预览的代码分享
2015/04/22 Javascript
纯js实现手风琴效果
2020/04/17 Javascript
Bootstrap模仿起筷首页效果
2016/05/09 Javascript
详解nodeJS中读写文件方法的区别
2017/03/06 NodeJs
Vue异步加载about组件
2017/10/31 Javascript
在一个页面实现两个zTree联动的方法
2017/12/20 Javascript
轻松解决JavaScript定时器越走越快的问题
2019/05/13 Javascript
Cordova(ionic)项目实现双击返回键退出应用
2019/09/17 Javascript
JavaScript实现简单贪吃蛇效果
2020/03/09 Javascript
react使用CSS实现react动画功能示例
2020/05/18 Javascript
JS实现前端动态分页码代码实例
2020/06/02 Javascript
Python3.2模拟实现webqq登录
2016/02/15 Python
python的re正则表达式实例代码
2018/01/24 Python
对Python正则匹配IP、Url、Mail的方法详解
2018/12/25 Python
python从内存地址上加载python对象过程详解
2020/01/08 Python
Flask中sqlalchemy模块的实例用法
2020/08/02 Python
css3背景图片透明叠加属性cross-fade简介及用法实例
2013/01/08 HTML / CSS
CSS3 实现倒计时效果
2020/11/25 HTML / CSS
绘儿乐产品官方在线商店:Crayola.com
2019/09/07 全球购物
交通专业个人自荐信格式
2013/09/23 职场文书
小学音乐教学反思
2014/02/05 职场文书
求职简历自荐信
2014/06/18 职场文书
小学六一儿童节活动方案
2014/08/27 职场文书
法人单位适用的授权委托书
2014/09/19 职场文书
2014年班组工作总结
2014/11/20 职场文书
一条 SQL 语句执行过程
2022/03/17 MySQL