Changes between Initial Version and Version 1 of SoftwareTesting


Ignore:
Timestamp:
Aug 5, 2017, 2:58:13 PM (7 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SoftwareTesting

    v1 v1  
     1[[PageOutline]]
     2= Testing BOINC software =
     3
     4Our options for development workflow
     5and release management depend on our ability to test.
     6This is a summary of what needs to be tested,
     7and the existing and prospective ways of doing it.
     8
     9Terminology: a branch is "stable" if it's been throughly tested,
     10i.e. there is evidence that most features work on most supported platforms.
     11"Unstable" means there isn't such evidence.
     12"Most" is something like 90%.  100% is impossible.
     13
     14== Client software ==
     15
     16The client software is feature-rich, and runs on many platforms and configurations.
     17In the early days of BOINC we realized that developers could not adequately test the client software.
     18We also realized that active reporting is needed:
     19an absence of bug reports doesn't mean an absence of  bugs.
     20So we created a testing and release system with two related parts:
     21
     22 * An [https://boinc.berkeley.edu/alpha/ Alpha test project] where a large pool of volunteers,
     23   having all different types of computers, GPU, configurations, etc.,
     24   could test new versions of the client software, and
     25   * A [https://boinc.berkeley.edu/alpha/test_matrix.php comprehensive list of test cases].
     26   * A web-based interface by which testers report results.
     27   * A web-based interface for viewing test results.
     28   * A policy for approving a version:
     29     It must get at least 5 "no problems found" reports for each sub-platform
     30     (e.g. Win7, Win10, Mac 10.11, Mac 10.12, Android).
     31
     32 * A [https://boinc.berkeley.edu/trac/wiki/AdminReleaseManagement release management policy]
     33  that works as follows:
     34  * Master is unstable.
     35  * When significant new features have been added to master, create a new "client release branch".
     36  * Have the Alpha test project test this branch.
     37  * Fix bugs and repeat.
     38  * When done, the branch is stable; make it the new public release.
     39  * Thereafter, only bug fixes are allowed in the branch.
     40    Retest with Alpha test, and release new minor versions as needed.
     41
     42Fixing bugs that occur on volunteer hosts can be hard.
     43To facilitate it, I built a
     44[http://boinc.berkeley.edu/dev/sim_web.php Client emulator]
     45that lets me recreate volunteer scenarios in a place
     46where I can use a debugger.
     47
     48This has worked extremely well.
     49Over the years we have simultaneously
     50 * developed the client at a very fast pace
     51 * done a sequence of multi-platform client releases that have been free of major defects.
     52
     53We did this with minimal staff overhead (a small fraction of me and Rom).
     54Leveraging volunteer testers was critical.
     55
     56== Server software ==
     57
     58This includes the scheduler, transitioner and other back-end programs,
     59make_project, create_work, start script,
     60remote file management, and remote job submission.
     61
     62Testing the server software is hard because:
     63
     64 * Basic functionality is complex, e.g.:
     65  * New results are created when others time out
     66  * A workunit errors out when too many results have been created
     67  * For a given work request, the appropriate number of jobs is sent
     68    and the appropriate app versions are used
     69  * File deletion and DB purging eventually clean up everything
     70  It's not realistic to expect a developer to test all of these.
     71
     72 * Realistic testing cannot be done with a single client.
     73  It must involve a diverse population of clients, some of the unreliable or malicious.
     74  (or a simulation of such a population).
     75
     76 * The server software has hundreds of options and features
     77   (to name a few: job assignment, job size matching, plan classes, trickle messages,
     78   jobs with big data files, non-CPU-intensive apps, and so on)
     79   Many of them are there to support a particular project, and require that project's context
     80   (project-specific application, validators, assimilators etc.) in order to test.
     81
     82 * Server functionality can be central (1 server) or distributed.
     83   Testing must cover all cases.
     84
     85 * The server software must work with various versions of dependent software
     86  (MySQL, PHP, Linux, VirtualBox).
     87
     88* Unintended consequences: a change in one place can introduce
     89  bugs in (unpredictable) other places.
     90  When you change anything, you have to test everything.
     91
     92The bottom line is:
     93
     94'''Developer, by themselves, are unable to test the server software'''.
     95
     96And in fact
     97
     98'''we currently have no way of testing server software'''.
     99
     100Thus
     101
     102'''The server software in the master branch is inherently unstable'''.
     103
     104=== Current ===
     105
     106I'm the main developer of server software.
     107Before I commit server software to master I deploy it on a minimal test project
     108and make sure whatever I changed works,
     109and that basic functionality (creating and sending jobs) works.
     110
     111This tests only a tiny fraction of the server functionality.
     112A change could pass this test but cause serious problems
     113that appear only after hours or days.
     114
     115Eventually I test master in SETI@home beta, and then in SETI@home.
     116Sometimes there is a delay of a month or two in doing this.
     117
     118There has never been a stable release of the server software.
     119In practice master is bug-free most of the time, but there is no guarantee of this.
     120
     121=== Proposal ===
     122
     123Most large projects maintain separate test projects (e.g. SETI@home beta).
     124I propose that these be used to test server software,
     125the same way we use volunteer Alpha testers to test the client software.
     126To test a branch, projects will deploy it in their beta test projects,
     127and test the features they use, with their apps,
     128and will report results using a web-based system
     129(we could use the Alpha-test system for this).
     130
     131We should maintain '''server release branches''', similar to client release branches.
     132When significant new features have been added to master,
     133create a new candidate release branch.
     134Deploy to beta projects.
     135Fix bugs as needed; repeat.
     136When done, that branch is stable;
     137make it the public release branch.
     138
     139Server release branches should, in fact, be a stable version of everything
     140that a project needs: server, web, API, wrappers.
     141NOTE: They are not stable for client software.
     142
     143This will also encourage existing projects to merge project-specific changes
     144into BOINC (as e.g. SETI@home does) , so that they are able to use current server software.
     145
     146Fixing bugs that occur in a particular project's beta test can be difficult.
     147Sometimes I've added logging output.
     148As a last resort projects have let me log into their servers.
     149Maybe we can do something analogous to the Client Emulator for server code.
     150
     151=== Automated testing? ===
     152
     153We could create a framework for automated testing of server software.
     154I started doing this a long time ago, and didn't make much progress.
     155More recently, I (with Trilce Estrada) added a mechanism for simulating a project
     156against a dynamic population of clients.
     157This could be used as a basis for automated testing.
     158But it would be a lot of work - like 6 FTE months.
     159
     160I'm skeptical about the feasability of this.
     161The effort needed to construct and maintain an automated test for a complex feature
     162can exceed that for the feature itself.
     163I spent a lot of time making a system for testing basic features.
     164I never found any bugs in BOINC, just a never-ending sequence of bugs in the testing system.
     165
     166If we were to create such a system, and made it available to developers,
     167we could use it for testing changes to master,
     168at which point master would be stable.
     169This is the only way that master can be stable;
     170I don't think we can use beta-test projects for individual developer changes.
     171
     172== Web software ==
     173
     174This is the PHP code that implements project web site features such as forums, leader boards, etc.
     175
     176As with server software, the web code is feature-rich,
     177and can't be thoroughly tested by a single developer.
     178
     179=== Current ===
     180
     181I test changes on my test project before commiting to master.
     182Then I deploy changes to SETI@home, where the changes are seen by thousands of people.
     183Any problems are reported to me by Jord, and I fix them quickly.
     184This works well, though there are short periods when master has bugs.
     185
     186=== Proposal ===
     187
     188Although the two are mostly independent,
     189we should use the same approach for web software as for server software:
     190test it, using beta-test projects, in the server stable branch.
     191
     192We should also explore tools for syntax-checking and security testing,
     193and integrate them into the CI process on master.
     194
     195== App API software and wrappers ==
     196
     197These are feature-rich, and many of the features are used only by
     198specific applications that are not available to developers.
     199So it's not feasible for developers to test them.
     200
     201We should test these using beta-test projects, as for server software.