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

面试题 相关文章推荐
Java的五个基础面试题
Feb 26 面试题
写一个函数,求一个字符串的长度。在main函数中输入字符串,并输出其长度
Nov 18 面试题
类成员函数的重载、覆盖和隐藏区别
Jan 27 面试题
如何在存储过程中使用Loop
Jan 05 面试题
MySQL面试题
Jan 12 面试题
如何理解委托
Jan 06 面试题
亿阳信通股份有限公司笔试题(C#)
Mar 04 面试题
介绍一下HTTP、HTTPS和SSL
Dec 16 面试题
ShellScript面试题一则-ShellScript编程
Jun 24 面试题
继承时候类的执行顺序问题,一般都是选择题,问你将会打印出什么?
Nov 18 面试题
我们在web应用开发过程中经常遇到输出某种编码的字符,如iso8859-1等,如何输出一个某种编码的字符串?
Mar 30 面试题
Delphi笔试题
Nov 14 面试题
百度软件工程师职位
Feb 14 #面试题
软件配置管理有什么好处
Apr 15 #面试题
中间件分为哪几类
Mar 14 #面试题
软件生产职位结构化面试主要考察要素及面试题库
Jun 12 #面试题
一套软件开发工程师笔试题
May 18 #面试题
软件工程师面试题
Jun 25 #面试题
UML设计模式笔试题
Jun 07 #面试题
You might like
3个PHP多维数组转为一维数组的方法实例
2014/03/13 PHP
CodeIgniter输出中文乱码的两种解决办法
2014/06/12 PHP
多个Laravel项目如何共用migrations详解
2018/09/25 PHP
php计数排序算法的实现代码(附四个实例代码)
2020/03/31 PHP
广泛收集的jQuery拖放插件集合
2012/04/09 Javascript
javascript 判断中文字符长度的函数代码
2012/08/27 Javascript
javascript修改表格背景色实例代码分享
2013/12/10 Javascript
js弹出div并显示遮罩层
2014/02/12 Javascript
jQuery实现可用于博客的动态滑动菜单
2015/03/09 Javascript
javascript实现实时输出当前的时间
2015/04/27 Javascript
使用jquery.qrcode.js生成二维码插件
2016/10/17 Javascript
浅析JavaScript中break、continue和return的区别
2016/11/30 Javascript
js实现悬浮窗效果(支持拖动)
2017/03/09 Javascript
微信小程序自定义模态对话框实例详解
2017/08/16 Javascript
微信小程序 MinUI组件库系列之badge徽章组件示例
2018/08/20 Javascript
vue-cli3使用 DllPlugin 实现预编译提升构建速度
2019/04/24 Javascript
微信小程序中为什么使用var that=this
2019/08/27 Javascript
js实现小星星游戏
2020/03/23 Javascript
es6函数之尾调用优化实例分析
2020/04/25 Javascript
何时/使用 Vue3 render 函数的教程详解
2020/07/25 Javascript
[04:03]2014DOTA2西雅图国际邀请赛 LGD战队巡礼
2014/07/07 DOTA
[07:40]DOTA2每周TOP10 精彩击杀集锦vol.4
2014/06/25 DOTA
Python中操作MySQL入门实例
2015/02/08 Python
使用Django启动命令行及执行脚本的方法
2018/05/29 Python
获取django框架orm query执行的sql语句实现方法分析
2019/06/20 Python
python根据时间获取周数代码实例
2019/09/30 Python
Python 字符串处理特殊空格\xc2\xa0\t\n Non-breaking space
2020/02/23 Python
python实现定时发送邮件
2020/12/23 Python
中学老师的自我评价
2013/11/07 职场文书
继承公证书样本
2014/04/04 职场文书
力学专业求职信
2014/07/23 职场文书
2015元旦联欢晚会结束语
2014/12/14 职场文书
师德先进个人材料
2014/12/20 职场文书
房产销售员2015年终工作总结
2015/10/22 职场文书
2016中秋节晚会开场白
2015/11/26 职场文书
《模拟人生4》推出新补丁 “婚礼奇缘”DLC终于得到修复
2022/04/03 其他游戏