CODEFICTION
  • Home
  • Blog
  • Contact
June 16, 2020 by Gibran Antonio Pulga and Gabriel Antonio Pulga

Unit, Integration and System Testing Strategies for Software Applications

Unit, Integration and System Testing Strategies for Software Applications
June 16, 2020 by Gibran Antonio Pulga and Gabriel Antonio Pulga

Overview

Software testing is defined as an activity to check whether the actual results match the expected result and to ensure that the software system is bug free.

Testing your software is a very important aspect of software development and can largely dictate the fate of an application or web service by catching possible dangerous bugs early on.

There are mainly three types of software testing that we’ll be approaching in this article :

  • Unit testing
  • Integration testing
  • System testing

Although each test may follow a different strategy to be executed, their main purposes are similar (assert that the application is working properly) and there are some guidelines that we can follow to effectively work with software testing.

We will cover a little bit of the tests here, and will actually implement them in the next articles.

Unit testing

Used to test individual code components of an application in order to assert that each unit is working properly.

In Java, a unit is usually referred to as a single class or method.

Guidelines to follow when developing unit testing an application are :

  • Fail if the code is broken
  • Maintainability and Readability
  • Each unit test must verify a single component
  • Components don’t depend on any outside factors

Some benefits when applying unit tests :

  • Confidence increase when changing and maintaining code. If good unit tests are run every time any code is changed, defects or bugs introduced by those changes will be easier to catch.
  • When unit testing your application, you need to make sure your code is modular. This means an increase in reusability.
  • Faster development. All the time saved by proving the safety of your application will add up in the end.

Unit tests are implemented first because they are easier to write and quicker to execute due to its simplicity.

Two of the most popular frameworks used in the Java ecossystem for unit testing method level application are JUnit and TestNG, they are commonly used in conjuncture with a mocking framework like EasyMock, Mockito or JMockit.

Integration testing

Used to check if your application is functioning as a whole, rather than testing individual components, it aims to test across components like code, database and web servers.

Some issues that are able to pop when integration testing your application are components wiring, database bugs, network access, etc.

When thinking about guidelines to follow when working with integration testing, one should always aim to prove that the major parts of a system work well together.

There are no mock objects in integration testing, only real components such as your repository, database, UI, etc.

Some approaches when applying integration tests to your application :

  • Big bang : Involves testing components after each component has been finished
  • Top-down : Categorizes the software by its abstract level, the more abstract a component is the higher level it has. Top level units are tested first and lower level units are tested step by step after that. This approach is taken when the development is also made from top-to-down
  • Bottom-up : Bottom level units are tested first and upper-level units step by step after that. Usually implemented when bottom-up development approach is also followed
  • Sandwich : Combination of top-down and bottom-up

System testing

Usually accomplished by executing one or more of the following tests :

  • Functionality testing : Proves that all software functionalities are working correctly by the standards of the requirement
  • Performance testing : Proves how efficient the software is by testing its effectiveness against the average time of execution. Load tests and stress tests are a big part of performance testing
  • Security & Portability : Done when the software is expected to work in between various platforms and accessed by a number of people

It can be done manually by a person or automatically.

Endnotes

When testing software, it’s important to think about the goal of testing. The development team should assure that the system won’t break when using bad data or when unexpected actions are performed.

Good testing suites should try to break your application and help understand its limits.

In the next articles we will be covering Unit tests and Integration tests.

Thanks for reading !! Feel free to leave any comment.

About the author

Gibran Antonio Pulga
Website | + Posts

Software Consultant with more than 11 years experience, most of that in Finance area. I love building things and see them running and making a difference.

Specialised in Golang (2 years), Java (11 years), Javascript, React and Angular (1 year), PHP (2 years), project management and delivery leading (2 years), mentoring and coaching (1 year).

  • Gibran Antonio Pulga
    http://codefiction.net/author/admin/
    Code fiction
  • Gibran Antonio Pulga
    http://codefiction.net/author/admin/
    About
  • Gibran Antonio Pulga
    http://codefiction.net/author/admin/
    Building a CRUD RESTful API/Web Service with Spring Boot
  • Gibran Antonio Pulga
    http://codefiction.net/author/admin/
    A Beginners Guide to Testing a Web API/Service with Postman
Gabriel Antonio Pulga
Website | + Posts

Engineering student and software enthusiast from Brazil. My hobbies include trekking and playing guitar.

  • Gabriel Antonio Pulga
    http://codefiction.net/author/gabrielpulga/
    Home
  • Gabriel Antonio Pulga
    http://codefiction.net/author/gabrielpulga/
    Blog
  • Gabriel Antonio Pulga
    http://codefiction.net/author/gabrielpulga/
    Portfolio
  • Gabriel Antonio Pulga
    http://codefiction.net/author/gabrielpulga/
    About
Previous articleDocumenting a Spring Boot CRUD RESTful API/Web Service with SwaggerNext article Unit Testing CRUD Endpoints of a Spring Boot Java Web Service/API

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

About The Blog

Our blog aims to help developers solve problems and build modern solutions that they can implement in their projects.

Recent Posts

Building a Real Time Chat Application with Spring Boot and WebsocketFebruary 9, 2021
Integrating Keycloak’s Access Management Solution with a Spring Boot ApplicationAugust 7, 2020
Designing APIs in RAML with Mulesoft’s Anypoint PlatformAugust 5, 2020

Categories

  • API
  • API-testing
  • Java
  • Postman
  • Spring
  • Testing

Tags

anypoint platform api authentication java keycloak postman spring users-api-project web service websockets

Contact

734 Blackwell Street
Barcelona, Spain
[email protected]
Mon. - Fri. 8AM - 6PM

Recent Posts

Building a Real Time Chat Application with Spring Boot and WebsocketFebruary 9, 2021
Integrating Keycloak’s Access Management Solution with a Spring Boot ApplicationAugust 7, 2020
Designing APIs in RAML with Mulesoft’s Anypoint PlatformAugust 5, 2020

Popular Posts

Building a Real Time Chat Application with Spring Boot and Websocket0 comments
A Beginners Guide to Testing a Web API/Service with Postman0 comments
Documenting a Spring Boot CRUD RESTful API/Web Service with Swagger0 comments
All rights reserved to codefiction.net.