What is Junit test in programming?

2009-07-05 1:09 pm
Is it only related to the programming program "eclipse"?
Can someone briefly explain it as simple as possible to me?

回答 (4)

2009-07-05 3:16 pm
✔ 最佳答案
JUnit is an open source framework that has been designed for the purpose of writing and running tests in the Java programming language. JUnit was originally written by Erich Gamma and Kent Beck. There are many ways to write test cases. A test case is a code fragment that checks that another code unit (method) works as expected. So if we want an accurate and efficient testing process then using a good testing framework is recommended. JUnit has established a good reputation in this scenario.

JUnit is a regression-testing framework that developers can use to write unit tests as they develop systems. Unit testing belongs to test a single unit of code, which can be a single class for Java. This framework creates a relationship between development and testing. You start coding according to the specification and need and use the JUnit test runners to verify how much it deviates from the intended goal. Typically, in a unit testing, we start testing after completing a module but JUnit helps us to code and test both during the development. So it sets more focus on testing the fundamental building blocks of a system i.e. one block at a time rather than module level functional testing. This really helps to develop test suites that can be run any time when you make any changes in your code. This all process will make you sure that the modifications in the code will not break your system without your knowledge.

Using a framework, like JUnit, to develop your test cases has a number of advantages, most important being that others will be able to understand test cases and easily write new ones and that most development tools enable for automated and / or one click test case execution.

JUnit provides also a graphical user interface (GUI) which makes it possible to write and test source code quickly and easily. JUnit shows test progress in a bar that is green if testing is going fine and it turns red when a test fails. There is a lot of pleasure in seeing the green bars grow in the GUI output. A list of unsuccessful tests appears at the bottom of the display window. We can run multiple tests concurrently. The simplicity of JUnit makes it possible for the software developer to easily correct bugs as they are found.

for simple tut recommend you to go through the one at
http://www.roseindia.net/junit/


Hope this resolves your issues
Cheers:)
2009-07-05 8:20 pm
JUnit is a simple framework for writing and running automated tests. As a political gesture, it celebrates programmers testing their own software.
2009-07-05 8:19 pm
Dont mix between the platform (technology) you are using and the IDE you use.
Eclipse is an IDE (Integrated Development Environment) used to write applications in many languages, mainly Java.

JUnit is a testing platform for Java language. In short words, you write your code and make "UNIT" testing with JUnit, like testing one class, package or module.
2009-07-05 8:16 pm


收錄日期: 2021-05-01 12:33:55
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20090705050905AAVBqCa

檢視 Wayback Machine 備份