Testing in O-O, no those are not glasses…

Object Oriented, what a paradigm, isn’t it? We use a lot more of classes and parts since everything makes an object here, let’s learn how is testing done here.

Photo by Miguel Á. Padriñán on Pexels.com

In object-oriented (OO) paradigm, software engineers identify and specify the objects and services provided by each object. In addition, interaction of any two objects and constraints on each identified object are also determined.

OO program should be tested at different levels to uncover all the errors. At the algorithmic level, each module (or method) of every class in the program should be tested in isolation. 

Photo by Startup Stock Photos on Pexels.com

At the class level, every class should be tested as an individual entity. At this level, programmers who are involved in the development of class conduct the testing.

Test cases can be drawn from requirements specifications, models, and the language used. In addition, structural testing methods such as boundary value analysis are extremely used. After performing the testing at class level, cluster level testing should be performed.

Test Cases in OO

The points that should be noted while developing test cases in an object-oriented environment are listed below.

  1. It should be explicitly specified with each test case which class it should test.
  2. Purpose of each test case should be mentioned.
  3. External conditions that should exist while conducting a test should be clearly stated with each test case.
  4. All the states of object that is to be tested should be specified.
  5. Instructions to understand and conduct the test cases should be provided with each test case.

Scenario-based testing is used to detect errors that are caused due to incorrect specifications and improper interactions among various segments of the software.

Generally, the structure of a scenario includes the following points.

  1. A condition under which the scenario runs.
  2. A goal to achieve, which can also be a name of the scenario.
  3. A set of steps of actions.
  4. An end condition at which the goal is achieved.
  5. A possible set of extensions written as scenario fragments.

Challenges

Encapsulation of attributes and methods in class may create obstacles while testing. As methods are invoked through the object of corresponding class, testing cannot be accomplished without object.

Inheritance and polymorphism also introduce problems that are not found in traditional software. Test cases designed for base class are not applicable to derived class always.

Photo by Nguyen Nguyen on Pexels.com

Always make sure you have a well tested project so you won’t have issues happening after you deploy your product.

If you want to learn a bit more, you can visit The Full Life Cycle Object-Oriented Testing (FLOOT) Method

-RC

Deja un comentario

Diseña un sitio como este con WordPress.com
Comenzar