Unit testing

This is the program-based individual component verification process to ensure most of the development artifacts are independently tested for their expected behavior. For example, if you write an application to advise on pensions for the previous employees in an organization, the component that calculates the age of a person based on the date of birth can be developed as an independent component and unit tested for its behavior. Assertions are the essential terminology in which the individual components functionality is validated between the actual and expected behavior, the failing of which is treated as a failure for the component's expectancy.

While setting up the unit test cases for any feature/component takes a considerable amount of time, another challenge is to keep the test cases up to date for changing requirements. Application teams are advised to maintain a set of test artifacts/data that can be used for executing the unit test cases multiple times through the project's life cycle. Moreover, running a test coverage verification to review the amount of code considered by the unit test cases is helpful in uncovering the untested components in the application.

Some of the important applications of unit testing for distributed applications are:

  • Mocking the dependencies of a component with the help of the mocking framework
  • Continuous integration-based unit test execution
  • Test coverage in applications
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset