White and Black Box Testing
At a high level, you can break down testing into two significant categories: Black Box Testing and White Box Testing. The difference and importance of these two types of testing is something you must know when entering the QA field.
Quality is the ally of schedule and cost, not their adversary. If we have to sacrifice quality to meet schedule, it’s because we are doing the job wrong from the very beginning.- James A. Ward -
Black Box Testing
Black Box Testing, sometimes known as 'Functional Testing,' is when you run tests without knowing the internals. The Tester does not see the application's internal structure, design, and implementation. When testing, you are observing the behavior of the software. You are looking at it from the end-users perspective. This type of testing applies to almost every level of software testing: Unit, Integration, System, and Acceptance. Now that you have a general understanding of Black Box Testing let's look at some advantages and disadvantages of this approach.
- Very productive when testing large segments of code
- No need for access to the code
- Provides separation between user and developer perspectives
- Testing coverage can be limited
- Tests can become inefficient or not provide a good return on investment due to Tester's lack of knowledge about software internals
White Box Testing
White Box Testing, sometimes known as 'Clear' or 'Glass Box Testing,' is the opposite of Black Box Testing. In this approach, the Tester has access to the internals of the application codebase. They use this knowledge as part of the testing process. If, for example, an exception gets thrown under certain conditions, the test might want to reproduce those conditions. In White Box Testing, internal knowledge of the application is mandatory, along with some programming skills. As we did with Black Box Testing above, let's now look at some of the advantages and disadvantages of this approach.
- Efficient in finding errors and problems
- Provides means for more thorough testing
- Ability to spot stealthy errors
- Programmers introspection
- Optimize the codebase
- Higher test coverage
- Miss unimplemented or missing features
- Requires high-level knowledge of the internals of the application
- Requires code access
- You need to know the programming language of the application