After the implementation phase, the testing phase begins. Testing of software is critical, since testing determines the correctness, completeness and quality of the software being developed. Its main objective is to detect errors in the software.
Errors prevent software from producing outputs according to user requirements. They occur if some part of the developed system is found to be incorrect, incomplete, or inconsistent. Errors can broadly be classified into three types, namely, requirements errors, design errors, and programming errors. To avoid these errors, it is necessary that: requirements are examined for conformance to user needs, software design is consistent with the requirements and notational convention, and the source code is examined for conformance to the requirements specification, design documentation and user expectations. All this can be accomplished through efficacious means of software testing.
The activities involved in testing phase basically evaluate the capability of the developed system and ensure that the system meets the desired requirements. It should be noted that testing is fruitful only if it is performed in the correct manner. Through effective software testing, the software can be examined for correctness, comprehensiveness, consistency and adherence to standards. This helps in delivering high-quality software products and lowering maintenance’ costs, thus leading to more contented users.
We’ll be covering the following topics in this tutorial:
Software Testing Basic
Software testing determines the correctness, completeness and quality of software being developed. IEEE defines testing as ‘the process of exercising or evaluating a system or system component by manual or automated means to verify that it satisfies specified requirements or to identify differences between expected and actual results.’
Software testing is closely related to the terms verification and validation. Verification refers to the process of ensuring that the software is developed according to its specifications. For verification, techniques like reviews, analysis, inspections and walkthroughs are commonly used. While validation refers to the process of checking that the developed software meets the requirements specified by the user. Verification and validation can be summarized thus as given here.
Verification: Is the software being developed in the right way?
Validation: Is the right software being developed?
Software testing is performed either manually or by using automated tools to make sure that the software is functioning in accordance with the user requirements. Various advantages associated with testing are listed below.
- It removes errors, which prevent software from producing outputs according to user requirements.
- It removes errors that lead to software failure.
- It ensures that the software conforms to business as well as user’s needs.
- It ensures that the software is developed according to user requirements.
- It improves the quality of the software by removing maximum possible errors from it.
Software testing comprises a set of activities, which are planned before testing begins. These activities are carried out for detecting errors that occur during various phases of SDLC. The role of testing in the software development life cycle is listed in Table.
Table Role of Testing in Various Phases of SDLC
Software Development Phase
1. To identify the test strategy.
2. To check the sufficiency of requirements.
3. To create functional test conditions.
4. To check the consistency of design with the requirements.
5. To check the sufficiency of design.
$16. To create structural and functional test conditions.
7. To check the consistency of implementation with the design.
8. To check the (sufficiency of implementation.
9. To create structural and functional test conditions for programs/units.
10. To check the sufficiency of the test plan.
11. To test the application programs.
Installation and maintenance
12. To put the tested system under operation.
13. To make changes· in the system and retest the modified system.
Software testing is aimed at identifying any bugs, errors, faults, or failures (if any) present in the software. Bug is defined as a logical mistake, which is caused by a software developer while writing the software code. Error is defined as the measure of deviation of the outputs given by the software from the outputs expected by the user. Fault is defined as the condition that leads to malfunctioning of the software. Malfunctioning of software is caused due to several reasons such as change in the design, architecture or software code. Defect that causes error in operation or negative impact is called failure. Failure is defined as that state of software under which it is unable to perform functions according to user requirements. Bugs, errors, faults and failures prevents the software from performing efficiently and hence cause the software to produce unexpected outputs. Errors can be present in the software due to the following reasons.
- Programming errors: Programmers can make mistakes while developing the source code.
- Unclear requirements: The user is not clear about the desired requirements or the developers are unable to understand the user requirements in a clear and concise manner.
- Software complexity: The greater the complexity of the software, the more the scope of committing an error (especially by an inexperienced developer).
- Changing requirements: The users usually keep on changing their requirements, and it becomes difficult to handle such changes in the later stage of development process. Therefore, there are chances of making mistakes while incorporating these changes in the software.
- Time pressures: Maintaining schedule of software projects is difficult. When deadlines are not met, the attempt to speed up the work causes errors.
- Poorly documented code: If the code is not well documented or well written, then maintaining and modifying it becomes difficult. This causes errors to occur.
Note: ‘error’ is used as a general term for ‘bugs’, ‘errors’, ‘faults’, and ‘failures’.
Testing is an organizational issue, which is performed either by the software developers (who originally developed the software) or by an independent test group (ITG), which comprises software testers. The software developers are considered to be the best persons to perform testing as they have the best knowledge about the software. However, since software developers are involved in the development process, they may have their own interest to show that the software is error-free, meets user requirements, and is within schedule and budget. This vested interest hinders the process of testing.
To avoid this problem, the task of testing is assigned to an Independent Test Group (ITG), which is responsible to detect errors that may have been neglected by the software developers. ITG tests the software without any discrimination since the group is not directly involved in the development process. However, the testing group does not completely take over the testing process, instead it works with the software developers in the software project to ensure that testing is performed in an efficient manner. During the testing process, developers are responsible for correcting the errors uncovered by the testing group.
Generally, an independent test group forms a part of the software development project team. This is because the group becomes involved during the specification activity and stays involved (planning and specifying test procedures) throughout the development process.
Various advantages and disadvantages associated with independent test group are listed in Table.
Table Advantages and Disadvantages of Independent Test Group
To plan and perform testing, software testers should have the knowledge about the function for which the software has been developed, the inputs and how they can be combined, and the environment in which the software will eventually operate. This process is time-consuming and requires technical sophistication and proper planning on the part of the testers. To achieve technical know-how, testers are required to possess strong development skills as well as knowledge of concepts like graph theory, algorithms, and formal languages. Other factors that should be kept in mind while performing testing are listed below.
- Time available to perform testing
- Training required acquainting testers about the software
- Attitude of testers
- Relationship between testers and developers.
Note: Along with software testers, customers, end-users, and management also play an important role in software testing.
Guidelines of Software Testing
There are certain rules and guidelines that are followed during software testing. These guidelines act as a standard to test the software and make testing more effective and efficient. The commonly used software testing guidelines are listed below.
- Define the expected output: When programs are executed during testing they mayor may not produce the expected outputs due to different types of errors present in the software. To avoid this, it is necessary to define the expected output before software testing begins. Without knowledge of the expected results, testers may fail to detect an erroneous output.
- Inspect output of each test completely: Software testing should be performed once the software is complete in order to check its performance and functionality along with the occurrence of errors in various phases of software development.
- Include test cases for invalid and unexpected conditions: Generally, software produces correct outputs when it is tested using accurate inputs. However, if unexpected input is given to the software, it may produce erroneous outputs. Hence, test cases that detect errors even when unexpected and incorrect inputs are specified should be developed.
- Test the modified program to check its expected performance: Sometimes, when certain modifications are made in the software (like adding of new functions) it is possible that the software produces unexpected outputs. Hence, it should be tested to verify that it performs in the expected manner even after modifications.
The ease with which a program is tested is known as testability. Testability should always be considered while signing and implementing a software system so that the errors (if any) in the system can be detected with minimum effort. There are several characteristics of testability, which are listed below.
- Easy to operate: High quality software can be tested in a better manner. This is because if the software is designed and implemented considering quality, then comparatively fewer errors will be detected during the execution of tests.
- Stability: Software becomes stable when changes made to the software are controlled and when the existing tests can still be performed.
- Observability: Testers can easily identify whether the output generated for certain input is accurate simply by observing it.
- Easy to understand: Software that is easy to understand can be tested in an efficient manner. Software can be properly understood by gathering maximum information about it. For example, to have a proper knowledge of the software, its documentation can be used, which provides complete information of the software code thereby increasing its clarity and making the testing easier.
- Decomposability: By breaking software into independent modules, problems can be easily isolated and the modules can be easily tested.
Characteristics of Software Test
There are several tests (such as unit and integration) used for testing the software. Each test has its own characteristics. The following points, however, should be noted.
- High probability of detecting errors: To detect maximum errors, the tester should understand the software thoroughly and try to find the possible ways in which the software can fail. For example, in a program to divide two numbers, the possible way in which the program can fail is when 2 and 0 are given as inputs and 2 is to be divided by 0. In this case, a set of tests should be developed that can demonstrate an error in the division operator.
- No redundancy: Resources and testing time are limited in software development process. Thus, it is not beneficial to develop several tests, which have the same intended purpose. Every test should have a distinct purpose.
- Choose the most appropriate test: There can be different tests that have the same intent but due to certain limitations such as time and resource constraint, only few of them are used. In such a case, the tests, which are likely to find more number of errors, should be considered.
- Moderate: A test is considered good if it is neither too simp1e, nor too complex. Many tests can be combined to form one test case. However this can increase the complexity and leave many errors undetected. Hence, all tests should be performed separately.