14 November 2022

Why automated testing of your LMS and plugins matters

Davo Smith

Davo Smith

Senior Developer

Even if you’re not a developer, you should still be taking an interest in automated testing

When we’re building an LMS we never want to go through the motions… maybe with one notable exception. Automated testing.

As its name suggests, automated testing is the testing of your LMS by automatic means. Specifically in our case, it’s used by developers to check their code when developing Moodle and Totara code. As such it’s an essential tool for maintaining quality and catching potential bugs and errors very early.

The process starts before the code is even written. By first writing tests covering every aspect of what you’re developing, you can then develop code that passes every test without missing anything. The testing process continues through new platform releases, upgrades, updates and any other changes to the code. 

Why does automated testing matter?

Whenever someone is working on your LMS, there is the potential for things to go wrong. Human error, broken code and incompatible versions all pose a risk. During initial development, upgrades, when adding new features and when combining different custom code, bugs and errors can creep in.

Automated testing helps you to root out many of these problems instantly and with minimal impact on your budget and resources.

Insist on automated testing

If you’re commissioning a piece of custom development for your LMS, we would strongly recommend you insist that automated testing is part of the development process. In fact, we’d go as far as to say that if the developer isn’t insisting that it’s part of the development process that’s probably a red flag.

Types of automated testing

There are two main types of automated testing:

  1. Unit testing 
  2. User acceptance testing

In both cases, the testing steps are:

  • Set up a scenario to test
  • Do something
  • Check the results

Unit testing

Unit testing in Moodle is always carried out using PHPUnit (other unit testing systems are available for other systems). This will test the code and function of any of the internal details of a plugin.

User acceptance testing

For user acceptance testing on Moodle LMS and Totara Learn, we use Behat, which is an open source behaviour-driven development framework for PHP. 

This allows for testing of very specific processes and behaviour within your LMS or plugin. It’s a bit like having your own robotic assistant to click through every page of a test site and make sure everything works as expected.

You simply create scenarios in which you set out the Given (the preconditions of the scenario), When (the actions that will prompt this scenario) and Then (the outcomes that are expected from the scenario).

Behat helps you to quickly test whether the actual results match your intended outcomes.

Tests as assessment

All of us in L&D are familiar with the idea of tests as a form of assessment. This is a slight variation on that theme. The level of automated testing and other forms of testing a developer has undertaken should be a key consideration when assessing third-party plugins for your LMS. This assessment is very simple to achieve…

Check the ‘tests’ folder

Next time you’re about to install a plugin on your LMS, first take a look inside the ‘tests’ folder. This will show you exactly what steps the developer has taken to ensure the plugin works as intended.

This will either offer peace of mind or cause for concern, either of which would be helpful to have before installing the plugin.

Automated testing doesn’t solve everything

As we said, automated testing is fantastic at finding errors in code. But it won’t spot everything. It can only test what you’ve told it to test. If there’s something you’ve overlooked, the test will overlook it too.

Similarly, it will overlook some obvious errors. If the code says your LMS should be black with dark grey text then – as long as the code is well written – automated testing is unlikely to spot the problem with that.

That’s where humans enter the equation. We also run extensive quality assurance processes, which do pick up those obvious errors and can spot things that might not have been included in the testing testing.

That’s why automated testing matters

No, it’s not a silver bullet, but automated testing is an affordable and fast way of ensuring the quality and reliability of their code, evaluating the quality and suitability of third-party plugins, and protecting your organisation when paying for custom code.

If you’d like a chat about how automated testing can help you achieve all of those things and more, just fill out the form below and we’ll be in touch.

Tags

Share

Request a Callback. It’s easy!

Whether it’s about upgrading your current platform, starting from scratch with an LMS of your choice or you need guidance on where to begin, we’ll be happy to help!

newsletter

Learning tips straight to your inbox

Keep up to date with the latest learning technologies, e-learning insight and advice on getting the best results from your learners and your platforms. Sign up to get regular email updates.