131 lines
6.8 KiB
HTML
131 lines
6.8 KiB
HTML
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title>Design rationale</title>
|
|
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
|
|
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
|
<link rel="home" href="../../index.html" title="Boost.Test">
|
|
<link rel="up" href="../intro.html" title="Introduction">
|
|
<link rel="prev" href="../intro.html" title="Introduction">
|
|
<link rel="next" href="how_to_read.html" title="How to read this documentation">
|
|
</head>
|
|
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
|
<table cellpadding="2" width="100%"><tr>
|
|
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
|
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
|
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
|
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
|
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
|
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
|
</tr></table>
|
|
<hr>
|
|
<div class="spirit-nav">
|
|
<a accesskey="p" href="../intro.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../intro.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="how_to_read.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
|
</div>
|
|
<div class="section">
|
|
<div class="titlepage"><div><div><h3 class="title">
|
|
<a name="boost_test.intro.design_rationale"></a><a class="link" href="design_rationale.html" title="Design rationale">Design rationale</a>
|
|
</h3></div></div></div>
|
|
<p>
|
|
Unit testing tasks arise during many different stages of software development:
|
|
from initial project implementation to its maintenance and later revisions.
|
|
These tasks differ in their complexity and purpose and accordingly are approached
|
|
differently by different developers. The wide spectrum of tasks in a problem
|
|
domain cause many requirements (sometimes conflicting) to be placed on a
|
|
unit testing framework. These include:
|
|
</p>
|
|
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
|
<li class="listitem">
|
|
Writing a <a class="link" href="../section_glossary.html#ref_test_module">unit test module</a> should
|
|
be simple and obvious for new users.
|
|
</li>
|
|
<li class="listitem">
|
|
The framework should allow advanced users to perform non-trivial tests.
|
|
</li>
|
|
<li class="listitem">
|
|
Test module should be able to have many small test cases and developer
|
|
should be able to group them into test suites.
|
|
</li>
|
|
<li class="listitem">
|
|
At the beginning of the development users want to see verbose and descriptive
|
|
error messages.
|
|
</li>
|
|
<li class="listitem">
|
|
During the regression testing users just want to know if any tests failed.
|
|
</li>
|
|
<li class="listitem">
|
|
For small test modules, their execution time should prevail over compilation
|
|
time: user don't want to wait a minute to compile a test that takes a
|
|
second to run.
|
|
</li>
|
|
<li class="listitem">
|
|
For long and complex tests users want to be able to see the testing progress.
|
|
</li>
|
|
<li class="listitem">
|
|
Simplest tests shouldn't require an external library.
|
|
</li>
|
|
<li class="listitem">
|
|
For long term usage users of the <span class="emphasis"><em>Unit Test Framework</em></span>
|
|
should be able to build it as a standalone library.
|
|
</li>
|
|
</ul></div>
|
|
<p>
|
|
The <span class="emphasis"><em>Unit Test Framework</em></span> satisfies the requirements above,
|
|
and provides versatile facilities to:
|
|
</p>
|
|
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
|
<li class="listitem">
|
|
Easily specify all the expectations in the code being tested.
|
|
</li>
|
|
<li class="listitem">
|
|
Organize these expectations into <a class="link" href="../section_glossary.html#test_case">test cases</a>
|
|
and <a class="link" href="../section_glossary.html#test_suite">test suites</a>.
|
|
</li>
|
|
<li class="listitem">
|
|
Detect different kinds of errors, failures, time-outs and report them
|
|
in a uniform customizable way.
|
|
</li>
|
|
</ul></div>
|
|
<h5>
|
|
<a name="boost_test.intro.design_rationale.h0"></a>
|
|
<span class="phrase"><a name="boost_test.intro.design_rationale.why_framework"></a></span><a class="link" href="design_rationale.html#boost_test.intro.design_rationale.why_framework">Why
|
|
do you need a framework?</a>
|
|
</h5>
|
|
<p>
|
|
While you can write a testing program yourself from scratch, the framework
|
|
offers the following benefits:
|
|
</p>
|
|
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
|
<li class="listitem">
|
|
You get an error report in a text format. Error reports are uniform and
|
|
you can easily machine-analyze them.
|
|
</li>
|
|
<li class="listitem">
|
|
Error reporting is separated from the testing code. You can easily change
|
|
the error report format without affecting the testing code.
|
|
</li>
|
|
<li class="listitem">
|
|
The framework automatically detects exceptions thrown by the tested components
|
|
and time-outs, and reports them along other errors.
|
|
</li>
|
|
<li class="listitem">
|
|
You can easily filter the test cases, and call only the desired ones.
|
|
This does not require changing the testing code.
|
|
</li>
|
|
</ul></div>
|
|
</div>
|
|
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
|
<td align="left"></td>
|
|
<td align="right"><div class="copyright-footer">Copyright © 2001-2020 Boost.Test contributors<p>
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
|
</p>
|
|
</div></td>
|
|
</tr></table>
|
|
<hr>
|
|
<div class="spirit-nav">
|
|
<a accesskey="p" href="../intro.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../intro.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="how_to_read.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
|
</div>
|
|
</body>
|
|
</html>
|