Main reason to follow Unit Test
“What was I doing until now?” you might ask. You’ve done integration testing. Integration testing means testing two or more dependent software modules as a group.
- With unit test we can test a single module unit.
What is Unit Test?
A unit testis a piece of a code (usually a method) that invokes another piece of code and checks the correctness of some assumptions afterward. If the assumptions turn out to be wrong, the unit test has failed. A “unit” is a method or function.
A unit test should have the following properties:
❂ It should be automated and repeatable.
❂ It should be easy to implement.
❂ Once it’s written, it should remain for future use.
❂ Anyone should be able to run it.
❂ It should run at the push of a button.
❂ It should run quickly.