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

面试题 相关文章推荐
新浪网技术部笔试题
Aug 26 面试题
方法名是否可以与构造器的名字相同
Jun 04 面试题
群胜软件Java笔试题
Sep 29 面试题
C++如何引用一个已经定义过的全局变量
Aug 25 面试题
如何打印出当前源文件的文件名以及源文件的当前行号
Apr 05 面试题
利达恒信公司.NET笔试题面试题
Mar 05 面试题
NET程序员上机面试题
May 23 面试题
explicit和implicit的含义
Nov 15 面试题
施惠特软件测试面试题以及笔试题
May 13 面试题
亿企通软件测试面试题
Apr 10 面试题
EJB的基本架构
Sep 22 面试题
shell程序如何生命变量?shell变量是弱变量吗?
Nov 10 面试题
百度软件工程师职位
Feb 14 #面试题
软件配置管理有什么好处
Apr 15 #面试题
中间件分为哪几类
Mar 14 #面试题
软件生产职位结构化面试主要考察要素及面试题库
Jun 12 #面试题
一套软件开发工程师笔试题
May 18 #面试题
软件工程师面试题
Jun 25 #面试题
UML设计模式笔试题
Jun 07 #面试题
You might like
php二分法在IP地址查询中的应用
2008/08/12 PHP
PHP学习笔记之二 php入门知识
2011/01/12 PHP
使用php批量删除数据库下所有前缀为prefix_的表
2014/06/09 PHP
PDO防注入原理分析以及注意事项
2015/02/25 PHP
php技巧小结【推荐】
2017/01/19 PHP
thinkPHP5框架auth权限控制类与用法示例
2018/06/12 PHP
php 将json格式数据转换成数组的方法
2018/08/21 PHP
laravel框架模型、视图与控制器简单操作示例
2019/10/10 PHP
PHP基于phpqrcode类生成二维码的方法示例详解
2020/08/07 PHP
js 页面输出值
2008/11/30 Javascript
检测是否已安装 .NET Framework 3.5的js脚本
2009/02/14 Javascript
javascript demo 基本技巧
2009/12/18 Javascript
jQuery LigerUI 使用教程入门篇
2012/01/18 Javascript
javascript将数组插入到另一个数组中的代码
2013/01/10 Javascript
js中settimeout方法加参数的使用实例
2014/02/27 Javascript
js获取时间并实现字符串和时间戳之间的转换
2015/01/05 Javascript
jQuery实现鼠标划过添加和删除class的方法
2015/06/26 Javascript
JavaScript的面向对象编程基础
2015/08/13 Javascript
jQuery实现鼠标经过时出现隐藏层文字链接的方法
2015/10/12 Javascript
Bootstrap每天必学之弹出框(Popover)插件
2016/04/25 Javascript
bootstrap弹出层的多种触发方式
2017/05/10 Javascript
Nodejs中使用phantom将html转为pdf或图片格式的方法
2017/09/18 NodeJs
AngularJS使用ng-repeat遍历二维数组元素的方法详解
2017/11/11 Javascript
Vue.directive使用注意(小结)
2018/08/31 Javascript
详解vue中localStorage的使用方法
2018/11/22 Javascript
图文详解vue框架安装步骤
2019/02/12 Javascript
js实现轮播图效果 纯js实现图片自动切换
2020/08/09 Javascript
vue-cli3中配置alias和打包加hash值操作
2020/09/04 Javascript
Python 搭建Web站点之Web服务器与Web框架
2016/11/06 Python
解决django后台管理界面添加中文内容乱码问题
2019/11/15 Python
python中delattr删除对象方法的代码分析
2020/12/15 Python
解锁canvas导出图片跨域的N种姿势小结
2019/01/24 HTML / CSS
飞利浦美国官网:Philips美国
2020/02/28 全球购物
护理专业推荐信
2013/11/07 职场文书
领导干部对照检查材料
2014/08/24 职场文书
小学四年级作文之写景
2019/08/23 职场文书