软件测试是初级开发们比较排斥的事情,包括现在自己,但是好的开发也会是好的测试!!!关于测试你知道多少呢?

值得研究的测试框架

Qt Test

Qt Test is a framework for unit testing Qt based applications and libraries. Qt Test provides all the functionality commonly found in unit testing frameworks as well as extensions for testing graphical user interfaces.

Quick Test

This is another code you can use to diagnose and fix problems on your phone. Through the Quick Test menu, you can test your device’s audio and vibration components. Additionally, you can check your audio and microphone functionality.

Google Test

Google Test (also known as gtest) is a unit testing library for the C++ programming language, released under the BSD 3-clause license[2] and based on the xUnit architecture.[3] Google Test is able to be compiled for a variety of POSIX and Microsoft Windows platforms, allowing unit-testing of C sources as well as C++ with minimal source modification.

Boost Test

Boost test is a unit test framework, It is more neat approach to test individual pieces of codes. The Boost.Test library provides both an easy to use and flexible set of interfaces for writing test programs, organizing tests into simple test cases and test suites, and controlling their runtime execution.

CPPUnit

ppUnit is a unit testing framework module for the C++ programming language. It allows unit-testing of C sources as well as C++ with minimal source modification. It was started around 2000 by Michael Feathers as a C++ port of JUnit for Windows and ported to Unix by Jerome Lacoste.[2] The library is released under the GNU Lesser General Public License.

Catch Test

There are other C++ testing libraries like Google Test, CppUnit, Cute etc. But they are huge and need a lot of dependencies to get started with.

Catch2 a header only framework, just download the catch2.hpp file, do an #include and you are good to go. This simplicity and flexibility is a huge bonus for small and medium scale projects. And its open source

Our Test Project
Let us try and write unit tests for this humble Binary Search Project.

├── build
├── CMakeLists.txt
├── include
│   └── binary_search.hpp
├── src
│   ├── binary_search.cpp
│   └── main.cpp
└── tests
    ├── catch.hpp
    └── test.cpp
4 directories, 6 files

只需header only,引入头文件就可以使用测试框架了,它不香吗?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值