JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. - Junit 4.0
Junit 4.0
Junit older versions
Just download the JAR file and add it to your build path in Eclipse. More details hereā¦
Here is an excerpt of that example:
package edu.uci.inf191;
import static org.junit.Assert.*;
import org.junit.Test;
public class NumbersToStringTest {
@Test
public void NumberToEnglishShouldReturnOne() {
String actual = NumbersToString.numbersToEnglish(1);
assertEquals("Expected result one.", "one", actual);
}
Q. Do you think the JDK uses JUnit for testing? Remember, Junit came well after the JDK.
IMHO JDepend is a simple tool for measuring certain metrics about how packages in Java depend on each other.
According to JDependās Official Webpage:
JDepend traverses Java class file directories and generates design quality metrics for each Java package, including:
- Number of Classes and Interfaces
- Afferent Couplings (Ca) - measure of Responsibility
- Efferent Couplings (Ce) - measure of Independence
- Abstractness (A) - Number of Abstract Classes and Interfaces
- Instability (I)
- Distance from the Main Sequence (D)
- Package Dependency Cycles
Further details on the metrics hereā¦
It is a simple tool that succinctly captures how one Java package depends on another. This might be useful when building large projects or APIs to maintain āappropriateā (runtime) boundaries between different sections of your code base.