"JUnit in action" is one of the "Java People's Toolbox" series, and its cover design is selected from the beginning of the 1799 Edition in Madrid, Spain. MINNING wants to express colorful and colorful pictures in the book, express the colorfulness of personal life, with "exchange more color and more interesting spirit and civilization". "More colorful is more interesting" - I read the feelings of this book. "JUnit In Action" for the test theory and JUnit's description, the author's tone is very moderate, feeling like face-to-face chat, and people have a desire to read. The author wants to say: Test is actually very simple, please test it happily! In fact, before learning JUnit, I have implemented the most basic test mode in the process of writing code - source program good exception handling mechanism large and small test programs in DEMO form. Typically, in the test program, some small scenes are designed for each function, give an input, then view the output; if you throw the wrong, you can use a good abnormal handling mechanism to be relatively fast positioning errors. I believe that many people have passed the process before learning the unit test. This can be a process that is time consuming, the code is redundant, and the A stupid process! Test DEMO is implemented based on command line mode (JAVAC and Java Command). I personally think that for team development, there is no meaning - a mature and practical IDE can bring higher efficiency than "command line text editor" and "more more interesting" programming experience. The programmer should focus on the code itself instead of development tools. Therefore, you can see a few DEMO code in the first chapter. However, don't ignore those impressions - they clarify the "Why Test" from a programmer who does not understand the test. Oh, kind text. The picture in the second chapter is simple. Remember that the picture remembers the JUnit structure, it is also easy to launch its usage method - a few ways to name Test *** form a testcase (actually an extended JUnit.framework.testcase class) Class), several TestCase form a TestSuite, one or more TestSuite run by Testrunner. JUnit offers several default Test Runner if there is no custom Test Suite, Test Runner generates a Test Suite for the entire test. Test Suite can nested. Typical code:
Public Class Tester EXTENDS TESTCASE {public void test *** () {...}} / / Custom Test Suite