Developing software applications is hard work. Developing high-quality applications is even harder. Maybe that is why many developers view software testing as an additional task, imposed by non-developers, that adds more effort to the already laborious task of creating the software itself. The idea of writing more code to test application code is not something most developers get excited about. However, this is just an issue of perspective. Instead of concentrating on the extra work that comes from writing application tests, try looking at testing as a development tool that adds value to your team’s applications. Embracing testing as a vital component of software development can save you and your team a lot of time debugging and fixing errors in the future.

Raising the reliability of the application means finding and removing errors. You just cannot assume that your application contains no errors. Recognizing that all software has errors, and writing tests to find and remove those errors will give you, and project stakeholders, more confidence in the applications you build.

Software testing is important enough to have its own phase in the Software Development Life Cycle (SDLC).

For software testing to yield the intended impact on your application’s performance, it must be done right. Fortunately, the process has been broken down into a series of steps known as the Software Testing Life Cycle (STLC). STLC defines a step-by-step process to that improves the quality of software.

In this post, I will lead you through the stages of this process by describing each step and how it can help you and your development team to properly test software.

Prerequisites

To follow along with the concepts in this post, a few assumptions have been made:

  • You are a developer, tester, product manager, or otherwise involved in any of the phases in the software development life cycle
  • You are interested in deploying reliable applications
  • You believe that good user experience is a criteria for success of software applications

If the points above apply to you, welcome to the discussion.

Using a sample application as a testing case study

To help you understand the activities that make up each stage of the testing life cycle, I have created a sample application. I will guide you through the steps for testing at each stage using the sample app as a case study. For the sample, I have chosen one of the most common use cases for any application. Nearly everyone who has visited a website has had to log in with their credentials. So let’s start by using our sample app to test a log-in flow built with HTML, CSS and JavaScript. Here are the steps:

  1. Open log-in page
  2. Enter email and password
  3. Click a button to log in

If the credentials are correct, the user is presented with their profile. If they are not correct, the user is presented with an error message.

Understanding the stages of the software testing life cycle

Now that we have selected the functionality we want to test, we can start walking through each step in the STLC. I will describe how to go about testing this log-in flow.

Testing life cycle step 1 - requirement analysis

At this stage, the quality assurance team meets with all stakeholders to get a full understanding of the application requirements. Comprehensive knowledge of how the application should behave allows you to judge the scope of the testing process. Requirements can be either functional or non-functional. Spend some time prioritizing features and functionality to refine the focus of the testing, and avoid wasting time on what is less important to stakeholders, including users.

Also at this stage, determine what type of testing environment you will use and whether the tests can be automated.

For our log-in flow, analyzing the application requirements will determine:

  • The URL to visit to log in to the application
  • What information appears on the log-in form
  • The credentials required to log in to the app
  • The types of users who are expected to log in
  • Whether logging in is available to everyone with an internet connection or restricted to a geographical region
  • The type of codebase the application is built in
  • The testing environment an app with our codebase requires
  • Whether any log-in credentials are optional
  • The error and success messages to show the users
  • Whether or not tests can be automated

There are many more possibilities, even for our limited sample use case.

Testing life cycle step 2 - planning the tests

When the requirements analysis stage is complete, it is time to move on to planning your tests. In this stage, the testing team manager estimates the cost and effort that will go into the testing process. The estimate encompasses the resources required, the tools needed, and the testing environment. Limitations of the tests or resources are also determined.

Also part of the test planning stage is creating a testing schedule for the activities and people involved. The goal of the planning stage is to have a working document that includes the testing strategy, a detailed plan, and a schedule.

Planning for the log-in functionality in our sample application could include activities like these:

  • Determine the number of developers and testers required to carry out the test
  • Amount of time needed to set up and run the tests
  • Tools for the testing environment; Jest and Puppeteer are just two examples
  • System requirements for the tests, including limitations on older versions of software that the application does not support
  • A list of test cases based on the requirements analyzed in the previous testing stage

There are many more activities and considerations that could be part of a testing plan.

Testing life cycle step 3 - developing test cases

When your test plan and schedule are in place, it is time for the team to start developing detailed test cases. Developing a test case includes identifying the specific test data that it requires.

Test case development activities for our sample app could include:

  • Defining a successful log-in case, including the criteria and user credentials for it
  • Designing the failed log-in flow when no credentials are provided
  • Designing a failed log-in case when a user enters incomplete credentials, and determining what those credentials would be
  • Designing a failed log-in case when the user enters incorrect credentials, and determining what the credentials would be
  • Creating test cases and automation scripts

Of course, this is just a sample of the kinds of activities you could be completing in this phase of the testing life cycle.

Testing life cycle step 4 - setting up the test environment

So far, each stage of the testing life cycle has depended on the previous one. Luckily, this stage is one that can be completed at the same time as the test case development stage. After the testing environment requirements are determined and designed in the planning stage, you can start setting up the test environment.

The testing environment should simulate the conditions in which the software will run in production as closely as possible. Either a developer or tester can set up the testing environment; the testing team is not required here.

Some of the activities for setting up the testing environment are:

  • Setting up an operating system environment with the minimum requirements for use in production
  • Setting up the testing framework; for example Jest or Mocha
  • Setting up the test runner; something like Karma or Jest
  • Setting up an assertion library like Chai.js
  • Creating test data, mocked libraries, and assets
  • Installing supported browsers for browser testing

And, you guessed it, more.

Testing life cycle step 5 - test execution

With the test cases developed and the testing environment set up, testers can start executing test scripts. As the tests cases are executed, results are compiled and bugs are reported back to the testing team for documentation and test-case refinement.

Sometimes retesting is required. For example, the testing team might find some flaw in the design of one or more of the test cases, or someone could identify a need for additional test cases.

Testing life cycle step 6 - test closure

After executing tests, retesting if needed, identifying bugs, and documenting test results, it is time to wrap up the testing life cycle. In this stage, compile results into structured into reports for evaluation by stakeholders. Make sure the testing team meets to analyze test results and artifacts. Spend some time identifying improvements that can be made to the testing strategy. Use criteria like time, cost, test coverage, and alignment with business expectations to measure the success of this testing cycle.

The output of this stage is a detailed test closure report that includes meaningful, easy to understand test metrics. Use these metrics to determine the level of success achieved in this test cycle.

Conclusion

A thorough and professional test cycle is the best way to create a culture of quality for your team and build confidence in an application for your stakeholders. The careful exploration of errors to remove defects gives your team increased insight into how your application works, which can save time when developing the next version. It is impractical to find all errors in a program, so exhaustive, extensive testing is not the best goal. The aim of every tester and developer should be to find and fix the errors with most negative impact on the use and performance of the application.

Happy coding!


Fikayo Adepoju is a LinkedIn Learning (Lynda.com) Author, Full-stack developer, technical writer and tech content creator proficient in Web and Mobile technologies and DevOps with over 10 years experience developing scalable distributed applications. With over 40 articles written for CircleCI, Twilio, Auth0 and The New Stack blogs and also on his personal Medium page, he loves to share his knowledge to as many developers as would benefit from it. You can also check out his video courses on Udemy.