Ensar Blog

SOFTWARE TESTING

Ensar Architecture Team

Software testing is the act of examining the behavior of the software under test by validation and verification. It can be stated as the process of verifying and validating whether a software or application is bug-free, meets the technical requirements as guided by its design and development, and meets the user requirements effectively and efficiently by handling all the exceptional and boundary cases.

The process of software testing aims not only at finding faults in the existing software but also at finding measures to improve the software in terms of efficiency, accuracy, and usability. It mainly aims at measuring the specification, functionality, and performance of a software program or application.

There are seven principles in software testing:

  • Testing shows the presence of defects

  • Exhaustive testing is not possible

  • Early testing

  • Defect clustering

  • Pesticide paradox

  • Testing is context-dependent

  • Absence of errors fallacy

Testing shows the presence of defects

The goal of software testing is to make the software fail. Software testing reduces the presence of defects. Software testing talks about the presence of defects and doesn’t talk about the absence of defects. Software testing can ensure that defects are present but it cannot prove that software is defect-free. Even multiple testing can never ensure that software is 100% bug-free. Testing can reduce the number of defects but not remove all defects.

Exhaustive testing is not possible

It is the process of testing the functionality of the software in all possible inputs (valid or invalid) and pre-conditions is known as exhaustive testing. Exhaustive testing is impossible means the software can never test at every test case. It can test only some test cases and assume that the software is correct, and it will produce the correct output in every test case. If the software will test every test case, then it will take more cost, effort, etc., which is impractical.

Early Testing

To find the defect in the software, early test activity shall be started. The defect detected in the early phases of SDLC will be very less expensive. For better performance of software, software testing will start at the initial phase i.e. testing will perform at the requirement analysis phase.

Defect clustering

In a project, a small number of modules can contain most of the defects. Pareto Principle to software testing state that 80% of software defect comes from 20% of modules.

Pesticide paradox

Repeating the same test cases, again and again, will not find new bugs. So it is necessary to review the test cases and add or update test cases to find new bugs.

Testing is context-dependent

The testing approach depends on the context of the software developed. Different types of software need to perform different types of testing. For example, The testing of the e-commerce site is different from the testing of the Android application.

Absence of errors fallacy

If a built software is 99% bug-free but it does not follow the user requirement then it is unusable. It is not only necessary that software is 99% bug-free but it is also mandatory to fulfill all the customer requirements.

There are certain testing guidelines that should be followed while testing the software:

Development team should avoid testing the software: Testing should always be performed by the testing team. The developer team should never test the software themselves. This is because after spending several hours building the software, it might unconsciously become too proprietorial and that might prevent seeing any flaws in the system. The testers should have a destructive approach towards the product. Developers can perform unit testing and integration testing, but software testing should be done by the testing team.

Software can never be 100% bug-free: Testing can never prove the software to 100% bug-free. In other words, there is no way to prove that the software is free of errors even after making several test cases.

Software can never be 100% bug-free

Testing can never prove the software to 100% bug-free. In other words, there is no way to prove that the software is free of errors even after making several test cases.

Prioritize sections:

If there are certain critical sections, then it should be ensured that these sections are tested with the highest priority and as early as possible.

The time available is limited:

Testing time for software is limited. It must be kept in mind that the time available for testing is not unlimited and that an effective test plan is very crucial before starting the process of testing. There should be some criteria to decide when to terminate the process of testing. This criterion needs to be decided beforehand. For instance, when the system is left with an acceptable level of risk or according to timelines or budget constraints.

Testing must be done with unexpected and negative inputs:

Testing should be done with correct data and test cases as well as with flawed test cases to make sure the system is leak proof. Test cases must be well documented to ensure future reuse for testing at later stages. This means that the test cases must be enlisted with proper definitions and descriptions of inputs passed and respective outputs expected. Testing should be done for functional as well as the non-functional requirements of the software product.

Inspecting test results properly:

Quantitative assessment of tests and their results must be done. The documentation should be referred to properly while validating the results of the test cases to ensure proper testing. Testing must be supported by automated tools and techniques as much as possible. Besides ensuring that the system does what all it is supposed to do, testers also need to ensure that the system does not perform operations which it isn’t supposed to do.

Validating assumptions:

The test cases should never be developed based on assumptions or hypothesis. They must always be validated properly. For instance, assuming that the software product is free from any bugs while designing test cases may result in extremely weak test cases.

