Changes between Version 1 and Version 2 of Guidelines/MaintenanceGuidelines
- Timestamp:
- Nov 22, 2008, 7:20:22 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Guidelines/MaintenanceGuidelines
v1 v2 10 10 This page describes guidelines that could be followed by the Boost community '''to avoid user code breaking when the user upgrades to a more recent Boost release'''. 11 11 12 The difference between '''breaking changes''' and '''bugs''' concerns documentation. A documented modification breaking user code can not be considered as a bug while the same nondocumented modification could be a bug.13 14 The key issue are:12 The difference between '''breaking changes''' and '''bugs''' concerns documentation. A documented modification breaking user code cannot be considered as a bug while the same undocumented modification could be a bug. 13 14 The key issues are: 15 15 * Documenting and tracking the changes. 16 16 * Avoiding completely silent breakage by a deep inspection of code changes. … … 19 19 * Versioning individual Boost.Libraries. 20 20 21 These guidelines are related mainly to how to document changes. There are also some guidelines that can be followed to detect breaking changes either by test or by inspections. And of course this pages contains alsosome guidelines related to the code itself.22 23 But, why user code canbreak when upgrading Boost?21 These guidelines are related mainly to how to document changes. There are also some guidelines that can be followed to detect breaking changes either by test or by inspections. And of course this pages also contains some guidelines related to the code itself. 22 23 But, why can user code break when upgrading Boost? 24 24 25 25 * '''Syntactical''' breaking: detected at compile time 26 It is evident that the removal of files, namespaces, classes, function, variables or macros could break user code. What it is less evident is th e additionnamespaces, classes, function, variables at the namespace level or macros can also break user code. Note that modifications can be considered as deletion+addition.26 It is evident that the removal of files, namespaces, classes, function, variables or macros could break user code. What it is less evident is that the addition of namespaces, classes, function, variables at the namespace level or macros can also break user code. Note that modifications can be considered as deletion+addition. 27 27 28 28 The following user code example … … 79 79 80 80 Adding macros 81 We should don't have user code breaking untilwe preserve the macro naming rule BOOST_LIBNAME_NAME.81 We shouldn't have user code breaking if we preserve the macro naming rule BOOST_LIBNAME_NAME. 82 82 83 83 * '''Semantical''' breaking: detected at runtime 84 Some times the user code will compile with the upgraded Boost release, but the code will not behave s as before. Thiskind of changes that could lead to this situation must be over documented because the compiler can not help the user to catch the breaking code.84 Some times the user code will compile with the upgraded Boost release, but the code will not behave as before. The kind of changes that could lead to this situation must be over documented because the compiler can not help the user to catch the breaking code. 85 85 86 86 ''Add an example on overloading'' 87 87 88 These guidelines are not only addressed to the Boost library authors, but also to the users and the release manager team (RM). Every member of the Boost community has its role to play. Note that the author plays also the role of user of all libraries on which its library depends and on its own library when writing the library tests.88 These guidelines are not only addressed to the Boost library authors, but also to the users and the release manager team (RM). Every member of the Boost community has his role to play. Note that the author plays also the role of user of all libraries on which his library depends and on his own library when writing the library tests. 89 89 90 90 … … 116 116 117 117 == Tag Boost library with specific library version [author] == 118 Tagging each library release with a version, is the better way to signal to the user of possible incompatibilities.118 Tagging each library release with a version, is the better way to signal possible incompatibilities to the user. 119 119 120 120 == Create a Feature Request ticket for each deprecated/suppressed/modified/new feature [author, user] == 121 Each modification should be tracked with a ticket on the trac ksystem.122 123 124 == Release note and tracksystem traceability [author] ==125 The release note should include121 Each modification should be tracked with a ticket on the trac system. 122 123 124 == Release notes and trac system traceability [author] == 125 The release notes should include 126 126 * the list of all the bug tickets that have been solved 127 * the list of all deprecated/suppressed/modified/new features with its associated ticket.127 * the list of all deprecated/suppressed/modified/new features with their associated tickets. 128 128 129 129 == Include a diff file showing the modification respect to the previous release [author, RM] == 130 130 This file is the explicit report of all the changes in the library. It could be used by the Boost community to inspect that every change has been correctly documented (see inspections bellow). 131 131 132 = Cod ding =133 == Do not use using sentences [user] ==134 As seen before the use of using sentences in user code is one of the source of user code breaking, so it will be safer to use instead namespace synonymsand prefix each symbol with them.132 = Coding = 133 == Do not use using directives [user] == 134 As seen before, using directives in user code is one of the sources of user code breaking, so it will be safer to use namespace synonyms instead and prefix each symbol with them. 135 135 136 136 Instead of doing … … 155 155 156 156 == Do not delete files prematurely [author] == 157 Before deleting a file "file.hpp" deprecate it and let the user modify its code during some versions (e.g. until 1_40). Replace it by157 Before deleting a file, "file.hpp", deprecate it and let the user modify his code during some versions (e.g. until 1_40). Replace it by 158 158 159 159 {{{ … … 161 161 // boost/old_header_file.hpp 162 162 // include whatever file is needed to preserve the old file contents 163 #if defined(BOOST_WAR MS_DEPRECEATED) || defined(BOOST_WARMS_DEPRECEATED_ON_1_40)163 #if defined(BOOST_WARNS_DEPRECATED) || defined(BOOST_WARNS_DEPRECATED_ON_1_40) 164 164 #warning "boost/old_header_file.hpp is deprecated, please include boost/new_header_file.hpp instead 165 165 #endif 166 166 }}} 167 167 168 It will be up to the user to define the macros BOOST_WAR MS_DEPRECEATED and BOOST_WARMS_DEPRECEATED_ON_1_40 when the user wants to be warmed for deprecated features on Boost or on the Boost version 1.40 respectively.168 It will be up to the user to define the macros BOOST_WARNS_DEPRECATED and BOOST_WARNS_DEPRCEATED_ON_1_40 when the user wants to be warmed for deprecated features on Boost or on the Boost version 1.40 respectively. 169 169 170 170 == Do not delete namespaces prematurely [author] == … … 172 172 173 173 == Do not delete classes/functions/variables prematurely [author] == 174 Instead of delet ea class on the next version protect its definition by BOOST_DONT_INCLUDE_DEPRECATED or BOOST_LIBX_DONT_INCLUDE_DEPRECATED.174 Instead of deleting a class on the next version protect its definition by BOOST_DONT_INCLUDE_DEPRECATED or BOOST_LIBX_DONT_INCLUDE_DEPRECATED. 175 175 176 176 {{{ … … 198 198 199 199 == Do not modify functions prototype prematurely [author] == 200 Instead of modifying an existing function prototype, do as you were deleted it and added the new one. As both prototypes should cohabit duringsome releases, check if this overloading could cause user code breaks.200 Instead of modifying an existing function prototype, do as if you were deleting it and adding the new one. As both prototypes should coexist for some releases, check if this overloading could cause user code breaks. 201 201 202 202 … … 205 205 = Test and Inspections = 206 206 207 == Regression Test and trac ksystem traceability ==207 == Regression Test and trac system traceability == 208 208 A bug ticket must be associated to a test case, either the test case exists already and there is a regression for some toolset, or a new toolset is considered, or a new test case is needed to check the bug is there (problem reproducible) and the modification solve the problem. 209 209 * State clearly which test cases prove the bug it it exists [user] … … 211 211 212 212 == Preserve the test from the preceding versions as much as possible == 213 The test from the preceding versions should not be changed when the author modifies its library. These not changed tests are a probe of compatibility with the preceding version. When these test must be changed they indicate a breaking user code issue. So instead of changing themadd new ones stating explicitly on which version they were included and remove these tests from the Jamfile.214 213 The tests from the preceding versions should not be changed when the author modifies its library. These unchanged tests are a probe of compatibility with the preceding version. When these tests must be changed they indicate a breaking user code issue. So instead of changing them, add new ones stating explicitly on which version they were included and remove these tests from the Jamfile. 214