Different Forms of Testing
Unit, Integration, Whitebox, Blackbox, GlassBox, System, Functional, Regression
What are all these forms of testing and what is required where??
Unit Testing
Unit testing (also known as
Whitebox or
Glassbox), involves:
- testing objects in isolation (i.e. without any database, container (Spring or J2EE), JNDI etc. They should generally use stubs or mock objects).
- Generally performed using JUnit.
- The idea is to directly test all the internal functionality of a class (ie. the tester which is generally the developer should know the internals of the class (hence the terms Glassbox or Whitebox) and uses the Unit test to ensure that the Class functions as designed).
- Unit test should be automated so that they can be run as part of a build.
Integration Testing
Integration Testing (also known as
Blackbox testing), involves:
- the developer testing the external interfaces of a Class (ie. they should not know about the internal workings),
- ensure that the Class works as intended (as per API/spec).
- Generally this may involve testing within a container (Spring or J2EE), database etc.
- Classes are instantiated as they would be in the real running system (ie perhaps through IOC) and their functionality tested that way.
- This may also include using UI type tests (Canoo, Selenium).
- Integration test should be automated so that they can be run as part of a build.
System / Functional testing
This is where an entire Function or part of a system is tested. This usually involves:
- using a "Tester" who tests the System or Function end-to-end often refering to the Use Cases and Functional Requirements (Business and System).
- Often a lot of these tests can also be automated using appropriate tools (Selenium, Mercury etc).
Regression Tests
Usually all the different forms of tests above fall under regression testing. The idea is that as functionality is added (or refactored), existing functionality continues to behave the same as before.
Unit/ and Integration tests are used at a development level to ensure as code is written it does not break the existing system. (Unit/Integration test should be run prior to checking in code into source control).
Existing System and Functional Tests are also re-run by the Testers to ensure that the software has not regressed b/w releases.