Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Testing strategy/The Moodle Testing Process: Difference between revisions

From MoodleDocs
No edit summary
(This page contains very out-dated content.)
 
(22 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Template:obsolete}}
{{Work in progress}}
{{Work in progress}}
<H1 CLASS="western">Methodologies in the Moodle Development Process</H1>
=Methodologies in the Moodle Development Process=
<P>Moodle has an established process for developing and integrating software. This section describes relevant testing methodology within the existing process.</P>
Moodle has an established process for developing and integrating software. This section describes relevant testing methodology within the existing process.
<P>The full [https://docs.moodle.org/dev/Process development]
The full [https://docs.moodle.org/dev/Process development]
life-cycle at Moodle is documented in detail [https://docs.moodle.org/dev/Releases#General_release_calendar elsewhere].
life-cycle at Moodle is documented in detail [https://docs.moodle.org/dev/Releases#General_release_calendar elsewhere].
Moodle is currently developed using Agile methodologies including
Moodle is currently developed using Agile methodologies including
Scrum. The following stages of development take place within this
Scrum. The following stages of development take place within this
life-cycle:</P>
life-cycle:
<UL>
 
<LI><P>Weekly integration cycle</P>
* Weekly integration cycle
<LI><P>3-weekly stable sprints</P>
* 3-weekly stable sprints
<LI><P>6-monthly major releases</P>
* 6-monthly major releases
<LI><P>3 minor releases between every major release</P>
* 3 minor releases between every major release
</UL>
 
<H2 CLASS="western">Weekly (Continuous) Integration
==Weekly (Continuous) Integration Cycle==
Cycle</H2>
A manual testing phase of integration issues occurs towards
<P>A manual testing phase of integration issues occurs towards
the end of the SDLC at Moodle during the Wednesday (AWST) testing
the end of the SDLC at Moodle during the Wednesday (AWST) testing
phase. This is the last possible chance Moodle gets to capture
phase. This is the last possible chance Moodle gets to capture
Line 23: Line 23:
prevents issues from being dealt with in a timely manner when
prevents issues from being dealt with in a timely manner when
integrators, or even those writing the code, are able to resolve those issues relatively easily.
integrators, or even those writing the code, are able to resolve those issues relatively easily.
</P>
 
<P>The processes described here ensure the bulk of
The processes described here ensure the bulk of
testing and the majority of responsibility for capturing regressions
testing and the majority of responsibility for capturing regressions
does not lie with the Wednesday testing phase. Testing is performed as early in the SDLC as possible.</P>
does not lie with the Wednesday testing phase. Testing is performed as early in the SDLC as possible.
<H2 CLASS="western">New Unit Tests</H2>
==New Unit Tests==
<P>Creating unit tests prior to coding starts
Creating unit tests prior to coding starts
the whole SDLC off with a focus on quality. If code isn't
the whole SDLC off with a focus on quality. If code isn't
considered complete until unit tests pass, then the code itself will
considered complete until unit tests pass, then the code itself will
Line 35: Line 35:
requiring of a great deal of extra effort to write those tests. As
requiring of a great deal of extra effort to write those tests. As
these tests are added, they will provide early regression testing of
these tests are added, they will provide early regression testing of
new code.</P>
new code.
<P>Unit tests in the PHPUnit framework are a requirement when submitting code to Moodle.</P>


<H2 CLASS="western">Integration Steps</H2>
Unit tests in the PHPUnit framework are a requirement when submitting code to Moodle.
<H3 CLASS="western">Step 1: GIT Pull to integration CI server</H3>
 
When developers are ready to submit their code into the integration process, they set a flag tracker. This in turn triggers the Jenkins CI job "Pre-check remote branch". This job performs the following tasks:
==Integration Steps==
===Step 1: GIT Pull to integration CI server===
When developers are ready to submit their code into the integration process, they set the status of the tracker issue to 'Ready for integration'. This in turn triggers the Jenkins CI job "Pre-check remote branch". This job performs the following tasks:
* Pull the changes to a local branch on the Integration CI Server.
* Pull the changes to a local branch on the Integration CI Server.
** git reset --hard origin => so it is in the same status than the official git repository
** git reset --hard origin => so it is in the same status than the official git repository
Line 47: Line 48:
* Generate a results artefact that is sent to the developer.
* Generate a results artefact that is sent to the developer.


Please note; each job begins by resetting the local git repository to the original state so the pulls are never permanent.
Please note; each job begins by resetting the local git repository to the original state so the pulls are never permanent. This mitigates the risk posed by "collisions" as the purpose of this step is not to test for "collisions" between conflicting patches but to verify that code meets the required standard to proceed to peer review.
<P>Developers push changes to the pre-integration test repository. The changes are picked up by the Jenkins CI server, which runs a set of jobs duplicating those run at integration. The changes must not break the "build" before they pass through to the next step of the process. Therefore, the Jenkins jobs must all pass.</P>
===Step 2: Peer Review===
<P>NOTE: the purpose of this step is not to test for "collisions" between conflicting patches but to verify that code meets the required standard to proceed to peer review.</P>
Any code sent back to the developer at Peer Review, after any changes have been made, must be must pass step 1 again before re-review.
<P>If changes cause a breakage then they must be backed out by the developer and a healthy "build" will be restored.</P>
===Step 3: GIT Pull to integration===
<H3 CLASS="western">Step 2: Peer Review</H3>
Code passing peer review can be pulled from the developers repository to integration where, among other things, the main Jenkins integration jobs run. At this stage integrators also check for "collisions" and conflicts between submitted patches.
<P>Any code sent back to the developer at Peer Review, after any changes have been made, must be must pass step 1 again before re-review.</P>
===Step 4: GIT Pull to Nightly Build Machine, performance and browser driven automation suite===
<H3 CLASS="western">Step 3: GIT Pull to integration</H3>
A set of regression tests are run at 2AM AWST Daily. These tests are scheduled to run automatically from the Moodle test automation framework and run on all supported platforms e.g. all databases MySQL, Oracle, MSSQL, PostgreSQL. The following tests are performed in this order:
<P>Code passing peer review can be pulled from the developers repository to integration where, among other things, the main Jenkins integration jobs run. At this stage integrators also check for "collisions" and conflicts between submitted patches.</P>
# Moodle unit tests, including those submitted by developers.
<H3 CLASS="western">Step 4: GIT pull to CI Hub and Functional automation suite</H3>
# PerfComp performance comparison tests.
On Tuesday (AWST) a set of regression tests are run overnight (Tues-Weds). These tests are scheduled to run automatically from the Moodle test automation framework and run on all supported platforms e.g. all databases MySQL, Oracle, MSSQL, PostgreSQL. The following tests are performed:
# Selenium acceptance tests, automated browser tests based upon the existing Moodle QA test suite.
* Moodle unit tests, including those submitted by developers.
===Step 5: Issue retest===
* Selenium acceptance tests, automated browser tests based upon the existing Moodle QA test suite.
On Wednesday (AWST) the manual issue retesting is performed at Moodle HQ. Issue test steps must be clear and concise, allowing the issue to be recreated easily. Testing steps must go in the testing instructions field to prove that the bug is resolved. Areas of Moodle to investigate with extra exploratory testing should be entered here also.
<H3 CLASS="western">Step 5: Issue retest</H3>
 
<P>On Wednesday (AWST) the manual issue retesting is performed at Moodle HQ. Issue test steps must be clear and concise, allowing the issue to be recreated easily. Test recreation steps must go in the testing instructions field.</P>
==Stable Sprints and Point Releases==
<P>The format for writing test steps is:</P>
Development work performed during stable sprints and point releases are subject to the stringent integration review and testing process described above.
<P>'''Pre-requisites:'''</P>
 
<P>Everything required to allow the test to start. This can include, but is not limited to: issue specific data, test platform information: e.g. OS.</P>
==Major Releases and New Development==
<P>'''Test Steps:'''</P>
The Moodle QA cycle is a user acceptance testing phase at the end of every 6 month development cycle and is a chance for the community to become directly involved in road testing the latest testing release.  
<P>A clear and concise list of test steps required to test the issue with the expected results of each step.</P>
 
<P>'''Actual Result:'''</P>
In reality testing starts much earlier in the development process. All code submitted to Moodle has to pass through the integration process and normally does so in an incremental manner. Any additional testing to be undertaken for a Moodle release is tailored to what will be in that release and defined in the [https://docs.moodle.org/dev/2.4_Test_Plan current release test plan test plan ].
<P>The actual result of what happened when the test is complete.</P>
<P>'''Exploratory focus:'''</P>
<P>Areas of Moodle that may need to be investigated further to identify regressions etc.</P>
<P>An issue passes when the actual result of test no longer occurs and no regressions have been created.</P>
<H2 CLASS="western">Stable Sprints</H2>
'''TODO'''
<H2 CLASS="western">Major Releases and New
Development</H2>
'''TODO'''
<H2 CLASS="western">Point Releases</H2>
'''TODO'''

Latest revision as of 23:17, 1 May 2024

Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.

Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.

Methodologies in the Moodle Development Process

Moodle has an established process for developing and integrating software. This section describes relevant testing methodology within the existing process. The full development life-cycle at Moodle is documented in detail elsewhere. Moodle is currently developed using Agile methodologies including Scrum. The following stages of development take place within this life-cycle:

  • Weekly integration cycle
  • 3-weekly stable sprints
  • 6-monthly major releases
  • 3 minor releases between every major release

Weekly (Continuous) Integration Cycle

A manual testing phase of integration issues occurs towards the end of the SDLC at Moodle during the Wednesday (AWST) testing phase. This is the last possible chance Moodle gets to capture regressions. Relying soley on this phase to capture regressions could result in the late discovery of regressions during unguided exploratory testing and worse still the introduction of regressions into Master. Discovery of issues late in the SDLC prevents issues from being dealt with in a timely manner when integrators, or even those writing the code, are able to resolve those issues relatively easily.

The processes described here ensure the bulk of testing and the majority of responsibility for capturing regressions does not lie with the Wednesday testing phase. Testing is performed as early in the SDLC as possible.

New Unit Tests

Creating unit tests prior to coding starts the whole SDLC off with a focus on quality. If code isn't considered complete until unit tests pass, then the code itself will be of a high quality by the time it is implemented. This also creates a repository of unit regression tests in an iterative manner while not requiring of a great deal of extra effort to write those tests. As these tests are added, they will provide early regression testing of new code.

Unit tests in the PHPUnit framework are a requirement when submitting code to Moodle.

Integration Steps

Step 1: GIT Pull to integration CI server

When developers are ready to submit their code into the integration process, they set the status of the tracker issue to 'Ready for integration'. This in turn triggers the Jenkins CI job "Pre-check remote branch". This job performs the following tasks:

  • Pull the changes to a local branch on the Integration CI Server.
    • git reset --hard origin => so it is in the same status than the official git repository
    • git pull => get the changes proposed by a developer
  • Run checks on the code.
  • Generate a results artefact that is sent to the developer.

Please note; each job begins by resetting the local git repository to the original state so the pulls are never permanent. This mitigates the risk posed by "collisions" as the purpose of this step is not to test for "collisions" between conflicting patches but to verify that code meets the required standard to proceed to peer review.

Step 2: Peer Review

Any code sent back to the developer at Peer Review, after any changes have been made, must be must pass step 1 again before re-review.

Step 3: GIT Pull to integration

Code passing peer review can be pulled from the developers repository to integration where, among other things, the main Jenkins integration jobs run. At this stage integrators also check for "collisions" and conflicts between submitted patches.

Step 4: GIT Pull to Nightly Build Machine, performance and browser driven automation suite

A set of regression tests are run at 2AM AWST Daily. These tests are scheduled to run automatically from the Moodle test automation framework and run on all supported platforms e.g. all databases MySQL, Oracle, MSSQL, PostgreSQL. The following tests are performed in this order:

  1. Moodle unit tests, including those submitted by developers.
  2. PerfComp performance comparison tests.
  3. Selenium acceptance tests, automated browser tests based upon the existing Moodle QA test suite.

Step 5: Issue retest

On Wednesday (AWST) the manual issue retesting is performed at Moodle HQ. Issue test steps must be clear and concise, allowing the issue to be recreated easily. Testing steps must go in the testing instructions field to prove that the bug is resolved. Areas of Moodle to investigate with extra exploratory testing should be entered here also.

Stable Sprints and Point Releases

Development work performed during stable sprints and point releases are subject to the stringent integration review and testing process described above.

Major Releases and New Development

The Moodle QA cycle is a user acceptance testing phase at the end of every 6 month development cycle and is a chance for the community to become directly involved in road testing the latest testing release.

In reality testing starts much earlier in the development process. All code submitted to Moodle has to pass through the integration process and normally does so in an incremental manner. Any additional testing to be undertaken for a Moodle release is tailored to what will be in that release and defined in the current release test plan test plan .