Talk:JUnit
From Wikipedia, the free encyclopedia
This page seems a lot like an ad.
- Probably because it was taken straight from an article. See below.
Um, possible plagiarism alert: the first paragraph reads very much like this paragraph from an IBM website:
"JUnit is the de facto standard unit testing library for the Java™ language. ... JUnit, developed by Kent Beck and Erich Gamma, is almost indisputably the single most important third-party Java library ever developed. As Martin Fowler has said, "Never in the field of software development was so much owed by so many to so few lines of code." JUnit kick-started and then fueled the testing explosion. Thanks to JUnit, Java code tends to be far more robust, reliable, and bug free than code has ever been before. JUnit (itself inspired by Smalltalk's SUnit) has inspired a whole family of xUnit tools bringing the benefits of unit testing to a wide range of languages. nUnit (.NET), pyUnit (Python), CppUnit (C++), dUnit (Delphi), and others have test-infected programmers on a multitude of platforms and languages."
http://www-128.ibm.com/developerworks/java/library/j-junit4.html?ca=dgr-lnxw01JUnit4
In fact, most of the article seems to be plagiarized from the IBM page. I'm removing the plagiarized parts.
do we say Junit or JUnit ?
[edit] Typical Use of JUnit
The code example provided as a "Hello World" implementation of sorts appears that it really doesn't emphasize the benefits of unit testing nor is it a typical example. Rather, a better code example may appear as:
"Multiplier" example in JUnit:
public class MultiplierTest extends TestCase { public void testMultiplication() { // Testing if the Multiplier class agrees that, 2*2=4: assertEquals ("Multiplication", 4, Multiplier.multiply (2, 2) ); } }
There are several issues to consider here: 1) Wikipedia programming language articles usually present an example of the source code in the form of the customary "Hello World" process. However, JUnit is not a programming language. Instead, 2) JUnit has conventions: it is conventional to see test case class names end with "Test", as well as the prefix name specified as the name of the class being tested. Also, something more meaningful is usually printed in the assertion message (probably not "Multiplication"). 3) Albeit, the original example does offer a fundamental test using only the framework and the core of the Java virtual machine and language specifications. 4) Unit testing is an attempt to test something else, by usually creating a code unit to test another code unit. In the original example, perhaps this was to test the virtual machine's ability to multiply 2 and 2. This compares well with the Mauve article as it is sited for comparison after the example. Unfortunately, 5) typical unit tests execute other code bodies outside of the virtual machine, and most frequently, developer created application (client or server) code units as suggested in the example above. Lastly, 6) application code units are mere clients of the JVM's services. A common objective of a JUnit test is to ascertain the ability of the application code unit to consume/manipulate those services properly to achieve the desired end state or requirement. A JUnit test rarely tests the JVM's services directly.
The original example appears to miss the point of JUnit in practice and as a consequence does not offer much redeeming value to the reader. The example offered above seems to reflect a more common/characteristic perspective of what [Java] unit testing seeks to accomplish. I'm not saying that JUnit testing can't be used to test the JVM as this obviously is a practice - yet this practice isn't nearly as common. 71.253.210.107 04:46, 24 February 2006 (UTC)
[edit] j2meunit
http://j2meunit.sourceforge.net/ Mathiastck 23:42, 21 August 2006 (UTC)
[edit] Origins of JUnit/SUnit
The article states that "...the xUnit family of frameworks that originated with Kent Beck's SUnit." While that is at least partially true, there are is at least one ancestor that should be discussed: the Taligent Test Framework. I've written about its history on my blog:
http://shebanation.com/2007/08/21/a-brief-history-of-test-frameworks/
David McCusker, who was the primary author of the Taligent Test Framework, has posted a followup on his own blog:
http://www.briarpig.com/log/aug07.html#test-frameworks
--Ashebanow 13:36, 22 August 2007 (UTC)