About Unit Testing

About Unit Testing

Unit testing provides a structured and automated way of testing individual components of a system. As a methodology, unit testing has many advantages over manual, ad-hoc testing and debugging. Benefits which are easy to understand lists below,

  • Because each unit test focuses specifically on an individual method, you can more easily determine the source of a failure for a failing unit test.
  • Such a collection of tests is very useful for regression testing. As you implement new features, you can rerun existing tests to ensure that existing functionality has not been broken.
  • Unit tests also serve as documentation for users of the methods under test. Developers can quickly review unit tests to determine exactly how particular components should be consumed.
Unit testing is a popular concept in application development. And in community, there are many unit testing tools for application developers, such as jUnit, NUnit, CppUnit etc. They all are the instances of the xUnit architecture for unit testing frameworks. With help of unit testing tool, Test Driven Development (TDD) is more popular in these days.

One typical development flow segment of TDD is,
2011040721013181.png

During this flow, practitioners also refer to the green state when all tests are passing and red state when some tests are failing. The little picture below depicts this little state machine.

DB unit testing just is reflecting of unit testing in database field. It has the same benefits as application unit testing.

Standard test case often is made of 4 sub-processes, including execute setup, run test, verify test result, execute teardown.
2011040721020887.png


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值