Why use JUnit for testing?

后端 未结 11 1477
忘掉有多难
忘掉有多难 2020-12-12 09:59

Maybe my question is a newbie one, but I can not really understand the circumstances under which I would use junit?

Whether I write simple applications or larger one

11条回答
  •  盖世英雄少女心
    2020-12-12 10:25

    You cannot write any test case without using testing framework or else you will have to write your testing framewok to give justice to your test cases. Here are some info about JUnit Framework apart from that you can use TestNG framework .

    What is Junit?

    Junit is widely used testing framework along with Java Programming Language. You can use this automation framework for both unit testing and UI testing.It helps us define the flow of execution of our code with different Annotations. Junit is built on idea of "first testing and then coding" which helps us to increase productivity of test cases and stability of the code.

    Important Features of Junit Testing -

    1. It is open source testing framework allowing users to write and run test cases effectively.
    2. Provides various types of annotations to identify test methods.
    3. Provides different Types of Assertions to verify the results of test case execution.
    4. It also gives test runners for running tests effectively.
    5. It is very simple and hence saves time.
    6. It provides ways to organize your test cases in form of test suits.
    7. It gives test case results in simple and elegant way.
    8. You can integrate jUnit with Eclipse, Android Studio, Maven & Ant, Gradle and Jenkins

提交回复
热议问题