• Loading
    • Testing In Software Engineering

      Continued From.. Code Construction In Software Engineering

      Testing is an activity that is used to discover errors and correct them, so that we are able to create a defect-free product for our customer. Let us take the example of a house. The client had specified requirements of the house she wants. The tester tested the house to find out if all requirements of the client had been met after delivery. The tester created the test execution details document, which detailed the scenarios or test cases. The tester also created the results of the test execution, which are referred to as the test log.



      At the end of this session, you will be able to:
      • Learn about the testing stage and its process in software development
      • Explain the various types of testing
      • Study the important test case design methods
      Testing is an important stage which follows the Coding stage in the software development life cycle. The objective of testing is to evaluate if we have created the system correctly. During the earlier stages, the focus was to check what is being built but in testing when we have the end product ready, our focus shifts to validate whether the product that has been built has been built correctly or not. Hence, the focus shifts from building the product right to building the right product.


      Now, an attempt to define software testing is made. Testing is a systematic activity where records of test execution need to be maintained.


      Testing is the process of executing a program with the specific intent of finding an error. Success of a test is determined by the number of errors it has uncovered. Tests can be conducted by the developer or by an independent testing team. What one should remember is that the role of a good tester is to show the presence of the defects or errors of that software.


      This page explains the major activities and tasks of the testing stage. Creation of the test strategy is the first step. It is based on the Requirements Document, the Functional Specifications Document, and the Design Document. The test strategy describes the overall plan and approach to be taken for testing, the deliverables, and the process for test reporting. The next step is to create the test cases, containing the individual scenarios, which would be tested with their expected outcomes. Test cases are executed by the tester and results of the tests are documented in the test log. The defects of testing are recorded in defect-tracking tools such as the internal tool Prolite or the external tool called Test Director, depending on the requirement of a project. The owner of the application being tested then updates the application, closes the defects, and updates Prolite with the defect status in the tools. Re-testing may be conducted to verify closure of defects.


      In this page, you will know the people who are responsible for testing a software application:
      • Software testing can be conducted by the developers of the system or an independent testing group who are part of the organization that has built the system.
      • Software testing can also be conducted by the client or the ultimate users of the system.
      • The team responsible for the different types of testing needs to be decided upon during the planning stage.
      Here, you will learn about the various stages in testing: Software testing is usually performed at different levels of abstraction of the application along the software development process by the builders of the system. There are three testing stages: Unit testing, integration testing, and system testing. The objective and the abstraction levels of the application to which these tests are performed are different. Unit tests are performed on the smallest individual units of the application, the integration tests on a group of modules and their interfaces while the system tests are for the entire system and the interfacing external systems. In this illustration, you can see where the three major types of testing fit into the software development life cycle.

      There is one more stage in testing that is done by the end user of the system. This is referred to as the user acceptance test. This is to verify the functionality of the system from the end user's perspective. Here we can see where the user acceptance testing fits into the software development life cycle.

      You will now learn about each of the testing stages in detail. First you will know about unit testing. In this page, we see a small child building a doll house. She checks each building block to ensure that it is in line with the design of the doll house as she creates them. Similarly, unit testing concentrates on each unit or component of the software as implemented in the code and checks that it is in line with the program specification and the detailed design. The primary focus of unit testing is to validate the logic, the structure, and the flows of the concerned program. It is often performed by the software developer.



      Moving on to integration testing, you see that the builders of the doll house now begin to put the individually tested blocks of the house together, that is, they integrate the unit tested units. The primary intent is to uncover errors associated with interfaces when the unit-tested components are integrated as a module. The next page talks about system testing.

      After the doll house has been completed, it is checked fully by the builders of house to ensure that it is complete and ready for habitation. Additionally, builders check if the house is secure and can withstand rain or thunder or lightning and other environmental factors, so that it can easily be placed in its intended environment. System testing in software checks the performance and functionality of the complete system after all unit tested units have been integrated as per the build plan. It also evaluates functionality with interfacing systems. Non functional requirements like speed and reliability are also verified during system testing.

      Finally, looking at the acceptance testing, you see that the doll house has been placed in a children's park. The acceptance test verifies whether the system created is in conformance with user requirements when placed in its 'real' environment. Acceptance tests are often conducted by the client or by the end users. Developers are not often involved in this type of testing activity.

      Now, you will learn about an important concept of testing called regression testing. Regression testing will be done to ensure that the actions taken to rectify the defect have not produced any unexpected effects. Regression testing should be done at all levels of testing, such as unit, integration, system, and acceptance testing. The following page gives you an example that will help you learn the concept of regression testing.

      As seen in the previous example of a client stating her requirement for her house, it was observed by the tester that the location of the door was incorrect and a defect ID was allocated to it. When correcting this defect, the constructors may remove the door and move it to the rear side. In this process, other sections of the building may get damaged. So when correcting the defect of incorrect door location, care must be taken to ensure that unintended defects like cracks in the walls are not introduced in the building. Regression testing takes care of such unexpected issues that occur as a result of fixing defects.

      This page explains what the focus is for each type of testing:
      • Unit testing uses code and detailed design as an input to check correctness of individual units.
      • Integration testing uses the system design and the functional specification document as an input.
      • System testing uses the overall functionality of the system as given in the functional specifications and software requirements. It also evaluates the non- functional requirements.
      • Acceptance testing is the test conducted periodically by client representatives to check if client requirements have been met adequately.
      • Regression testing, on the other hand, retests the tested sections of the software to ensure no unintended error has been introduced.
      Here is another very important concept of software testing, that is, the test case. Test cases are scenarios that are executed by the testers on the completed application to determine if the application meets a specific requirement. One or more test cases may be required to determine if a requirement is satisfied.

      A good test case is one that uncovers errors in a complete manner with minimum time and effort. Considering the earlier example of the completed house, the analysis, 'check if the color of chimney is red' is a test case. If for the same example, when the test case is written as 'check if the door does not open with a wrong key', becomes a negative test case. Hence, we learn that a test case is a statement specifying an input, an action, or an event and expects a specific response after execution.

      This section explains the two approaches to test case design.
      The white box approach which is based on the internal workings of the system and black box or behavioral approach which deals with the external functionality of the application or its part being tested irrespective of the internal details. The following pages will give more details on these two types of approaches.
      The white box approach is used to create test cases to check if 'all gears mesh', that is, to check if the internal operations are performed according to specifications. This tests all the logical paths within the unit being tested and verifies if these are functioning as required in the design.

      Black box test case design approach does not consider the internal workings of the application. It focuses on the functional requirements alone, and it is designed to verify if the inputs are given correctly the output generated is also correct. It should be noted that black box testing and white box testing are not alternative approaches to test case design. On the other hand, they complement each other.

      Here are the activities performed in the testing stage for the SMARTBOOK System. The test scenarios or test cases are logged and tracked in a tool with the detailed information about the test case execution. Individual program units are tested as part of unit testing and the results are logged in the tool. Subsequently, each functional module is considered and integration tested for its functioning and logic. All interface-related tests between program units are covered under integration testing. The system testing follows where all the functional modules are taken together and the application is tested as a whole incorporating the interfacing issues between the functional modules. Finally, User Acceptance Testing is conducted by the users of the system and the resulting errors are corrected prior to staging the system into production.

      This page explains the salient points you should remember about testing. Test execution activity starts after code has been constructed with unit testing of individual modules. This will be followed by integration testing and system testing. However, it should be noted that test planning activity occurs much earlier in the software development life cycle. In fact, user acceptance test plans and cases are prepared along with the requirements document. To improve the quality of the code being delivered, it is a good practice to 'Test before you code'. The model shown is also called the V-Model where each stage is associated with the corresponding review and a specific test case is prepared for testing at a later stage.



      In this session, you have learned that:
      • Testing is an important stage within the software development life cycle.
      • The objective of a good test is to show the presence of errors and not the absence of them.
      • A good tester should attempt to break the system to uncover undiscovered errors.
      • The stages important in testing are unit testing, which targets a single module, integration testing targeting a group of modules, system testing that targets the whole system, and acceptance testing targeting the overall system and conducted by users.
      • There are two important approaches that are used to design test cases, namely, the black box approach focuses on the functional requirements of the software, and the white box approach focuses on internal workings of the software.
      ================================================== ======================

      Next Article:- Implementation And Post Implementation In Software Engineering



    Disclaimer: Users of techforum4u.com are responsible for ensuring that any material they post (article, blog posts, images or other mulitimedia content) does not violate or infringe upon the copyright, patent, trademark, or any personal or proprietary rights of any third party, and is posted with the permission of the owner of such rights.Anyone who violates these rules may have their access privileges removed without warning.