Some Facts About Class Testing

Some Facts About Class Testing
February 13 10:00 2013 Print This Article

When performing any type of testing (mobile testing, web site testing, software testing, etc.) testers should deal with testing of classes. Class is a construct in object-oriented programming that enables you to create your own custom types by grouping together variables of other types, methods and events.

Class testing is roughly analogous to unit testing in traditional testing processes. Almost every software testing company prefers to use the most formal specification for generating test cases. The code for a class can be tested effectively by review or by executing test cases.

software testing company_011

Code can be tested effectively by inspection (preferable when construction of a test driver is too difficult) or by execution of test cases (lends itself to easy regression testing later on). Note: When you test a class, you are really creating instances of that class and testing the behavior of those instances.

Testers should make a choice: whether to perform a class test independently or to perform a test as a component of a larger part of the system.

Factors that Weigh with Choosing the Type of Testing:

  • role of the class in the system – degree of risk;
  • complexity of the class;
  • amount of efforts associated with developing a test driver.

Sometimes, class testing needs so many collaborators that it makes more sense to test classes in a cluster. Classes are usually tested by their developers because they understand class’ specification and familiar with the code. Test driver can be used by the developer to debug code while writing it.

Software tester should ensure that the code for a class exactly meets the requirements – no more and no less. A test plan that identifies test cases should be developed soon after a class is fully specified and ready for coding, especially if developer is the class tester. The driver and the test cases will be available to supplement or change as the class is enhanced or modified.

When performing class testing a test driver should be created. It produces instances of the class, sets up suitable environment around those instances to run a test case, sends one or more messages to an instance as specified by a test case, checks the outcome based on a reply value, changes to the instance, or parameters to the message, deletes any instances it creates if responsible for storage allocation.

Related Posts:

About Article Author

view more articles
Nataliia Vasylyna
Nataliia Vasylyna

View More Articles