Software Development Life Cycle (SDLC)

SDLC is a process that creates a structure of development of software. There are different phases within SDLC, and each phase has its various activities. It makes the development team able to design, create, and deliver a high-quality product.

SDLC describes various phases of software development and the order of execution of phases. Each phase requires deliverable from the previous phase in a life cycle of software development. Requirements are translated into design, design into development and development into testing; after testing, it is given to the client.

Software Dev Life cycle
Requirement Phase

This is the most crucial phase of the software development life cycle for the developing team as well as for the project manager. During this phase, the client states requirements, specifications, expectations, and any other special requirement related to the product or software. All these are gathered by the business manager or project manager or analyst of the service providing company.

The requirement includes how the product will be used and who will use the product to determine the load of operations. All information gathered from this phase is critical to developing the product as per the customer requirements.

Design Phase

The design phase includes a detailed analysis of new software according to the requirement phase. This is the high priority phase in the development life cycle of a system because the logical designing of the system is converted into physical designing. The output of the requirement phase is a collection of things that are required, and the design phase gives the way to accomplish these requirements. The decision of all required essential tools such as programming language like Java, .NET, PHP, a database like Oracle, MySQL, a combination of hardware and software to provide a platform on which software can run without any problem is taken in this phase.

There are several techniques and tools, such as data flow diagrams, flowcharts, decision tables, and decision trees, Data dictionary, and the structured dictionary are used for describing the system design.

Build /Development Phase

After the successful completion of the requirement and design phase, the next step is to implement the design into the development of a software system. In this phase, work is divided into small units, and coding starts by the team of developers according to the design discussed in the previous phase and according to the requirements of the client discussed in requirement phase to produce the desired result.

Front-end developers develop easy and attractive GUI and necessary interfaces to interact with back-end operations and back-end developers do back-end coding according to the required operations. All is done according to the procedure and guidelines demonstrated by the project manager.

Since this is the coding phase, it takes the longest time and more focused approach for the developer in the software development life cycle.

Testing Phase

Testing is the last step of completing a software system. In this phase, after getting the developed GUI and back-end combination, it is tested against the requirements stated in the requirement phase. Testing determines whether the software is actually giving the result as per the requirements addressed in the requirement phase or not. The Development team makes a test plan to start the test. This test plan includes all types of essential testing such as integration testing, unit testing, acceptance testing, and system testing. Non-functional testing is also done in this phase.

If there are any defects in the software or it is not working as per expectations, then the testing team gives information to the development team in detail about the issue. If it is a valid defect or worth to sort out, it will be fixed, and the development team replaces it with the new one, and it also needs to be verified.

Deployment/ Deliver Phase

When software testing is completed with a satisfying result, and there are no remaining issues in the working of the software, it is delivered to the customer for their use.

As soon as customers receive the product, they are recommended first to do the beta testing. In beta testing, customer can require any changes which are not present in the software but mentioned in the requirement document or any other GUI changes to make it more user-friendly. Besides this, if any type of defect is encountered while a customer using the software; it will be informed to the development team of that software to sort out the problem. If it is a severe issue, then the development team solves it in a short time; otherwise, if it is less severe, then it will wait for the next version. After the solution of all types of bugs and changes, the software finally deployed to the end-user.

Maintenance

The maintenance phase is the last and long-lasting phase of SDLC because it is the process which continues until the software's life cycle comes to an end. When a customer starts using software, then actual problems start to occur, and at that time there's a need to solve these problems. This phase also includes making changes in hardware and software to maintain its operational effectiveness like to improve its performance, enhance security features and according to customer's requirements with upcoming time. This process to take care of product time to time is called maintenance.

So, all these are six phases of software development life cycle (SDLC) under which the process of development of software takes place. All are compulsory phases without any one of the developments cannot be possible because development continues for the lifetime of software with maintenance phase.

Software Development Life Cycle (SDLC) Models

The software development models are those several process or approaches which are being selected for the development of project based on the project's objectives. To accomplish various purposes, we have many development life cycle models. And these models identify the multiple phases of the process. Picking up the correct model for developing the software application is very important because it will explain what, where, and when of our planned testing.

Software Dev Models
Waterfall Model

