More

    INTRODUCTION TO UNIT TESTS

    Unit testing is a software testing method by which individual units of source code, together with associated control data, usage procedures, and operating procedures, are tested to determine whether they are fit for use.

    A unit is the smallest testable part of an application. In procedural programming, a unit could be an entire module, or an individual function or procedure. In object-oriented programming, a unit is often a class, but could be an individual method. (source = Wikipedia).

    Some of the properties of good unit tests are:

    1. Unit tests should be fully isolated. They should run independently of other tests.
    2. When it fail, it should give proper indication of what has failed and what was the expectation.
    3. Unit test should only test a single unit at a time. There should not be any real dependency.
    4. It should continue to run consistently always as long as the functionality of the unit has not changed.
    5. Unit tests should be faster and easier to run. There should not be need to configure any machine or create a setup for running tests.
    6. Unit testing is usually automated and is usually done using an unit testing framework.

    Popular unit testing frameworks or helper libraries in Java

    1. JUnit
    2. TestNG
    3. DBUnit
    4. Spring Test
    5. Mockito 

    REFERENCES:

    https://en.wikipedia.org/wiki/Unit_testing

    Recent Articles

    OAUTH – FREQUENTLY ASKED QUESTIONS FOR INTERVIEWS AND SELF EVALUATION

    Why is refresh token needed when you have access token? Access tokens are usually short-lived and refresh tokens are...

    SUMO LOGIC VIDEOS AND TUTORIALS

    Sumo Logic Basics - Part 1 of 2 (link is external) (Sep 29, 2016)Sumo Logic Basics - Part 2 of 2...

    GIT – USEFUL COMMANDS

    Discard all local changes, but save them for possible re-use later:  git stash Discarding local changes...

    DISTRIBUTED COMPUTING – RECORDED LECTURES (BITS)

    Module 1 - INTRODUCTION Recorded Lecture - 1.1 Introduction Part I – Definition

    BOOK REVIEW GUIDELINES FOR COOKBOOKS

    Whenever you add reviews for the book, please follow below rules. Write issues in an excel.Create an excel...

    Related Stories

    Leave A Reply

    Please enter your comment!
    Please enter your name here

    Stay on op - Ge the daily news in your inbox