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

面试题 相关文章推荐
如何实现jdbc性能优化
Jul 30 面试题
JSF如何进行表格处理及取值
Aug 06 面试题
什么是serialVersionUID
Mar 04 面试题
介绍java中初始化块的使用
Sep 11 面试题
某个公司的Java笔面试题
Mar 11 面试题
大整数数相乘的问题
Jul 22 面试题
编码实现字符串转整型的函数
Jun 02 面试题
什么是反射?如何实现反射?
Jul 25 面试题
Linux面试题LINUX系统类
Nov 25 面试题
abstract class和interface有什么区别
Aug 04 面试题
Set里的元素是不能重复的,那么用什么方法来区分重复与否呢? 是用==还是equals()? 它们有何区别?
Jul 27 面试题
JPA的优势都有哪些
Jul 04 面试题
百度软件工程师职位
Feb 14 #面试题
软件配置管理有什么好处
Apr 15 #面试题
中间件分为哪几类
Mar 14 #面试题
软件生产职位结构化面试主要考察要素及面试题库
Jun 12 #面试题
一套软件开发工程师笔试题
May 18 #面试题
软件工程师面试题
Jun 25 #面试题
UML设计模式笔试题
Jun 07 #面试题
You might like
在JavaScript中调用php程序
2009/03/09 PHP
Warning: session_destroy() : Trying to destroy uninitialized sessionq错误
2011/06/16 PHP
PHP中数据库单例模式的实现代码分享
2014/08/21 PHP
PHP常用的三种设计模式汇总
2016/08/28 PHP
PHP异常处理定义与使用方法分析
2017/07/25 PHP
PHP7内核CGI与FastCGI详解
2019/04/14 PHP
用javascript动态调整iframe高度的方法
2007/03/06 Javascript
一个报数游戏js版(约瑟夫环问题)
2010/08/05 Javascript
javascript 基础篇3 类,回调函数,内置对象,事件处理
2012/03/14 Javascript
Javascript代码在页面加载时的执行顺序介绍
2013/05/03 Javascript
JS防止用户多次提交的简单代码
2013/08/01 Javascript
使用javascript实现ListBox左右全选,单选,多选,全请
2013/11/07 Javascript
JS小游戏之极速快跑源码详解
2014/09/25 Javascript
详解Bootstrap四种图片样式
2016/01/04 Javascript
JS基于clipBoard.js插件实现剪切、复制、粘贴
2016/05/03 Javascript
AngularJS读取JSON及XML文件的方法示例
2017/05/25 Javascript
vue中如何实现后台管理系统的权限控制的方法示例
2018/09/19 Javascript
react的滑动图片验证码组件的示例代码
2019/02/27 Javascript
vue实现的多页面项目如何优化打包的步骤详解
2020/07/19 Javascript
快速了解python leveldb
2018/01/18 Python
python处理“
2019/06/10 Python
python3 批量获取对应端口服务的实例
2019/07/25 Python
在Django admin中编辑ManyToManyField的实现方法
2019/08/09 Python
python实现将两个文件夹合并至另一个文件夹(制作数据集)
2020/04/03 Python
css3图片边框border-image的用法
2017/06/30 HTML / CSS
加拿大领先的牛仔零售商:Bluenotes
2018/01/22 全球购物
台湾屈臣氏网路商店:Watsons台湾
2020/12/29 全球购物
文化活动实施方案
2014/03/28 职场文书
2014年办公室人员工作总结
2014/12/09 职场文书
特岗教师个人总结
2015/02/10 职场文书
离婚案件被告代理词
2015/05/23 职场文书
2016年“11.11”光棍节活动总结
2016/04/05 职场文书
详解MySQL中的主键与事务
2021/05/27 MySQL
html5实现点击弹出图片功能
2021/07/16 HTML / CSS
python的netCDF4批量处理NC格式文件的操作方法
2022/03/21 Python
Tomcat配置访问日志和线程数
2022/05/06 Servers