Back
5 mins read

We test, therefore we are

Blogpost testovaniBlogpost testovani
Testing should be an indispensable part of developing any product. Sometimes it’s circumvented, sometimes viewed as a necessary evil so that we can get our invention to people. And other times, testing can be fun, and if the processes are set correctly you don’t need to even know it’s going on. Which is our case.
By
Robin Vysloužil
| Jan 7, 2020

Why and how?

Our app has more than 60 000 lines of code; a volume large enough to make any small change in a single line risk messing something up. Our chief strength is automation. So we decided to automate not only the creation of ads (the app’s main goal), but also the internal development processes, such as testing. Therefore, we don’t need to be worried that a single altered line will ruin the app. Everything goes through multiple thorough stages of testing, from the early development to the moment the code is entered into the app. And even when the code is included in the app, testing still continues. 

After each GitHub commit, an automated test set is activated to detect any errors in the code. You can say that once each bit of code is handed over, it’s tested to make sure that it won’t break the app. If anything does go wrong (which happens, it’s a common part of the process), we receive a report on what happened and where. To achieve this, we use CircleCI to save ourselves the necessity of manually testing everything. Instead, we leave it up to the program and kick our feet up. Oh, and yeah—it also saves us lots of time. It doesn’t really matter which form of CI is used but we prefer CircleCI.

https://blogadmin.ppcbee.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGNFIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--e248a3989e91390c4fa57d1b0b066b07561f3d58/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VY21WemFYcGxYM1J2WDJ4cGJXbDBXd2RwQWxnQ2FRT2doZ0U9IiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--b1b529f8dfa4cfc5545b605b986d2f12cc3d32fa/pasted%20image%200.pnghttps://blogadmin.ppcbee.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGNFIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--e248a3989e91390c4fa57d1b0b066b07561f3d58/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VY21WemFYcGxYM1J2WDJ4cGJXbDBXd2RwQXJBRWFRT2doZ0U9IiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--21b5f9fec4a1a26d9fca8e4bc575ac97c48ec932/pasted%20image%200.png
Independently of this, another set of tests is run at night to make certain that everything works as it’s supposed to, even when we’re not tinkering with the code. There are many ways for the app to break even when left alone, e.g. hardware malfunction or a change in the API of advertising systems. Along with these nightly builds, visual regression tests are run in our sandbox where all of the app’s visual features; more on that below.

Cypress and Percy are the bestest among besties

Testing can be divided into backend and frontend tests, manual and automated tests, and many other combinations. Our developers mostly do backend tests to verify whether small bits of code are functional—but that’s a topic for another day. The second place goes to frontend tests which work with the app as a whole, simulating user behavior and checking whether to use conforms to the design. We use Cypress to do this, a program that’s proved invaluable when it comes to dealing with bugs. Cypress tests all “happy paths” in the app—the complete path from the creation of a data source to creating various types of campaigns and testing different ways of setting keyword and ad text generators, final synchronization, or Tuner operations.

https://blogadmin.ppcbee.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdFIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5b26c8f5d4ec399a33471b6c9771811292a8080c/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VY21WemFYcGxYM1J2WDJ4cGJXbDBXd2RwQWxnQ2FRT2doZ0U9IiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--b1b529f8dfa4cfc5545b605b986d2f12cc3d32fa/cypress.gifhttps://blogadmin.ppcbee.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdFIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5b26c8f5d4ec399a33471b6c9771811292a8080c/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VY21WemFYcGxYM1J2WDJ4cGJXbDBXd2RwQXJBRWFRT2doZ0U9IiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--21b5f9fec4a1a26d9fca8e4bc575ac97c48ec932/cypress.gif
Percy is another invaluable tool, used for visual regression testing. Practically speaking, this means that we mark places/pages/parts of the app for Percy to “snap” and save as reference images. As soon as the page’s content is changed—e.g. a component’s content or text changes, something fails to render or on the other hand too much is rendered—Percy lets us know and shows us the before and after. This allows us to see which components were changed and whether the said change is correct, or not. If it’s correct, we simply mark the new snaps as reference images and move on. If the change isn’t correct, we now know (or at least should) what needs to be fixed. We use this tool for our sandbox as well since that is where this type of testing truly shines.

You, too, can be involved in testing!

A lot of people are scared of new challenges, especially those which take a lot of time to implement. Carefully creating a test environment and scenarios may be one of these challenges. Nevertheless, the time invested in testing and the related processes is well-spent indeed as tests save our time and prevent us from going prematurely gray. Don’t be afraid and give it a try. The results are truly worth it!

TL;DR

  • We test, and you should too;
  • We use CircleCI, Cypress, Percy, and a whole lot of backend tests;
  • We test, and you should too.


Robinv
Robin Vysloužil
Editor of PPC Bee
Start your 30-day free trial
Cancel anytime. No credit card required
Sign up by Google account
Or use your email

Related articles

Read more

FAQs – Summer Edition

or Answers to the questions you’ve been asking us most often lately.

By Michaela ZákopčaníkováJun 24, 2019 | 2 mins read

Read more

Capitalization in Ads

In the past, PPC Bee automatically changed your capitalized words. Because of them your ads can be rejected (primarily by AdWords). There are, however, several clients whose brand name is comprised of uppercase letters, and there was no way for them to keep this in their ads. Thus we have decided to meet their needs and now we have enabled capitalized words in ads.

By Michaela ZákopčaníkováSep 5, 2017 | 1 min read

Read more

Responsive Search Ads Now in PPC Bee

Last year, Google Ads introduced the option of posting a new type of text ads - responsive search ads. And now you can create these in PPC Bee, too! What do they look like? How can you create them? Keep reading.

By Adam VašendaDec 12, 2019 | 4 mins read