UPCOMING: Magento 2 Bootcamp of four days in The Netherlands (April 29th - May 2nd)
background

March 6, 2024

Magento Integration Testing training in May

Yireo Blog Post

As a Magento backend developer, you will come across them many times: Integration tests. However, it can be hard to get started with writing your own tests for your own code, even harder when it is somebody else's code. On May 27th & 28th, we are organizing a Magento 2 Testing course in The Netherlands to help you cross over.

It is all about the knowledge and the flow

For years, I have been helping out agencies with increasing their code quality. Often, testing was suggested, but a lot of times, it proved to be hard to adopt this: Writing tests - first of all - requires you to have all tools in place and have an understanding of how to write tests.

Next, ideally, the testing code precedes the production code (something that TDD introduces). However, if all the production code is already written, it makes little sense to add unit tests for them. And adding integration tests often proves to be hard, simply because the production code is cluttered. This leads to refactoring, which could take a lot of time. All of this, piles up arguments against testing. However, it is proven that in the end, testing is more time-effective (and therefore, a better investment) than not testing.

The training of May therefore focuses at the very beginning on why testing is an added benefit. It quickly also introduces other means of improving code quality (static analysis, patterns, etc), but testing is the real focus.

Yireo and testing

I have to admit, I was not one of the first to get started with testing myself. For years, I have adopted instead the practice of defensive programming, without knowing it, but this has its boundaries. Next, people showed me how to write a unit test, but for most pieces of code, unit tests were way too complicated, TDD sounded too extreme and integration tests were too difficult to run. It's exactly these arguments where the training tries to provide answers to. Not by diving into too much theory, but by making the practical appliance simpler.

Yireo has organized in the past twice MageTestFest (Amersfoort, NL and Firenze, IT). And even though others gave almost all presentations, I orchestrated things beforehand which gained me a lot of insight into what others were saying about testing. Sometimes I agreed, sometimes I disagreed. A year before the first event, I started to adopt integration tests in the most popular Yireo extensions.

Also, I helped Kristof (Fooman) to setup ExtDN GitHub Actions to run integration tests (amongst other ExtDN practices like PHPCS consolidations, code quality advocation, Marketplace discussions and other GitHub Actions). And finally, I developed a Yireo IntegrationTestHelper module to ease the setup of integration tests. All of this, helped me put down a training that is worth it.

The training topics

The testing training of May 27th & 28th starts off with testing in general and unit testing. A unit test is easy to write - if the unit itself is simple. However, somewhere in the first hour of the first day of the training, units that are not so simple are introduced: This is where either the mocking hell starts (replacing actual dependencies with test double objects) or where integration tests kick in. The training focuses for the major part on integration tests and functional tests from that moment on.

This - aka: integration tests - is also the area where most troubles start: How to set them up, how to allow for automated testing (GitLab, GitHub, BitBucket), how to test for common scenarios, how to make sure that integration tests take as little time as possible to run, how to troubleshoot common scenarios. All of this is included in the training, to make sure you can started with testing adequately.

May 27th & 28th in Baarn, The Netherlands

Both training days take place in the middle of The Netherlands, in the small town of Baarn. The Yireo training facility is just two minutes walk from the trainstation of Baarn. Alternatively, if you come by car, there is also free parking available. Lunch is provided, there will be plenty of snacks (both healthy and unhealthy) to keep up your energy.

Want to get into testing? Then this is your chance!

Posted on March 6, 2024

Join our testing course on May 27th & 28th to give yourself a solid kickstart and to make sure that all caveats are dealt with before you spend too much time on time. This will proof to be a wise investment.

Read more

About the author

Author Jisse Reitsma

Jisse Reitsma is the founder of Yireo, extension developer, developer trainer and 3x Magento Master. His passion is for technology and open source. And he loves talking as well.

Sponsor Yireo

Looking for a training in-house?

Let's get to it!

We don't write too commercial stuff, we focus on the technology (which we love) and we regularly come up with innovative solutions. Via our newsletter, you can keep yourself up to date on all of this coolness. Subscribing only takes seconds.

Do not miss out on what we say

This will be the most interesting spam you have ever read

We don't write too commercial stuff, we focus on the technology (which we love) and we regularly come up with innovative solutions. Via our newsletter, you can keep yourself up to date on all of this coolness. Subscribing only takes seconds.