November 26, 2018

What is Test Automation? Automated Testing 101

Topics

    Industry

      Automated testing (test automation) is a software testing method that makes use of different software tools to both control the execution of tests and improve testing efficiency. Rather than replacing manual testing, automation can be the perfect complement to help reduce testing hours and lower the cost of testing per hour, thus freeing human testers from repetitive tasks and giving them more room to focus on quality.

      In this post, we answer the questions we’re asked most frequently about automated testing—what does it look like in practice? What are the benefits? Do you really need it?

      1. Types of Automated Testing

      Tools including Selenium, Puppeteer, and Protractor can help facilitate the automated testing process. But what type of testing best suits your needs?

      Unit Testing

      Unit testing, typically performed by developers, is where the smallest testable parts of an application are individually and independently tested for proper operation.

      API Testing

      API testing involves testing application programming interfaces (APIs) directly and as part of integration testing, to determine whether they meet expectations for functionality, reliability, performance.

      UI Testing

      These are automated tests that drive your application through its user interface (UI) and include functional testing of the UI controls. They let you verify that the entire application, including its user interface, is functioning correctly. They are also frequently used to automate an existing manual test.

      2. Why Choose Automated Testing?

      Automated testing allows you to create suites of tests to automate repetitive tasks during, throughout, and after a development phase. Typically, these suites contain tests designed to test the legacy functionality of the software, along with newly developed functionality. Automated testing benefits include:

      • Time savings during a development sprint
      • Mitigating risks and discovering defects earlier
      • Allowing manual testers more time to focus on newly developed features and less on regression testing the old
      • Facilitating bug-funding in pre-existing code that has broken with the new deployment
      • Automated tests run much faster than any manual tester could complete them, allowing you to run tests longer and test more often
      • Running tests headless; that is, without having to see the browser (but still getting the same results as though the browser was up and running), which increases the speed in with the tests run
      • Reducing the cost and scope of your testing while increasing its coverage

      As with most business processes, buy-in and commitment require that you are able to prove the value of automated testing. Understand the benefits, then translate them to business values-based outcomes that executives can understand.

      3. Taking It Further: What’s the Difference Between CI and CD?

      We can take this concept a step further and integrate our automated tests with something like Travis CI or Jenkins, through the concepts of CI or CD.

      Continuous integration is a practice that drives development teams to implement small changes, checking code against version control repositories. Typically done within Agile development projects, these changes are made during development sprints.

      Continuous delivery picks up where continuous integration leaves off. CD automates the delivery of the given application to selected environments such as Amazon Web Services (AWS).

      Even though testing occurs throughout the development lifecycle, you still need reassurance that after deployment, everything is working correctly in the given environment. Automated testing tools allow for seamless integration into these deployment tools. Through this integration we can deploy with confidence, knowing that our automated tests will help validate that the application is up and running.

      Since we can run these tests headless, it’s easier to couple them with the deployment process as we can run them without having a browser running during the deployment process.

      4. When Should I Use Automated Testing?

      Automated testing is a great choice when your tests are repeatable and need to run several times. You might have several versions of the app, or want to run tests on different platforms and in different environments. Ideally, you’ll strike a balance between manual and automated testing that improves the quality, reduces the cost, and boosts the ROI of your testing process.

      Be aware that unit tests are typically written alongside software, so these tests can be factored in from the beginning.

      After developing unit tests, focus on the API/services level. By automating API testing, we can have confidence that our services are sending and getting the anticipated responses prior to a deployment. Missing this critical step means that if your API fails during deployment, it will not be caught until the UI attempts to call that API.

      Tests on the upper levels are more expensive to write and maintain, and slower to run, since they depend on the UI. This isn’t the best place to invest your testing budget, as the quality and judgment inherent to manual testing is of great value at this stage.

      For the best results, we want to automate from the bottom up.

       

      test automation pryamid

      Automating earlier in those repetitive testing tasks allows for the greatest coverage of the types of testing needed throughout the development cycle. Bugs found at the unit level are easy to fix early on, rather than having to triage, prioritize, and place in a sprint for development.

      Want to learn more about the variety of unit tests, API tests, UI tests, and manual testing methods available to you, and which combination will best support your company’s goals? Contact us and a team member will get in touch to see how we can help.