Software testing is important enough to have its own phase in the software development life cycle (SDLC). The software testing life cycle (STLC) is a step-by-step process that improves the quality of software by applying rigorous planning and analysis to the testing process.

Testing is a development tool that adds value to your development 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. In this post, I will lead you through the stages of the software testing life cycle by describing each step and how it can help your team properly test software throughout the development lifecycle.

Prerequisites

When creating this tutorial, 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 critical for success of software applications

Our tutorials are platform-agnostic, but use CircleCI as an example. If you don’t have a CircleCI account, sign up for a free one here.

Using a sample application as a testing case study

To help you understand the activities that make up each stage of testing, I have created a sample application. I will guide you through the steps for each phase 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, start by using the 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 you have selected the functionality you want to test, start applying the STLC to your application. There are six stages in the software testing life cycle:

  1. Requirement analysis
  2. Planning the tests
  3. Developing test cases
  4. Setting up the test environment
  5. Test execution
  6. Test closure

In this tutorial, I will explain how to test your log-in flow by following these six steps.

Software testing life cycle stage 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 setup you will use and whether you can automate testing.

For the application 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. Your team should have a detailed requirements document at the end of this phase.

Software testing life cycle stage 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 the sample application could include:

  • 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.

Software testing life cycle stage 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 the 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.

Software testing life cycle stage 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 designed, 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.

Software testing life cycle stage 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.

Software testing life cycle stage 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 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 software testing life cycle is the best way to create a culture of quality for your team. As a bonus, this “quality culture” will start to build confidence in your software applications 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.

Read more posts by Fikayo Adepoju