- The most common way of debugging is uses of sops. But the main disadvantage of sops is after fixing the bug compulsory we should delete extra added sops otherwise these sops also will be executed at runtime which impacts performance of the system and disturbs logging mechanism.
- To overcome these problems sun people introduced assertions concept in 1.4 versions.
- The main advantage of assertions over sops is based on our requirement we can enable or disable assertions and by default assertions are disable hence after fixing the bug it is not required to delete assert statements explicitly.
- Hence the main objective of assertions is to perform debugging.
- Usually we can perform debugging either in development environment or Test environment but not in production environment hence assertions concept is applicable for the development and test environments but not for the production.