When working with an object-oriented system, object-oriented testing is preferred, conventional testing strategies may yield less desired results. Object-oriented testing revolves around the concept of classes. There are three main types of object-oriented testing: class testing, inter-class testing and system testing.
- Class testing: this type of tests include unit testing, which was already discussed in a previous blog. With class testing, every class is tested independently of others. If the class need certain types of input from another class, the input is generated by the tester and the output is verified. With class testing, you are sure that the tested lass is free of bugs and errors.
- Inter-class testing: with this type, various classes are joined into a module or sub-system. What’s being tested is the coordination between the classes in the module.
- System testing: the whole system is tested. Everything should work as expected. Things like performance, reliability and usability are also tested.
When working with and object-oriented program, you can take advantage of the many qualities that come with object-oriented programming. When working with a different paradigm, dividing the code into independent units may not be possible and other types of testing will be needed. I have used this before. Just testing a class without kinking it to another one to see if it works. You will need to generate the input yourself since there will be no class to generate it, but it can help identify in which class there’s an error if your program isn’t working.