Changes between Version 10 and Version 11 of Guidelines/MaintenanceGuidelines


Ignore:
Timestamp:
Nov 30, 2008, 4:22:33 PM (14 years ago)
Author:
viboes
Comment:

Separate sections for the three audiences

Legend:

Unmodified
Added
Removed
Modified
  • Guidelines/MaintenanceGuidelines

    v10 v11  
    182182
    183183Another approach consist in preserving the test of the older releases and run them on the current release.
    184 If the developer needs to change the tests while he evolves his library this is a symptom the interface have been changed and the same way the tests are broken, the user code can also be broken. If the developer forbids himself to modify the test, he will be able to identify breaking changes early on.
    185 
    186 -----------------------------------------------------------------------------------------------
    187 = Documentation =
    188 
    189 -----------------------------------------------------------------------------------------------
    190 == Tag Boost library with specific library version [developer] == #version
    191 Tagging each library release with a version, is the better way to signal possible incompatibilities to the user.
     184If the developer needs to change the tests while she/he evolves his library this is a symptom the interface has been changed and the same way the tests are broken, the user code can also be broken. If the developer forbids himself to modify the test, he will be able to identify breaking changes early on.
     185
     186
     187
     188
     189-----------------------------------------------------------------------------------------------
     190= Developer Guidelines =
     191
     192-----------------------------------------------------------------------------------------------
     193== Announce new library features == #announce
     194It is a good idea the developer announce to the Boost mailing lists the new features just before committing in the release branch. This will let the time to the Boost community to inspect the modifications introduced.
     195
     196-----------------------------------------------------------------------------------------------
     197== Make feature request for each feature == #feature_request
     198Each modification deprecated/suppressed/modified/new feature should be tracked with a ticket on the Trac system.
     199
     200-----------------------------------------------------------------------------------------------
     201== Document ==
     202
     203-----------------------------------------------------------------------------------------------
     204=== Tag Boost library with specific library version === #version
     205Tagging each library release with a version, is the more visible way to signal possible incompatibilities to the user.
    192206
    193207For example the thread library could have:
     
    200214
    201215-----------------------------------------------------------------------------------------------
    202 == Make feature request for each feature [developer, user] == #feature_request
    203 Each modification deprecated/suppressed/modified/new feature should be tracked with a ticket on the trac system.
    204 
    205 -----------------------------------------------------------------------------------------------
    206 == Include the tracked tickets on the Release notes [developer] == #release_note
     216=== Include the tracked tickets on the Release notes === #release_note
    207217The release notes should include
    208218    * the list of all the bug tickets that have been solved
     
    223233
    224234-----------------------------------------------------------------------------------------------
    225 == List the test cases associated to the trac system tickets [developer] == #ticket_test_case_map
     235=== List the test cases associated to the trac system tickets === #ticket_test_case_map
    226236
    227237Each feature request or bug should have associated at least a test case. A table showing this association will help to check that each feature,bug is has the expected test coverage.   
     
    230240||#XXXX||foo foo foo bar bar bar ||test_foo_bar||
    231241
    232 
    233 -----------------------------------------------------------------------------------------------
    234 == List the dependency upon other Boost library [developer] == #dependency
     242-----------------------------------------------------------------------------------------------
     243=== List the dependency upon other Boost library  === #dependency
    235244Each library lists the other libraries it depends upon and the minimum
    236245version # - as it does with compilers now
     
    240249
    241250-----------------------------------------------------------------------------------------------
    242 == Document behavior differences between release and debug variants [developer] == #debug
     251=== Document behavior differences between release and debug variants === #debug
    243252Document the differences in behavior that depends on the user defines, in particular the release and debug variants.
    244253
    245254
    246255-----------------------------------------------------------------------------------------------
    247 == Document behavior differences between toolsets [developer] == #toolsets
     256=== Document behavior differences between toolsets === #toolsets
    248257Document the differences in behavior that depends on the toolsets.
    249258
    250259
    251 -----------------------------------------------------------------------------------------------
    252 = Coding =
    253 
    254 
    255 -----------------------------------------------------------------------------------------------
    256 == Don't use using directives [user] ==#dont_using
    257 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.
    258 
    259 Instead of doing
    260 
    261 {{{
    262 #!cpp
    263    using namespace boost::interprocess;
    264 
    265    shared_memory_object::remove("MySharedMemory");
    266 }}}
    267 
    268 do
    269 
    270 
    271 {{{
    272 #!cpp
    273     namespace bip = boost::interprocess;
    274 
    275     bip::shared_memory_object::remove("MySharedMemory");
    276 }}}
    277 
    278 -----------------------------------------------------------------------------------------------
    279 == Avoid the use of include all features files at the /boost level [user] ==
    280 Avoid the use of include all features files at the /boost level use instead specific files at boost/lib/file.hpp. Including less code reduce your user code breaking chances.
    281 
    282 -----------------------------------------------------------------------------------------------
    283 == Be careful with the use of using namespace header files [developer] ==
     260== Coding ==
     261-----------------------------------------------------------------------------------------------
     262=== Be careful with the use of using namespace header files ===
    284263To import symbols from another namespace the developer can use the using directive '''using namespace''' but limited to the function level.
    285264
    286265-----------------------------------------------------------------------------------------------
    287 == Don't overload functions that are used by the TR1 (using using)[developer] ==
     266=== Don't overload functions that are used by the TR1 ===
    288267Overloading imported Boost.TR1 functions is equivalent to overload the std functions.
    289268
    290269-----------------------------------------------------------------------------------------------
    291 == Avoid include-all-features files at the /boost level ==
     270=== Avoid include-all-features files at the /boost level ===
    292271Avoid include-all-file at the /boost level including all the functionalities of the library. Provide instead specific files at boost/lib/file.hpp.
    293272
     
    295274
    296275-----------------------------------------------------------------------------------------------
    297 == Don't refine functions overloading without ensuring the same behavior ==
     276=== Don't refine functions overloading without ensuring the same behavior ===
    298277
    299278If you need document them and warm the user.
    300279
    301280-----------------------------------------------------------------------------------------------
    302 == Avoid the inclusion of symbols at the boost or boost::detail namespace ==
     281=== Avoid the inclusion of symbols at the boost or boost::detail namespace ===
    303282These symbols can collide with symbols of other libraries.
    304283
     
    306285
    307286-----------------------------------------------------------------------------------------------
    308 == Avoid different external behavior depending on the variant release or debug without documenting it ==
     287=== Avoid different external behavior depending on the variant release or debug without documenting it ===
    309288
    310289Providing different external behavior depending on the variant release or debug could be a surprise for the user.
     
    313292
    314293-----------------------------------------------------------------------------------------------
    315 == Avoid to change interfaces [developer] == #dont_change_interfaces
     294=== Avoid to change interfaces === #dont_change_interfaces
    316295When you change the interface, you can see the changes that are needed at the Boost level, but you can not evaluate the cost induced by this change for the users. So before to change an interface deprecate it and let the user enough time to migrate to the new one.
    317296
    318297-----------------------------------------------------------------------------------------------
    319 === Don't delete files prematurely [developer] === #dont_delete_files
     298=== Don't delete files prematurely === #dont_delete_files
    320299
    321300Before 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
     
    333312
    334313-----------------------------------------------------------------------------------------------
    335 === Don't delete namespaces prematurely [developer] === #dont_delete_namespaces
     314=== Don't delete namespaces prematurely === #dont_delete_namespaces
    336315Use the using sentence to import from the new namespace to the old one.
    337316
    338317-----------------------------------------------------------------------------------------------
    339 === Don't delete classes/functions/variables prematurely [developer] === #dont_delete_cpp_symbols
     318=== Don't delete classes/functions/variables prematurely === #dont_delete_cpp_symbols
    340319Instead of deleting a class or a public/protected function/variable on the next version protect its declaration by any of the DONT_INCLUDE_DEPRECATED macros.
    341320
     
    385364
    386365-----------------------------------------------------------------------------------------------
    387 === Don't modify functions prototypes prematurely [developer] === #dont_modify_prototypes
     366=== Don't modify functions prototypes prematurely  === #dont_modify_prototypes
     367
     368
    388369Modifying an existing function prototype, if you were deleting it and adding the new one. Instead add the new when possible.
    389370
     
    391372
    392373-----------------------------------------------------------------------------------------------
    393 === Remove the deprecated features on a given release [developer] === #deprecated_removal
     374=== Remove the deprecated features on a given release === #deprecated_removal
    394375Once the deprecated period is expired the developer sould remove them.
    395376
     
    397378
    398379-----------------------------------------------------------------------------------------------
    399 = Test =
    400 -----------------------------------------------------------------------------------------------
    401 == Test headers [developer] ==
     380== Test ==
     381=== Test headers  ===
    402382Steve Watanabe has written a Jamfile that make easier this task. See /boost/libs/units/test/test_header for an example.
    403383
    404 === Include each header files twice [developer] ===
     384'''Include each header files twice'''
    405385The inclusion of a header file  twice ensure that the file is self contained, and that it is well protected
    406386
     
    414394
    415395-----------------------------------------------------------------------------------------------
    416 === Include all header files in both orders [developer] ===
     396'''Include all header files in both orders'''
    417397One more test could be useful, include all the Boost Headers files on both orders
    418398{{{
     
    433413
    434414-----------------------------------------------------------------------------------------------
    435 === link all the header files twice [developer] ===
     415'''Link all the header files twice'''
    436416This ought to catch non-inlined functions and other duplicate definitions
    437417
    438418-----------------------------------------------------------------------------------------------
    439 == Don't forget to test  ==
    440 -----------------------------------------------------------------------------------------------
    441 === The implicitly generated member functions ===
     419=== Don't forget to test  ===
     420-----------------------------------------------------------------------------------------------
     421==== The implicitly generated member functions ====
    442422The implicitly generated member functions are part of your interface.
    443423
     
    445425
    446426-----------------------------------------------------------------------------------------------
    447 === The removed default member functions when you declare a constructor ===
     427==== The removed default member functions when you declare a constructor ====
    448428When you declare a constructor the other default constructors are not generated, so
    449429
    450430-----------------------------------------------------------------------------------------------
    451 === The deleted (private) default member functions  ===
     431==== The deleted (private) default member functions  ====
    452432The default member functions =deleted (or declared private) are not part of the interface.
    453433
     
    455435
    456436-----------------------------------------------------------------------------------------------
    457 === The explicit constructors ===
    458 
    459 -----------------------------------------------------------------------------------------------
    460 === The implicit constructors or conversions ===
    461 
    462 -----------------------------------------------------------------------------------------------
    463 === The const-ness of variables, function parameters and function return types and functions ===
     437==== The explicit constructors ====
     438
     439-----------------------------------------------------------------------------------------------
     440==== The implicit constructors or conversions ====
     441
     442-----------------------------------------------------------------------------------------------
     443==== The const-ness of variables, function parameters and function return types and functions ====
    464444When a variable, function parameter or function return type is non-const, test that you can modify them.
    465445
     
    467447
    468448-----------------------------------------------------------------------------------------------
    469 == Separate the functional test from the unit test (implementation test) ==
     449=== Separate the functional test from the unit test (implementation test) ===
    470450Functional test should take in account only the documented behavior. They can be used as regression test for new re-factorings of the implementation.
    471451
    472452Implementation test can be used to test details in the implementation but not as regression tests.
    473453
    474 -----------------------------------------------------------------------------------------------
    475 == Track regression test on the trac system tickets == #ticket_test_case [user]
     454
     455-----------------------------------------------------------------------------------------------
     456=== Preserve the functional test from the preceding versions === #released_tests
     457While doing modifications to the library the developer can find some regressions on some tests of the preceding versions. It seems natural to change them to make the test succeed. This is not a good idea. The failing test is a symptom that the new modifications could break user code.
     458
     459If the modification don't pretended to be an interface break, the developer should modify the library until the preceding test cases pass.
     460
     461If the break is intentional move the tests to the failing tests compile_fail or run_fail on the Jamfile. The developer can copy the test and adapt it to the new interface. It could be a good idea to state explicitly on the test file name on which version they were included.
     462
     463In order to avoid erroneous modification of the the released tests files the developer could change the rights of the test files. If the developer has no permission to do that on the SVN repository as a last resort he could change the permission in its own SVN copy.
     464
     465-----------------------------------------------------------------------------------------------
     466= User guidelines =
     467
     468-----------------------------------------------------------------------------------------------
     469== Don't use using directives == #dont_using
     470As 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.
     471
     472Instead of doing
     473
     474{{{
     475#!cpp
     476   using namespace boost::interprocess;
     477
     478   shared_memory_object::remove("MySharedMemory");
     479}}}
     480
     481do
     482
     483
     484{{{
     485#!cpp
     486    namespace bip = boost::interprocess;
     487
     488    bip::shared_memory_object::remove("MySharedMemory");
     489}}}
     490
     491-----------------------------------------------------------------------------------------------
     492== Avoid the use of include all features files at the /boost level  ==
     493Avoid the use of include all features files at the /boost level use instead specific files at boost/lib/file.hpp. Including less code reduce your user code breaking chances.
     494
     495-----------------------------------------------------------------------------------------------
     496== Help tracking regression test on the Trac system tickets == #ticket_test_case
    476497A bug ticket should be associated to one or several test cases, either the test cases exists already and we are in face of a regression for some toolset, or a new toolset is considered, or a new test case is needed to reproduce the bug and the modification solve the problem.
    477 State clearly which test cases reproduce the bug it they exists and propose a new test case reproducing the bug otherwise [user]
    478 
    479 -----------------------------------------------------------------------------------------------
    480 == Preserve the functional test from the preceding versions [developer] == #released_tests
    481 While doing modifications to the library the developer can find some regressions on some tests of the preceding versions. It seems natural to change them to make the test succeed. This is not a good idea. The failing test is a symptom that the new modifications could break user code.
    482 
    483 If the modification don't pretended to be an interface break, the developer should modify the library until the preceding test cases pass.
    484 
    485 If the break is intentional move the tests to the failing tests compile_fail or run_fail on the Jamfile. The developer can copy the test and adapt it to the new interface. It could be a good idea to state explicitly on the test file name on which version they were included.
    486 
    487 In order to avoid erroneous modification of the the released tests files the developer could change the rights of the test files. If the developer has no permission to do that on the SVN repository as a last resort he could change the permission in its own SVN copy.
    488 
    489 -----------------------------------------------------------------------------------------------
    490 = Inspections  =
    491 -----------------------------------------------------------------------------------------------
    492 == Announce new library features [developer] == #announce
    493 It would be great if the developer announce to the Boost mailing lists the new features just before committing in the release branch. This will let the time to the Boost community to inspect the modifications introduced.
    494 
    495 -----------------------------------------------------------------------------------------------
    496 == Inspect the code [developer, user, RM] == #review
    497 Inspect the code to check that the new modifications don't include user code breaks. Tools comparing the contents of the current release and the preceding one could help.
    498 
    499 -----------------------------------------------------------------------------------------------
    500 == Check that every modification has been documented [developer, user, RM] == #coherent_doc
    501 Inspect that every modification has been reported on the documentation. Tools comparing the contents of the current release and the preceding one could help.
    502 
    503 -----------------------------------------------------------------------------------------------
    504 == Check that every modification has been tested [developer, user, RM] == #test_coverage
    505 Inspect that every modification has been tested. Tools comparing the contents of the current release and the preceding one could help.
    506 
    507 
    508 -----------------------------------------------------------------------------------------------
    509 = Developer guidelines =
    510 ||'''Kind'''||'''Guideline'''||
    511 ||Documentation||[wiki:Guidelines/MaintenanceGuidelines#versionTag Boost library with specific library version ]||
    512 ||Documentation||[wiki:Guidelines/MaintenanceGuidelines#feature_request Feature Request for each deprecated/suppressed/modified/new feature]||
    513 ||Documentation||[wiki:Guidelines/MaintenanceGuidelines#release_note Release note and trac system traceability]||
    514 ||Documentation||[wiki:Guidelines/MaintenanceGuidelines#ticket_test_case_map Trac ticket and test cases association]||
    515 ||Code||[wiki:Guidelines/MaintenanceGuidelines#dont_using Don't use using sentences in test programs]||
    516 ||Code||[wiki:Guidelines/MaintenanceGuidelines#dont_delete_files Don't delete files prematurely ]||
    517 ||Code||[wiki:Guidelines/MaintenanceGuidelines#dont_delete_cpp_symbols Don't delete classes/functions/variables prematurely]||
    518 ||Code||[wiki:Guidelines/MaintenanceGuidelines#deprecated_removal Remove the deprecated features on a given release]||
    519 ||Code||[wiki:Guidelines/MaintenanceGuidelines#dont_modify_prototypes Don't modify functions prototypes prematurely]||
    520 ||Test||[wiki:Guidelines/MaintenanceGuidelines#ticket_test_case Regression Test and trac system traceability]||
    521 ||Test||[wiki:Guidelines/MaintenanceGuidelines#released_tests Preserve the test from the preceding versions]||
    522 ||Inspections||[wiki:Guidelines/MaintenanceGuidelines#announce Announce new library features]||
    523 ||Inspections||[wiki:Guidelines/MaintenanceGuidelines#review Inspect the code].||
    524 ||Inspections||[wiki:Guidelines/MaintenanceGuidelines#coherent_doc Check that every modification has been documented]||
    525 ||Inspections||[wiki:Guidelines/MaintenanceGuidelines#test_coverage Check that every modification has been tested]||
    526 
    527 -----------------------------------------------------------------------------------------------
    528 = User guidelines =
    529 ||'''Kind'''||'''Guideline'''||
    530 ||Documentation||[wiki:Guidelines/MaintenanceGuidelines#feature_request Feature Request for each deprecated/suppressed/modified/new feature]||
    531 ||Code||[wiki:Guidelines/MaintenanceGuidelines#dont_using Don't use using sentences]||
    532 ||Test||[wiki:Guidelines/MaintenanceGuidelines#ticket_test_case Regression Test and trac system traceability]||
    533 
    534 ||Inspections||[wiki:Guidelines/MaintenanceGuidelines#review Inspect the code].||
    535 ||Inspections||[wiki:Guidelines/MaintenanceGuidelines#coherent_doc Check that every modification has been documented]||
    536 ||Inspections||[wiki:Guidelines/MaintenanceGuidelines#test_coverage Check that every modification has been tested]||
    537 
    538 -----------------------------------------------------------------------------------------------
    539 = Release manager guidelines =
    540 ||'''Kind'''||'''Guideline'''||
    541 ||Inspections||[wiki:Guidelines/MaintenanceGuidelines#review Inspect the code]||
    542 ||Inspections||[wiki:Guidelines/MaintenanceGuidelines#coherent_doc Check that every modification has been documented]||
    543 ||Inspections||[wiki:Guidelines/MaintenanceGuidelines#test_coverage Check that every modification has been tested]||
    544 
     498State clearly which test cases reproduce the bug it they exists and propose a new test case reproducing the bug otherwise.
     499
     500-----------------------------------------------------------------------------------------------
     501= Boosters guidelines =
     502
     503-----------------------------------------------------------------------------------------------
     504== Inspect the code == #review
     505Inspect the code to check that the new modifications don't include user code breaks.
     506Tools comparing the contents of the current release and the preceding one could help.
     507Discuss the issue on the ML and do a ticket on the Trac system if there is something to improve.
     508
     509-----------------------------------------------------------------------------------------------
     510== Check that every modification has been documented == #coherent_doc
     511Inspect that every modification has been reported on the documentation.
     512Tools comparing the contents of the current release and the preceding one could help.
     513Discuss the issue on the ML and do a ticket on the Trac system if there is something to improve.
     514
     515-----------------------------------------------------------------------------------------------
     516== Check that every modification has been tested == #test_coverage
     517Inspect that every modification has been tested.
     518Tools comparing the contents of the current release and the preceding one could help.
     519Discuss the issue on the ML and do a ticket on the Trac system if there is something to improve.
     520