Software Testing

Software Testing

Software testing is a comprehensive process that involves evaluating a software application or system to ensure it meets specified requirements and functions correctly. It's a critical phase of the software development lifecycle (SDLC) that helps identify defects, errors, or bugs before the software is released to end-users.

Testing is intended to show that a program does what it is intended to do and to discover program defects before it is put into use. When you test software, you run the program using fake or simulated information. Then, you carefully look at the results of this test to see if there are any mistakes, or weird things happening, or if the program isn't working as it should in some aspects.

There are two main reasons for doing this testing:

To Show It Works Right: First, we want to prove to the person who made the software (the developer) and the person who wants to use it (the customer) that the software does what it's supposed to do. If the software was made specifically for someone, like a custom-made tool, then there should be a test for each thing the software is supposed to do, as written down in a document called the requirements.

If it's a software product that lots of people will use, like an app, then there should be tests for every feature it has, and also for different combinations of these features that will be in the final product.

To Find Mistakes: The second reason is to catch any situations where the software doesn't behave the way it should. These mistakes are called defects, and finding them is called defect testing. It's all about spotting when the software does something wrong, like crashing unexpectedly, not working well with other programs, doing math incorrectly, or messing up data.

So, in simple terms, software testing is like giving the software a test to see if it works correctly and if it doesn't, figuring out what's wrong with it so it can be fixed.

While validation testing seeks to confirm that the system behaves as expected, defect testing aims to identify flaws or errors in the system's behaviour. However, it's essential to recognize that testing cannot guarantee the absence of defects entirely. As Edsger Dijkstra famously stated, "Testing can only show the presence of errors, not their absence."

Moreover, software testing is just one component of a broader process known as verification and validation (V&V). Barry Boehm, a pioneer of software engineering, succinctly expressed the difference between them (Boehm, 1979):

‘Validation: Are we building the right product?’

‘Verification: Are we building the product right?’

Verification and validation processes ensure that the software being developed meets its specifications and satisfies the expectations of the stakeholders. Verification focuses on confirming that the software meets its functional and non-functional requirements, while validation ensures that it meets the customer's expectations and goes beyond just conforming to specifications.

Since requirements specifications may not always accurately represent the users' true needs, validation becomes crucial. Ultimately, the goal of verification and validation is to establish confidence that the software is "fit for purpose," meaning it's suitable for its intended use. The level of confidence required depends on factors such as the system's purpose, user expectations, and the current market environment. Now let us learn about these in detail-

  1. Software purpose: The more critical the software, the more important that it is reliable. For example, the level of confidence required for software used to control a safety-critical system is much higher than that required for a prototype that has been developed to demonstrate new product ideas.

  2. User expectations: Because of their experiences with buggy, unreliable software, many users have low expectations of software quality. They are not surprised when their software fails. When a new system is installed, users may tolerate failures because the benefits of use outweigh the costs of failure recovery. In these situations, you may not need to devote as much time to testing the software. However, as software matures, users expect it to become more reliable so more thorough testing of later versions may be required.

  3. Marketing environment: When a system is marketed, the sellers of the system must take into account competing products, the price that customers are willing to pay for a system, and the required schedule for delivering that system. In a competitive environment, a software company may decide to release a program before it has been fully tested and debugged because it wants to be the first in the market. If a software product is very cheap, users may be willing to tolerate a lower level of reliability.

Inspections mostly focus on the source code of a system but any readable representation of the software, such as its requirements or a design model, can be inspected.

Figure-

  1. Requirements Specification: This is the initial stage where the requirements for the software system are gathered, documented, and analyzed. It involves understanding the needs and expectations of the stakeholders.

  2. Software Architecture: Once the requirements are clear, the software architecture is designed. This involves defining the overall structure of the software system, including components, modules, and their interactions.

  3. UML Design Models: In this step, Unified Modeling Language (UML) diagrams are created to visually represent the software architecture and design. UML diagrams can include various types such as class diagrams, sequence diagrams, and activity diagrams.

  4. Database Schemas: Database schemas are designed to define the structure, organization, and relationships of the data that will be stored in the software system's database. This step ensures that the database can efficiently store and retrieve data as required by the system.

  5. Program: Once the design and architecture are finalized, the actual coding or programming of the software system takes place. Programmers write code according to the specifications and design provided in earlier stages.

  6. System Prototype: After the initial programming phase, a prototype or early version of the software system is developed. This prototype is used to demonstrate key features and functionalities to stakeholders for feedback and validation.

  7. Testing: Finally, the software system undergoes testing to ensure that it meets the specified requirements and functions correctly. Testing involves various techniques such as unit testing, integration testing, and acceptance testing to identify and fix defects or bugs in the system.

By following these steps, you can ensure a systematic approach to developing and testing software systems, ultimately leading to a successful and reliable product.

When you inspect a system, you use knowledge of the system, its application domain, and programming or modelling language to discover errors. There are three advantages of software inspection over testing:

During testing, errors can mask (hide) other errors. When an error leads to unexpected outputs, you can never be sure if later output anomalies are due to a new error or are side effects of the original error. Because inspection is a static process, you don’t have to be concerned with interactions between errors. Consequently, a single inspection session can discover many errors in a system.

Incomplete versions of a system can be inspected without additional costs. If a program is incomplete, then you need to develop specialized test harnesses to test the available parts. This adds to the system development costs.

As well as searching for program defects, an inspection can also consider broader quality attributes of a program, such as compliance with standards, portability, and maintainability. You can look for inefficiencies, inappropriate algorithms, and poor programming style that could make the system difficult to maintain and update.

Typically, a commercial software system has to go through three stages of testing:

  1. Development testing:- where the system is tested during development to discover bugs and defects. System designers and programmers are likely to be involved in the testing process.

  2. Release testing:- where a separate testing team tests a complete version of the system before it is released to users. Release testing aims to check that the system meets the requirements of system stakeholders.

  3. User testing:- where users or potential users of a system test the system in their environment. For software products, the ‘user’ may be an internal marketing group that decides if the software can be marketed, released, and sold. Acceptance testing is one type of user testing where the customer formally tests a system to decide if it should be accepted by the system supplier or if further development is required.

Now let us understand each of them in detail in our coming blogs.