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面试题大全
Oct 16 面试题
华为慧通笔试题
Apr 22 面试题
雅虎笔试题(字符串操作)
Mar 24 面试题
编写函数,将一个3*3矩阵转置
Oct 09 面试题
以思科路由器为例你写下单臂路由的配置命令
Aug 03 面试题
描述RIP和OSPF区别以及特点
Jan 17 面试题
Linux如何压缩可执行文件
Oct 21 面试题
Java中有几种类型的流?JDK为每种类型的流提供了一些抽象类以供继承,请说出他们分别是哪些类?
May 30 面试题
Java语言的优势
Jan 10 面试题
中科前程Java笔试题
Nov 20 面试题
UNIX文件类型
Aug 29 面试题
JAVA软件工程师测试题
Jul 25 面试题
百度软件工程师职位
Feb 14 #面试题
软件配置管理有什么好处
Apr 15 #面试题
中间件分为哪几类
Mar 14 #面试题
软件生产职位结构化面试主要考察要素及面试题库
Jun 12 #面试题
一套软件开发工程师笔试题
May 18 #面试题
软件工程师面试题
Jun 25 #面试题
UML设计模式笔试题
Jun 07 #面试题
You might like
PHP 采集程序中常用的函数
2009/12/09 PHP
JS 网站性能优化笔记
2011/05/24 PHP
php使用sql数据库 获取字段问题介绍
2013/08/12 PHP
关于URL最大长度限制的相关资料查证
2014/12/23 PHP
php实现网页缓存的工具类分享
2015/07/14 PHP
php给图片添加文字水印方法汇总
2015/08/27 PHP
thinkphp框架类库扩展操作示例
2019/11/26 PHP
JavaScript 10件让人费解的事情
2010/02/15 Javascript
JavaScript字符串常用类使用方法汇总
2015/04/14 Javascript
js HTML5上传示例代码完整版
2016/10/10 Javascript
Webpack打包慢问题的完美解决方法
2017/03/16 Javascript
微信小程序商城项目之淘宝分类入口(2)
2017/04/17 Javascript
详解一个基于套接字实现长连接的express
2019/03/28 Javascript
使用nodejs分离html文件里的js和css详解
2019/04/12 NodeJs
原生JS实现京东查看商品点击放大
2020/12/21 Javascript
使用Python写一个贪吃蛇游戏实例代码
2017/08/21 Python
Python实现的破解字符串找茬游戏算法示例
2017/09/25 Python
利用python 更新ssh 远程代码 操作远程服务器的实现代码
2018/02/08 Python
在python win系统下 打开TXT文件的实例
2018/04/29 Python
在Python中定义一个常量的方法
2018/11/10 Python
python批量读取文件名并写入txt文件中
2020/09/05 Python
Python 抓取数据存储到Redis中的操作
2020/07/16 Python
ASP.NET Core中的配置详解
2021/02/05 Python
意大利香水和彩妆护肤品购物网站:Ditano
2017/08/13 全球购物
如何查找和删除数据库中的重复数据
2014/11/05 面试题
介绍一下HTTP、HTTPS和SSL
2012/12/16 面试题
销售自荐信
2013/10/22 职场文书
我们的节日清明节活动总结
2014/04/30 职场文书
安全目标管理责任书
2014/07/25 职场文书
毕业生实习期转正自我鉴定
2014/09/26 职场文书
手机被没收的检讨书
2014/10/04 职场文书
2014年城管个人工作总结
2014/12/08 职场文书
2014年环保局工作总结
2014/12/11 职场文书
python3 字符串str和bytes相互转换
2022/03/23 Python
浅析JavaScript中的变量提升
2022/06/01 Javascript
GoFrame gredis缓存DoVar Conn连接对象 自动序列化GoFrame gredisDo/DoVar方法Conn连接对象自动序列化/反序列化总结
2022/06/14 Golang