It is the first sequential-linear model because the output of the one stage is the input of the next stage. It is simple and easy to understand, which is used for a small project. The various phases of the waterfall model are as follows:

  • Requirement analysis

  • Feasibility study

  • Design

  • Coding

  • Testing

  • Installation

  • Maintenance

Spiral Model

It is the best suites model for a medium level project. It is also called the Cyclic and Iteration model. Whenever the modules are dependent on each other, we go for this model. And here, we develop application model wise and then handed over to the customer. The different stages of the spiral model are as follows:

  • Requirement collection

  • Design

  • Coding

  • Testing

Prototype Model

From the time when customer rejection was more in the earlier model, we go for this model as customer rejection is less. And, it allows us to prepare a sample (prototype) in the early stage of the process, which we can show to the client and get their approval and start working on the original project. This model refers to the action of creating the prototype of the application.

Verification & Validation Model

It is an extended version of the waterfall model. It will implement in two phases wherein the first phase, we will perform the verification process, and when the application is ready, we will perform the validation process. In this model, the implementation happens in the V shape, which means that the verification process done under downward flow and the validation process complete in the upward flow.

Hybrid Model

The hybrid model is used when we need to acquire the properties of two models in the single model. This model is suitable for small, medium, and large projects because it is easy to apply, understand.

Software Testing Life Cycle (STLC)

The procedure of software testing is also known as STLC (Software Testing Life Cycle) which includes phases of the testing process.The testing process is executed in a well-planned and systematic manner. All activities are done to improve the quality of the software product. Let's see, the different steps of STLC.

Software testing life cycle contains the following steps:

STLC Phases
Requirement Analysis:

The first step of the manual testing procedure is requirement analysis. In this phase, tester analyses requirement document of SDLC (Software Development Life Cycle) to examine requirements stated by the client. After examining the requirements, the tester makes a test plan to check whether the software is meeting the requirements or not.

Test Plan Creation:

Test plan creation is the crucial phase of STLC where all the testing strategies are defined. Tester determines the estimated effort and cost of the entire project. This phase takes place after the successful completion of the Requirement Analysis Phase. Testing strategy and effort estimation documents provided by this phase. Test case execution can be started after the successful completion of Test Plan Creation.

Environment setup:

Setup of the test environment is an independent activity and can be started along with Test Case Development. This is an essential part of the manual testing procedure as without environment testing is not possible. Environment setup requires a group of essential software and hardware to create a test environment. The testing team is not involved in setting up the testing environment, its senior developers who create it.

Test case Execution:

Test case Execution takes place after the successful completion of test planning. In this phase, the testing team starts case development and execution activity. The testing team writes down the detailed test cases, also prepares the test data if required. The prepared test cases are reviewed by peer members of the team or Quality Assurance leader.

RTM (Requirement Traceability Matrix) is also prepared in this phase. Requirement Traceability Matrix is industry level format, used for tracking requirements. Each test case is mapped with the requirement specification. Backward & forward traceability can be done via RTM.

Defect Logging:

Testers and developers evaluate the completion criteria of the software based on test coverage, quality, time consumption, cost, and critical business objectives. This phase determines the characteristics and drawbacks of the software. Test cases and bug reports are analyzed in depth to detect the type of defect and its severity.

Defect logging analysis mainly works to find out defect distribution depending upon severity and types. If any defect is detected, then the software is returned to the development team to fix the defect, then the software is re-tested on all aspects of the testing. Once the test cycle is fully completed then test closure report, and test metrics are prepared.

Test Cycle Closure:

The test cycle closure report includes all the documentation related to software design, development, testing results, and defect reports.

This phase evaluates the strategy of development, testing procedure, possible defects to use these practices in the future if there is a software with the same specification.

Types

Software Testing can be broadly classified into two types:

1. Manual Testing:

Manual testing includes testing software manually, i.e., without using any automation tool or any script. In this type, the tester takes over the role of an end-user and tests the software to identify any unexpected behavior or bug. There are different stages for manual testing such as unit testing, integration testing, system testing, and user acceptance testing. Testers use test plans, test cases, or test scenarios to test software to ensure the completeness of testing. Manual testing also includes exploratory testing, as testers explore the software to identify errors in it.

2. Automation Testing:

