Showing posts with label Structural Testing. Show all posts
Showing posts with label Structural Testing. Show all posts

Monday, July 2, 2012

Unit Testing and Integration Testing.

Unit Testing
  • Testing of individual software components or modules. 
  • Typically done by the programmer and not by testers, as it requires detailed knowledge of the internal program design and code. may require developing test driver modules or test harnesses.
  • The goal of unit testing is to isolate each part of the program and show that the individual parts are correct.
  • A unit test provides a strict, written contract that the piece of code must satisfy. 
  • As a result, it affords several benefits.
Integration testing
  • Integration testing  is the phase in software testing in which individual software modules are combined and tested as a group.
  • It occurs after unit testing and before validation testing. 
  • Integration testing takes as its input modules that have been unit tested, groups them in larger aggregates, applies tests defined in an integration test plan to those aggregates, and delivers as its output the integrated system ready for system testing.
  • Some different types of integration testing are Top Down Testing and Bottom Up Testing.
Top Down Testing
  • Top Down Testing is an approach to integrated testing where the top integrated modules are tested and the branch of the module is tested step by step until the end of the related module.
Bottom Up Testing
  • Bottom Up Testing is an approach to integrated testing where the lowest level components are tested first, then used to facilitate the testing of higher level components. The process is repeated until the component at the top of the hierarchy is tested.

    What is Structural Testing?

    • White-box testing (also known as clear box testing, glass box testing, transparent box testing, and structural testing) is a method of testing software that tests internal structures or workings of an application, as opposed to its functionality (i.e. black-box testing). 
    • In white-box testing an internal perspective of the system, as well as programming skills, are used to design test cases. 
    • The tester chooses inputs to exercise paths through the code and determine the appropriate outputs.
    • White-box test design techniques include, control flow testing, data flow testing, branch testing, path testing, statement coverage and decision coverage.

    Black Box Testing and White Box Testing.

    Black Box Testing
    • Black Box Testing is testing without knowledge of the internal workings of the item being tested.
    • For Example: when black box testing is applied to software engineering, the tester would only know the "legal" inputs and what the expected outputs should be, but not how the program actually arrives at those outputs.
    Advantages of Black Box Testing
    • more effective on larger units of code than glass box testing.
    • tester needs no knowledge of implementation, including specific programming languages.
    • tester and programmer are independent of each other.tests are done from a user's point of view.
    • will help to expose any ambiguities or inconsistencies in the specifications.
    • test cases can be designed as soon as the specifications are complete
    White Box Testing
    • White box testing strategy deals with the internal logic and structure of the code.
    • White box testing is also called as glass, structural, open box or clear box testing.
    • The tests written based on the white box testing strategy incorporate coverage of the code written, branches, paths, statements and internal logic of the code etc.
    Advantages of White Box Testing
    • White Box Testing are tests that are run an application with the knowledge.
    • White box testing is testing from the inside--tests that go in and test the actual program structure.
    • As the knowledge of internal coding structure is prerequisite, it becomes very easy to find out which type of input/data can help in testing the application effectively.
    • The other advantage of white box testing is that it helps in optimizing the code.
    • It helps in removing the extra lines of code, which can bring in hidden defects.