With the extensive promotion of Refactoring technology and XP software engineering technology, the role of unit testing is increasingly important in software engineering, and a concise cyclic, wide, efficient and stable unit test framework has a successful implementation unit test. critical use. In the Java programming statement environment, Junit Framework is an excellent test framework that has been adopted and empirically used by most Java programmers, but most of the number of programs that do not try JUnit Framework are learning how JUnit Framework is to write unit tests that adapt to their own development projects. I still feel that there is a certain difficulty, which may be because JUnit has the user guide and documentation with the framework code and utility with a focus on explaining the design method of the unit test framework and a simple type of use instructions, while the framework is in a specific test framework. Under how to implement unit testing, how to update and maintain existing unit test code during project development has not been explained in detail. Therefore, this document has further supplemented and description of the documentation attached to JUnit, so that JUnit can be used by more development teams, allowing unit testing and even refactoring, XP technology better in more development teams .
This article will showcase the overall testing method in the code method, and generate test reports to the developer's mailbox
Place junit.jar under ANT_HOME / LIB and write build.xml files
Build.xml
XML Version = "1.0" eNCoding = "GB2312"?> Depends = "CompileTest, Run"> This article provides a thinking, you can also achieve more powerful features, distribution test overall testing, etc.