Skip to main content

Can I use constructors with in Unit Test?

Actually the answer is yes but not recommended. This problem came to my mind time ago at the start of selenium project. I used and end-up with many run time errors. If you use constructors then your test project will build without error but there can be run time error specially when calling it by other class.


First as a QA what we need to understand is why we are using unit test. Unit testing is testing the public states, behaviors, and interactions of testing objects. If you use private fields within constructors then what there to be test. In fact we need to use object orient concepts but better to keep the focus on simplicity.

Comments

Popular posts from this blog

Differences between Severity ,Priority and Status

In market there are many bug tracking and project management tools available. These tools allow us to keep essential information of a bug or task. You will see there are three places have to fill when key in a task. Those three places are Status, Priority and Status of a bug/task. Let's see what those stand for.  Severity Priority Status Connotation Severity of a bug means how much it affecting to functionality of the software. Total damage it can do. Priority means how fast a bug or task should be resolve. Status means the current position of the bug/task. Types            Critical            Major            Moderate            Minor           Cosmetic           Low           Medium       ...

Radio Frequency Identification

What is rfid Radio Frequency Identification is rapidly improving and developing technology in today world. During the Second World War rfid technique use in very first time (1970).Whether you may don’t know this technology, but used in daily life. To understand bit of this just think about barcode system in super market. That is the simplest form we can see. Rfid technology is a means of gathering data by touching/seeing a data carrier. Most important feature of this is tracking objects and then uniquely identifying them. But no need direct sight line to recognize. This will give great new potential.