Automation testing, which is also known as Test Automation, is when the tester writes scripts and uses another software to test the product. This process involves the automation of a manual process. Automation Testing is used to re-run the test scenarios quickly and repeatedly, that were performed manually in manual testing. Apart from regression testing, automation testing is also used to test the application from a load, performance, and stress point of view. It increases the test coverage, improves accuracy, and saves time and money when compared to manual testing.

TECHNIQUES

Software testing techniques can be majorly classified into two categories:

Testing Techniques
Black Box Testing:

The technique of testing in which the tester doesn’t have access to the source code of the software and is conducted at the software interface without any concern with the internal logical structure of the software is known as black-box testing.

White Box Testing:

The technique of testing in which the tester is aware of the internal workings of the product, has access to its source code, and is conducted by making sure that all internal operations are performed according to the specifications is known as white box testing.

FUNCTIONAL TESTING:

It is a type of software testing which is used to verify the functionality of the software application, whether the function is working according to the requirement specification. In functional testing, each function tested by giving the value, determining the output, and verifying the actual output with the expected value. Functional testing performed as black box testing which is presented to confirm that the functionality of an application or system behaves as we are expecting. It is done to verify the functionality of the application.

Functional testing also called as black-box testing, because it focuses on application specification rather than actual code. Tester must test only the program rather than the system.

The purpose of the functional testing is to check the primary entry function, necessarily usable function, the flow of screen GUI. Functional testing displays the error message so that the user can easily navigate throughout the application.

  1. Tester does verification of the requirement specification in the software application.

  2. After analysis, the requirement specification tester will plan.

  3. After planning the tests, the tester will design the test case.

  4. After designing the test, case tester will make a document of the traceability matrix.

  5. The tester will execute the test case design.

  6. Analysis of the coverage to examine the covered testing area of the application.

  7. Defect management should do to manage defect resolving.

Functional testing

The main objective of functional testing is checking the functionality of the software system. It concentrates on:

Basic Usability:

Functional Testing involves the usability testing of the system. It checks whether a user can navigate freely without any difficulty through screens.

Accessibility:

Functional testing test the accessibility of the function.

Mainline function:

It focuses on testing the main feature.

Error Condition:

Functional testing is used to check the error condition. It checks whether the error message displayed.

There are the following steps to perform functional testing:

Functional testing process

The main objective of functional testing is to test the functionality of the component.Functional testing is divided into multiple parts. Here are the following types of functional testing.

Functional testing types
Unit Testing:

Unit testing is a type of software testing, where the individual unit or component of the software tested. Unit testing, examine the different part of the application, by unit testing functional testing also done, because unit testing ensures each module is working correctly. The developer does unit testing. Unit testing is done in the development phase of the application.

Smoke Testing:

Functional testing by smoke testing. Smoke testing includes only the basic (feature) functionality of the system. Smoke testing is known as "Build Verification Testing". Smoke testing aims to ensure that the most important function work.

For example, Smoke testing verifies that the application launches successfully will check that GUI is responsive.

Sanity Testing:

Sanity testing involves the entire high-level business scenario is working correctly. Sanity testing is done to check the functionality/bugs fixed. Sanity testing is little advance than smoke testing.

For example, login is working fine; all the buttons are working correctly; after clicking on the button navigation of the page is done or not.

Regression Testing:

This type of testing concentrates to make sure that the code changes should not side effect the existing functionality of the system. Regression testing specifies when bug arises in the system after fixing the bug, regression testing concentrate on that all parts are working or not. Regression testing focuses on is there any impact on the system.

Integration Testing:

Integration testing combined individual units and tested as a group. The purpose of this testing is to expose the faults in the interaction between the integrated units. Developers and testers perform integration testing.

Usability Testing

Usability testing refers to evaluating a product or service by testing it with representative users. Typically, during a test, participants will try to complete typical tasks while observers watch, listen and takes notes. The goal is to identify any usability problems, collect qualitative and quantitative data and determine the participant's satisfaction with the product.

Advantages of functional testing are:
  1. It produces a defect-free product.

  2. It ensures that the customer is satisfied.

  3. It ensures that all requirements met.

  4. It ensures the proper working of all the functionality of an application/software/product.

  5. It ensures that the software/ product work as expected.

  6. It ensures security and safety.

  7. It improves the quality of the product.

Example:

Here, we are giving an example of banking software. In a bank when money transferred from bank A to bank B. And the bank B does not receive the correct amount, the fee is applied, or the money not converted into the correct currency, or incorrect transfer or bank A does not receive statement advice from bank B that the payment has received. These issues are critical and can be avoided by proper functional testing.

