Methods for Developers to Test Their Application

Ilknur Eren
Code Like A Girl
Published in
5 min readApr 22, 2021

--

Photo by Jackson Simmer on Unsplash

Testing is a crucial part of the software development cycle. Developers need to make sure that the application behaves the way they programmed it at every step of the way and ensure that there are no security vulnerabilities within the code. Developers also need to go through a QA testing phase to make sure that the page doesn’t crash when users interact with the site.

Often, we may think our code is solid and works perfectly until we face a use case that crashes on the client-side or, worse, causes security vulnerabilities.

An article published in 2018 in West Agile Labs discussed the actual costs associated with software failure.

“The irrecoverable damages that software failure can cause are evident from the startling reports across the world. In 2017 a report released by Tricentis reveals that global enterprises have testified a loss of 1.7 trillion in assets and affects 3.7 million people across the globe. In 2018 across the US, poor software quality incurs a scaring loss of $2.84 trillion collectively.” — Salik Sameer, West Agile Labs

There are many different methods of testing that developers can implement as well as many techniques to make sure the code is solid every step of the way.

SAST and DAST:

Static Application Security Testing (SAST)

SAST is a method for structural testing, also referred to as white box testing. It is used to find security vulnerabilities that can make the application susceptible to attack. SAST is a way to find software flaws and vulnerabilities. It tests to see if an application has any vulnerabilities that might result in SQL injection.

SAST is performed early on in the software development life cycle and should be used as often as possible on all files containing source code. SAST is often the less expensive route because it is performed early on in the software development phase and any vulnerabilities discovered in SAST can be fixed before the code enters QA or production.

There are many tools to implement SAST in your development environment. If your code is written in C, C++, C# or Java, Klocwork is one tool you can implement on your code. With Klockwork you can avail of detection services for a variety of critical security vulnerabilities such as SQL injection, tainted data, buffer overflow, vulnerable coding practices, and many more.

In addition to this, there’s also Coverity Scan, which can do interactive application software testing. SAST tools can make your testing process much more efficient and streamlined, saving you a lot of time and effort.

Dynamic Application Security Testing (DAST)

As an alternative to SAST, we have DAST. DAST is another method used to test how secure a code is. It is used to find vulnerabilities that can render an app insecure and susceptible to hackers. DAST is applicable to operational apps in a production-like environment. DAST is known as black-box testing as it measures how functional an app is and doesn’t bother with the underlying code or its structure.

The application is tested from the outside inwards since the application needs to be executed in order to perform DAST. DAST is done on web applications. As opposed to vulnerabilities found during SAST, those found during DAST are more expensive to fix because by the time the error is found, the code is in production and developers need to implement a hot fix immediately. One DAST tool is Veracode which has one consolidated dashboard through which you can see the application’s status across all kinds of testing.

Techniques of testing

Unit testing

Just like the name suggests, unit testing is a software testing technique in which individual components or units are tested. Unit testing is done during the development phase of an application by the developer. Each component that a developer builds for the website is tested using unit testing so that every single aspect of how that particular component should function is checked. The unit that the developer writes the test for can be an individual function, a method, a module or an object. Unit testing is important for many reasons. Unit testing helps fix bugs early on in the development cycle. A good unit test will inform you if there is anything you should fix in your code.

Every programming language has a unit test library you can use. If you want to write unit tests in Python, you can use PyTest. For example, one unit test of Pytest library is given below:

import pytestdef test_capital_case():assert capital_case(‘unittest’) == Unittest

For Java, we can use JUnit, which is a free testing tool. For .net languages, we can use NUnit. There are many other libraries we can utilize to write unit tests.

QA Test

Developers and designers should test new components in a QA environment before promoting the code to production. For example, when we check a component on the frontend, we have to make sure that it looks good in all the different browsers and devices. How it looks on Internet Explorer, Firefox and iPhone 8 will be different from how it looks on an iPhone screen. There are so many different platforms and devices that we have to check the application on.

QA testing can be done by the developer itself, designers, product managers or any other member of the team close to the assigned project. The manual testing may be difficult to manage and we might need to have all the devices for which we need to test. For this, there are softwares that are created that can dynamically run QA tests for us, Rainforest QA is one of those softwares that are available.

Rainforest’s mission statement is, “Find bugs before your customers do.” Developers have the ability to create automated tests that can be programmed to respond to pull requests or at a certain time of the day. Rainforest can be programmed to run specific commands and test to see if the expected result is what the developer expects it to be. Rainforest also has the ability to test multiple platforms and devices so we can make sure that any user on any platform or device is seeing what the application iOS is expected to show. Rainforest tests are also relatively easy to set up: product managers or designers can also write tests without any code. In addition to automated tests, developers also have an option to select Rainforest to run manual tests where a QA test engineer on their platform performs the tests we ask them to run.

“All code is guilty until proven innocent”

Testing is a crucial part of the software development cycle. From checking each component to finding security vulnerabilities and testing different platforms, we must complete tests in many different areas in order to make sure our code functions the way we want it to function, looks the way we want it to look and has absolutely no security hazards with the code. When we test early and as often as possible, we neutralize the risk of incurring maintenance costs and enhance usability for our users.

--

--