test_policy.htm 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  4. <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
  5. <meta name="ProgId" content="FrontPage.Editor.Document">
  6. <title>Boost Test Policies and Protocols</title>
  7. </head>
  8. <body bgcolor="#FFFFFF" text="#000000">
  9. <table border="1" bgcolor="#007F7F" cellpadding="2">
  10. <tr>
  11. <td bgcolor="#FFFFFF"><img src="../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td>
  12. <td><a href="../index.htm"><font face="Arial" color="#FFFFFF"><big>Home</big></font></a></td>
  13. <td><a href="../libs/libraries.htm"><font face="Arial" color="#FFFFFF"><big>Libraries</big></font></a></td>
  14. <td><a href="../people/people.htm"><font face="Arial" color="#FFFFFF"><big>People</big></font></a></td>
  15. <td><a href="faq.htm"><font face="Arial" color="#FFFFFF"><big>FAQ</big></font></a></td>
  16. <td><a href="index.htm"><font face="Arial" color="#FFFFFF"><big>More</big></font></a></td>
  17. </tr>
  18. </table>
  19. <h1>Boost Test Policies and Protocols</h1>
  20. <p>The Boost libraries are intended to be both reliable and portable.&nbsp;
  21. Every experienced programmer knows that means each library must be tested against a suitable number of test cases, on a wide range of platforms,
  22. and then tested again (regression tested) every time a change is made and before
  23. every release.&nbsp;</p>
  24. <p>&quot;Quality assurance based on a wide range of targeted tests&quot; as one
  25. of the key answers to <a href="http://users.comlab.ox.ac.uk/tony.hoare">C.A.R
  26. Hoare's</a> question
  27. <a href="http://users.comlab.ox.ac.uk/tony.hoare/icse18.html">&quot;How
  28. did software get so reliable without proof.&quot;</a></p>
  29. <h2>Regression test</h2>
  30. <p>Boost uses an automatic <a href="regression.html"> regression test suite</a> which generates HTML
  31. <a href="../status/compiler_status.html">compiler
  32. status tables</a>.</p>
  33. <h2>Test Policy</h2>
  34. <h3>Required</h3>
  35. <ul>
  36. <li>Every Boost library should supply one or more suitable test programs to be
  37. exercised by the Boost <a href="regression.html"> regression test suite</a>.&nbsp; In addition to
  38. the usual compile-link-run tests expecting successful completion,
  39. compile-only or compile-and-link-only tests may be performed, and success
  40. for the test may be defined as failure of the steps.</li>
  41. <li>Test program execution must report errors by returning a non-zero value.&nbsp; They
  42. may also write to stdout or stderr, but that output should be relatively
  43. brief.&nbsp; Regardless of other output, a non-zero return value is the only
  44. way the regression test framework will recognize an error has
  45. occurred.&nbsp;Note that test programs to be included in the status tables must
  46. compile, link, and run quickly since the tests are executed many, many,
  47. times.</li>
  48. <li>Libraries with time consuming tests should be divided into a
  49. fast-execution basic test program for the status tables, and a separate
  50. full-coverage test program for exhaustive test cases.&nbsp; The basic test
  51. should concentrate on compilation issues so that the status tables
  52. accurately reflect the library's likelihood of correct compilation on a
  53. platform.</li>
  54. <li>If for any reason the usual test policies do not apply to a particular
  55. library, an alternate test strategy must be implemented. &nbsp;&nbsp;</li>
  56. </ul>
  57. <h3>Optional</h3>
  58. <ul>
  59. <li>Use the Boost Test Library for the construction of simple tests.</li>
  60. <li>[Planned] Use the Boost Unit Test Library for the construction of more complex tests
  61. and test suites.</li>
  62. <li>The Boost Program Execution Library is also available for very simple
  63. tests, but the Boost Test Library is much preferred even for very simple
  64. tests.</li>
  65. </ul>
  66. <h2>Suggested Protocol for Fixing Bugs or Adding Features.</h2>
  67. <ul>
  68. <li>First, add regression test cases that detects the bug or tests the
  69. feature. Sometimes adding one case suggests similar untested cases, and they
  70. are added too.</li>
  71. <li>Second, for bugs, run the regression test and verify that the bug is now
  72. detected.</li>
  73. <li>Third, then, and only then, fix the bug or add the feature.</li>
  74. <li>Finally, rerun the full regression tests - sometimes the change breaks
  75. something else.</li>
  76. </ul>
  77. <h2>History</h2>
  78. <p>The current regression test program was developed by Jens Maurer in December,
  79. 2000. The original regression test concept and program, including the automatic
  80. generation of HTML compiler status tables, was developed by Beman Dawes in June,
  81. 2000.</p>
  82. <h2>Acknowledgements</h2>
  83. <p>Written by Beman Dawes. Jens Maurer, Paul Moore, Gary Powell and Jeremy Siek contributed helpful suggestions.</p>
  84. <hr>
  85. <p>Revised <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->17 February, 2003<!--webbot bot="Timestamp" endspan i-checksum="40411" -->
  86. </p>
  87. <p>&nbsp;</p>
  88. <p>&nbsp;</p>
  89. </body>
  90. </html>
粤ICP备19079148号