Certification/Modules

= General =

What do I do when I have any question regarding certification?
If you have any questions regarding certification procedure, please write to email address modulecertification@oxid-esales.com.

Why should modules be certified?
It's recommended to certify modules which you intend to offer in OXID eXchange. On the basis of technical Unit Tests and code reviews, the internal code quality as well as the software design is examined to provide better software quality, compatibility, maintainability and readability. Code quality is provided in following 4 areas:


 * Software-Tests
 * Software-Quality
 * Module compatibility
 * Documentation

Furthermore certified modules are presented flashier than non-certified modules, promoted in OXID's newsletters and get a special seal which indicates their certification and proves tested software quality.

What extensions can be certified?
You have to provide automated tests when you request certification. These tests are essential to pass certification. This means, all extensions which have automated tests can be certified.

What knowledge do you need to certify extensions?
You need basic knowledge in


 * writing modules for OXID eShop
 * writing unit tests for your modules
 * checking out SVN
 * how to use a Linux shell
 * how to copy files from your local PC to a virtual Linux machine
 * how to install software on a Linux box

= OXID eSales module certification =

Request for certificate
Find out about the free download package and inform yourself about the criteria of the OXID module certification as well as the pricing and the technical structure. Next step is getting a price. Just log in, download the certification package, unzip it and fill in your determined code metrics into the excel file OXID-Module-Certification-Calculation.xls. As soon you're satisfied with the price, email your module, tests, installation instructions to [mailto:modulecertification@oxid-esales.com modulecertification@oxid-esales.com] and ask for certification. If you have any questions regarding certification procedure, you can also write to this email address.

= Interpreting the code metrics =


 * To run all the tests and do the coverage report and metrics for the module first you need to add files to the coverage queue in the coverage.inc.php, then run the script runcoverage.sh
 * After the generation you'll find the coverage html files in the /tests/coverage/ folder.
 * A file named "metrics.xml" will be generated in the folder /tests/ and contains the code metrics.

Allowed values for code metrics

 * Code coverage &gt; 90%
 * CRAP Index &lt; 30
 * NPATH Complexity &lt; 200
 * Cyclomatic Complexity &lt; 4

Explanation of the code metrics

 * Code Coverage This value tells you how much percent of code lines are covered by tests
 * CRAP - Index The Change Risk Analysis and Predictions (CRAP) index of a function or method uses cyclomatic complexity and code coverage from automated tests to help estimate the effort and risk associated with maintaining legacy code. A CRAP index over 30 is a good indicator of crappy code.
 * NPATH Complexity The NPATH metric computes the number of possible execution paths through a function. It takes into account the nesting of conditional statements and multi-part boolean expressions (e.g., A &amp;&amp; B, C || D, etc.). o A NPATH Complexity over 200 is a good candidate for a closer decomposition
 * Cyclomatic Complexity Checks cyclomatic complexity against a specified limit. The complexity is measured by the number of if, while, do, for, ?:, catch, switch, case statements, and operators &amp;&amp; and || (plus one) in the body of a constructor, method, static initializer, or instance initializer. It is a measure of the minimum number of possible paths through the source and therefore the number of required tests. Generally 1-4 is considered good, 5-7 ok, 8-10 consider re-factoring, and 11+ re-factor now!

= FAQ =

Question: Test fail and tell there are classes fb... missing. What's wrong?

Answer: Unfortunately there is currently no cURL installed on that VM. Please install it. Next release of VM will come prepared with cURL

Question: If i try to run all tests, they fail due to low memory. What's wrong?

Answer: To run all OXID eShop standard tests you need 2 GB of RAM. VM comes with 512 MB. Increase available RAM.

Question: Standard OXID eShop tests fail and I cannot recognize any reason. What can I do?

Answer: Make sure you ran all tests on a fresh database. Any changes to database (even previously failed tests) can harm proper test passing.

Question: Do I have to use this VM?

Answer: No. You don't. It's not important where tests or mc_metrics.php run. It's only important that you have all the results from mc_metrics.php.

Question: I have several modules which have basically the same functionality, just differ in a very slight way. Do I have to pass certification for all of them separately?

Answer: Depends :). If it's really a very small change and there are tests for it: Most likely you do not have to pass certification for all of them separately. In doubt: just, see above.

Question: I have some extension for OXID eShop which is just some CSS and/or HTML. How can I pass certification?

Answer: You cannot. You need unit tests and PHP code to pass certification. If one of these is missing, certification is not possible.