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

面试题 相关文章推荐
如何配置、使用和清除Smarty缓存
Dec 23 面试题
Java中有几种类型的流?JDK为每种类型的流提供了一些抽象类以供继承,请说出他们分别是哪些类
Feb 06 面试题
介绍一下.NET构架下remoting和webservice
May 08 面试题
结构和类有什么异同
Jul 16 面试题
2019年分享net面试的经历和题目
Aug 07 面试题
上海雨人软件技术开发有限公司测试题
Jul 14 面试题
如何进行Linux分区优化
Feb 12 面试题
Linux管理员面试经常问道的相关命令
Apr 29 面试题
敏捷开发的主要原则都有哪些
Apr 26 面试题
int和Integer有什么区别
May 25 面试题
写一个函数,要求输入一个字符串和一个字符长度,对该字符串进行分隔
Jul 30 面试题
final, finally, finalize的区别
Mar 01 面试题
百度软件工程师职位
Feb 14 #面试题
软件配置管理有什么好处
Apr 15 #面试题
中间件分为哪几类
Mar 14 #面试题
软件生产职位结构化面试主要考察要素及面试题库
Jun 12 #面试题
一套软件开发工程师笔试题
May 18 #面试题
软件工程师面试题
Jun 25 #面试题
UML设计模式笔试题
Jun 07 #面试题
You might like
php生成图形验证码几种方法小结
2013/08/15 PHP
PHP获取文件相对路径的方法
2015/02/26 PHP
ThinkPHP3.2.3数据库设置新特性
2015/03/05 PHP
PHP实现的mysql操作类【MySQL与MySQLi方式】
2017/10/07 PHP
php实现微信支付之退款功能
2018/05/30 PHP
laravel 模型查询按照whereIn排序的示例
2019/10/16 PHP
Gambit vs CL BO3 第三场 2.13
2021/03/10 DOTA
google地图的路线实现代码
2009/08/20 Javascript
Javascript学习笔记6 prototype的提出
2010/01/11 Javascript
js select常用操作控制代码
2010/03/16 Javascript
初学js 新节点的创建 删除 的步骤
2011/07/04 Javascript
跨域请求之jQuery的ajax jsonp的使用解惑
2011/10/09 Javascript
javascript继承之为什么要继承
2012/11/10 Javascript
js 高效去除数组重复元素示例代码
2013/12/19 Javascript
AngularJS 服务详细讲解及示例代码
2016/08/17 Javascript
解决vue数组中对象属性变化页面不渲染问题
2018/08/09 Javascript
小程序开发踩坑:页面窗口定位(相对于浏览器定位)(推荐)
2019/04/25 Javascript
详解auto-vue-file:一个自动创建vue组件的包
2019/04/26 Javascript
JavaScript中AOP的实现与应用
2019/05/06 Javascript
JS关闭子窗口并且刷新上一个窗口的实现示例
2020/03/10 Javascript
Python深入学习之内存管理
2014/08/31 Python
利用Python的装饰器解决Bottle框架中用户验证问题
2015/04/24 Python
Python中利用aiohttp制作异步爬虫及简单应用
2018/11/29 Python
详解Appium+Python之生成html测试报告
2019/01/04 Python
python3.6.8 + pycharm + PyQt5 环境搭建的图文教程
2020/06/11 Python
python 写一个水果忍者游戏
2021/01/13 Python
html5给汉字加拼音加进度条的实现代码
2020/04/07 HTML / CSS
MyFrenchPharma中文网:最大的法国药妆平台
2016/10/07 全球购物
欧洲领先的电子和电信零售商和服务提供商:Currys PC World Business
2017/12/05 全球购物
英国在线汽车和面包车零件商店:Car Parts 4 Less
2018/08/15 全球购物
先进集体获奖感言
2014/02/13 职场文书
高三生物教学反思
2016/02/22 职场文书
如何书写邀请函?
2019/06/24 职场文书
go语言中fallthrough的用法说明
2021/05/06 Golang
pycharm 如何查看某一函数源码的快捷键
2021/05/12 Python
pytest实现多进程与多线程运行超好用的插件
2022/07/15 Python