Disadvantages of functional testing are:
  1. Functional testing can miss a critical and logical error in the system.

  2. This testing is not a guarantee of the software to go live.

  3. The possibility of conducting redundant testing is high in functional testing.

The functional testing can also be executed by various apart from manual testing. These tools simplify the process of testing and help to get accurate and useful results. It is one of the significant and top priority-based techniques which were decided and specified before the development process.

Software level testing

Software level testing can be majorly classified into 4 levels:

Level Testing
1. Unit Testing:

A level of the software testing process where individual units/components of a software/system are tested. The purpose is to validate that each unit of the software performs as designed.

2. Integration Testing:

A level of the software testing process where individual units are combined and tested as a group. The purpose of this level of testing is to expose faults in the interaction between integrated units.

3. System Testing:

A level of the software testing process where a complete, integrated system/software is tested. The purpose of this test is to evaluate the system’s compliance with the specified requirements.

4. Acceptance Testing:

A level of the software testing process where a system is tested for acceptability. The purpose of this test is to evaluate the system’s compliance with the business requirements and assess whether it is acceptable for delivery.

NON – FUNCTIONAL TESTING:

Non-functional testing is a type of software testing to test non-functional parameters such as reliability, load test, performance and accountability of the software. The primary purpose of non-functional testing is to test the reading speed of the software system as per non-functional parameters. The parameters of non-functional testing are never tested before the functional testing. Non-functional testing is also very important as functional testing because it plays a crucial role in customer satisfaction. For example, non-functional testing would be to test how many people can work simultaneously on any software.

Functional and Non-functional testing both are mandatory for newly developed software. Functional testing checks the correctness of internal functions while Non-Functional testing checks the ability to work in an external environment.

It sets the way for software installation, setup, and execution. The measurement and metrics used for internal research and development are collected and produced under non-functional testing.

Non-functional testing gives detailed knowledge of product behavior and used technologies. It helps in reducing the risk of production and associated costs of the software.

Parameters to be tested under Non-Functional Testing

Non-Functional testing
Performance Testing

Performance Testing eliminates the reason behind the slow and limited performance of the software. Reading speed of the software should be as fast as possible.

For Performance Testing, a well-structured and clear specification about expected speed must be defined. Otherwise, the outcome of the test (Success or Failure) will not be obvious.

Load Testing

Load testing involves testing the system's loading capacity. Loading capacity means more and more people can work on the system simultaneously.

Security Testing

Security testing is used to detect the security flaws of the software application. The testing is done via investigating system architecture and the mindset of an attacker. Test cases are conducted by finding areas of code where an attack is most likely to happen.

Portability Testing

The portability testing of the software is used to verify whether the system can run on different operating systems without occurring any bug. This test also tests the working of software when there is a same operating system but different hardware.

Accountability Testing

Accountability test is done to check whether the system is operating correctly or not. A function should give the same result for which it has been created. If the system gives expected output, it gets passed in the test otherwise failed.

Reliability Testing

Reliability test assumes that whether the software system is running without fail under specified conditions or not. The system must be run for a specific time and number of processes. If the system is failed under these specified conditions, reliability test will be failed.

Flexibility Testing

Understanding the boundaries and making them more flexible allows system to adapt to new conditions without affecting an ability to provide a digital product of top-notch quality

Efficiency Testing

Efficiency test examines the number of resources needed to develop a software system, and how many of these were used. It also includes the test of these three points.

  1. Customer's requirements must be satisfied by the software system.

  2. A software system should achieve customer specifications.

  3. Enough efforts should be made to develop a software system.

Advantages of Non-functional testing

The following list are the Advantages of Non-functional testing.

  1. It provides a higher level of security. Security is a fundamental feature due to which system is protected from cyber-attacks.

  2. It ensures the loading capability of the system so that any number of users can use it simultaneously.

  3. It improves the performance of the system.

  4. Test cases are never changed so do not need to write them more than once.

  5. Overall time consumption is less as compared to other testing processes.

Disadvantages of Non-Functional Testing

These are the Disadvantages of Non-functional testing.

  1. Every time the software is updated, non-functional tests are performed again.

  2. Due to software updates, people must pay to re-examine the software; thus, software becomes very expensive.