About Black-Box Testing
Black-box (functionality) testing checks a class's functionality by determining whether or not the class's public interface performs according to specification. This type of testing is performed without paying attention to implementation details.
If your class contains Design by Contract-format specification information, Jtest completely automates the black-box testing process. If not, Jtest makes the black-box testing process significantly easier and more effective than it would be if you were creating test cases by hand.
Jtest reads specification information built into the class with the DbC language, then automatically develops test cases based on this specification. Jtest designs its black-box test cases as follows:
- If the code has postconditions, Jtest creates test cases that verify whether the code satisfies those conditions.
- If the code has assertions, Jtest creates test cases that try to make the assertions fail.
- If the code has invariant conditions (conditions that apply to all of a class's methods), Jtest creates test cases that try to make the invariant conditions fail.
- If the code has preconditions, Jtest tries to find inputs that force all of the paths in the preconditions.
- If the method under test calls other methods that have specified preconditions, Jtest determines if the method under test can pass non-permissible values to the other methods.
Jtest also helps you create black-box test cases if you do not use Design by Contract. You can use Jtest's automatically-generated set of test cases as the foundation for your black-box test suite, then extend it by adding your own test cases.
Test cases can be added in a variety of ways; for example, test cases can be introduced by adding:
- Method inputs directly to a tree node representing each method argument.
- Constants and methods to global or local repositories, then adding them to any method argument.
- JUnit-format Test Classes for test cases that are too complex or difficult to be added as method inputs.
If a class references external resources, you can enter your own stubs or have Jtest call the actual external method.
When the test is run, Jtest uses any available stubs, automatically executes the inputs, and displays the outcomes for those inputs in a simple tree representation. You can then view the outcomes and verify them with the click of a button. Jtest automatically notifies you when specification and regression testing errors occur on subsequent tests of this class.
Related Topics
Performing Black-Box Testing
Adding Method Inputs
Adding Test Classes
Specifying Imports
|