Date: 20 Feb 2013
JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. - Junit 4.0
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.
INSTALLATION: I have tried the installation with Eclipse and it is simple.
LEARNING CURVE: As long as you know what packages are and how one package uses another, the learning curve is non-existent. I have not yet tried using it in an advanced manner, like with JUnit or with Ant. There might be some learning curve there but it should be trivial.
Last modified: 21 Feb 2013