System Testing

From Joomla! Documentation

Overview[edit]

System testing is an essential part of a good Quality Control program. For a good general discussion of system testing, visit the Wikipedia article.

The Joomla System Testing Working Group[edit]

There is a group of volunteers focused in System testing. Find all updates at System Tests Working Group

System Testing in Joomla![edit]

System testing in Joomla! uses an open-source program called Selenium. Selenium allows you to create a test script that can be run automatically. The test script actually runs Joomla! in a browser and does the same keystrokes and mouse clicks that a user would do. It can also test for conditions such as the value of text or the presence of HTML elements and report when a test fails or when there is an error in the program.

The benefits of system testing are:

  • System tests help you test that the application is working correctly from the point of view of a user.
  • System tests help clearly specify how the application should behave.
  • System tests help you test that changes made to one part of the application haven't created a bug somewhere else.
  • System tests can be run automatically (for example, each night) so that testing is done as the application is being developed.

System Testing versus Unit Testing[edit]

System Testing and Unit Testing are complementary test strategies. In Joomla!, Unit Testing is mainly used to test the framework classes (for example, the classes in libraries/joomla). Unit tests test that an individual method (also known as function) in a class does what it is supposed to do. For example, a unit test is used to test that the methods in the JString class work as expected. Unit testing provides confidence that the framework classes work as expected and allows you to refactor these classes (improve the code without changing the functionality) and still have confidence that they still work correctly.

System tests test that the application works correctly from the user point of view. For example, a system test can test something simple, for example, that you can create a new menu item for a single article and show the menu item on the site. Or a system test can test something more detailed, for example that the parameters for a module all work as expected.

Designing and creating system tests requires that you know how to use the application. It does not require that you understand how the program is written. Application knowledge is more important than programming knowledge, so system tests can be designed and written by people with less technical knowledge of PHP or the Joomla! framework.

Writing System Tests with Selenium[edit]

For detailed documentation on writing system tests, please see the article Writing System Tests for Joomla! - Part 1.

System Testing Joomla extensions with Codeception[edit]

Codeception is a Framework for testing written in PHP. In Joomla we are creating and documenting a best practice using Codeception to test the component com_localise. Find out more at: Testing Joomla Extensions with Codeception