- 浏览: 73940 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
george.gu:
lqjacklee 写道怎么解决。。 First: Conf ...
Bad version number in .class file -
lqjacklee:
怎么解决。。
Bad version number in .class file -
flyqantas:
would you pleade left more mate ...
UML Extension
QA is important for production. Testing is important for QA.
Here I would like to talk about testing in Java application development. It won't refer to project process/life cycle control, I will only talk something about automatically unit testing.
Test Data Design and Populate
There are always DB interaction in a Java enterprise application, in order to make sure persistence layer and business layer work well, we need to design test data.
Even in some pure java tools application, we need to design some test data to test extrime use cases.
You can use DBUnit or JDBC to populate and clean your test data aournd/after/during test case running.
Test Case Design
System Test: Business Use Case Test
We can say test case design does really depend on your businesses use cases. In fact, it is not enough, sometime and always, business use cases testing will always come in stage of "Integration Test"/"System Test"/"End2End Test".
Unit Test
There are always JUnit test for:
- A line of java function code
- All blocks in a method
- All methods in a java class
- Interaction between java classes
- Java classes security and instances in JVM
They are always come during development.
Test Requirement birth xUnit
As I will list in this chapter, sometime how you want to test your code and which information will be used to assert valid will push you to define or find some useful tools to help your test design.
How to test private method?
Some people use "protected" keywords to replace "private". I do not think it is a good design. If we want to define some unit test for private methods, it is better to design "white box" test cases for public functions which will invoke private functions.
Unit Test for Servlet
HttpUnit provide ServletRunner to simulate Servlet Container to test servlet without Java application server running.
Unit Test for Spring
We can use SpeingJUnit4ClassRunner to test Spring in standalone JVM.
Unit Test for EJB
There should be a EJB container to test your EJB functions. Normally you have to design your EJB client as test cases and deploy your EJB application in EJB container.
Unit Test for XML
Here I would like to list a third party tool: xmlunit which can be used to check XML content. For example, we can use xmlunit to compare if two XML contents same or not.
UI Automatic Test
Most of Java Enterprise application provide user interfaces, so normally we can design some automatically test case on user interface:
- Simulator user manipulate actions in GUI: input data, click some button.
- Check expected item in UI
Httpunit and vmaggie (to be updated) is used in my current project for GUI automatic testing. How to select UI automatically test tools: 1) which language for developing; 2) how the tool execution a test and if it satisfies your UI implementation...
Performance Test
Performance test is importance, you can enhance your prouction quality in stress testing, safety testing and you can also get bench mark to define the optimze configuraton parameters.
Normally performance test cases will focus on a business use case. The test environement: hardware and software should be coherent with deployment ENV.
There are two kinds performance test:
- Automatically performance test: using tools Jmeter or LoadRunner to test some use case and it can be intergrated with automatically build.
- Some mannually bench mark test: optimize functiona or define benchmark for configurations. It can also use some tools in automaticaly test to prepare test data and launch testing.
发表评论
-
java.util.ConcurrentModificationException
2012-03-20 18:10 1668Where ConcurrentModificationExc ... -
Memory Leak analyze
2012-03-12 06:21 933Shallow Heap Size Shallow siz ... -
Scalable and Easy to Integrate (3): Share Data with external Server by LDAP
2012-02-28 05:25 0Share Data with external Server ... -
Scalable and Easy to Integrate (2): Linstener
2012-02-28 05:20 0descript listener pattern in pr ... -
Scalable and Easy to Integrate (1): Callback
2012-02-28 05:19 0Descript the callback method de ... -
Wheels: Common utilities reuse and design
2012-02-18 05:57 837Search-->Copy-->Small ... -
Java Exception Design
2012-02-18 05:36 852Talk something used to happen i ... -
JMX in Weblogic
2012-02-17 19:20 1665Here I would like to list some ... -
Clean Code (1): Meaningful Method Signature
2012-02-10 21:31 907Remove useless method Remove m ... -
Answer Questions or Give solutions Consistent and Entirely
2012-02-10 18:59 1067Before answer a technical probl ... -
Continuous Improvement (1): Delivery Features as Easy and Stable as possible
2012-02-10 18:22 926We should delivery features as ... -
Java String Charset Encoding
2012-02-09 00:28 3030Charset Charset is a named map ... -
Weblogic 11g JSP cache
2012-01-31 00:41 2898Normally, jsp_servlet classes ... -
2011,这样走过!
2011-12-31 06:01 101月11日,琪琪从巴黎 ... -
Security Manager
2011-12-20 21:20 0http://journals.ecs.soton.ac ... -
Unique Identifier generation in Java Application
2011-12-23 06:17 747During application design, ther ... -
WorkManager in Weblogic and Multiple Thread design in Enterprise Application
2011-12-15 05:25 0Descrip how to use workmanager ... -
AOP(3): Spring AOP
2011-12-20 05:24 1019AOP References Please refe ... -
JMX Usage
2011-12-13 06:22 839There is long times since last ... -
Using Taglib to Implement Dynamic UI
2011-12-12 06:13 961What's Taglib? Taglib is a JSP ...
相关推荐
Pragmatic Unit Testing in Java 8 With JUnit steps you through all the important unit testing topics. If you've never written a unit test, you'll see screen shots from Eclipse, IntelliJ IDEA, and ...
《Pragmatic Unit Testing in Java with JUnit》是一本专注于Java单元测试实践的书籍,其配套源代码提供了丰富的示例和实践案例,帮助读者深入理解如何有效地使用JUnit进行单元测试。JUnit是Java领域最广泛使用的...
### Pragmatic Unit Testing in Java with JUnit:深入解析与实战指南 #### 一、单元测试基础概述 《Pragmatic Unit Testing in Java with JUnit》这本书为读者提供了全面而实用的单元测试指南,适用于Java开发...
《Pragmatic Unit Testing in Java with JUnit》是一本专注于Java单元测试的指南,它深入讲解了如何有效地利用JUnit框架进行测试驱动开发(TDD)。JUnit是Java领域中最广泛使用的单元测试框架,它为开发者提供了编写...
Pragmatic Unit Testing in Java 8 with JUnit 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有...
Pragmatic Unit Testing in Java 8 with JUnit 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
This is a practical introduction to using automated unit tests and the test-first approach in your day-to-day software development. The author gives clear guidance on how to make tests work for you, ...
《实用程序员:Java中的JUnit实用单元测试》一书由Andy Hunt和Dave Thomas撰写,是针对Java开发者关于单元测试的一部详尽指南。本书的核心在于强调了单元测试的重要性,并提供了使用JUnit进行有效单元测试的实践方法...
JUnit设计模式分析及简化的JUnit代码 Junit 中的设计模式 感谢刘兵同志 (技术顾问 bliu76@yeah.net) JUnit 是一个优秀的Java 单元测试框架,由两位世界级软件大师Erich Gamma 和 Kent Beck 共同开发完 成。...
《Pragmatic Unit Testing in Java》是编程领域中一本经典的著作,由知名程序员Andy Hunt和Dave Thomas撰写。这本书深入探讨了单元测试的重要性和实践方法,特别是针对Java编程语言。单元测试是软件开发过程中的关键...
Testing Java Microservices teaches you to implement unit and integration tests for microservice systems running on the JVM. You'll work with a microservice environment built using Java EE, WildFly ...
Unit Testing Training - Java Unit Testing in Action.ppt 不错的单元测试ppt教程
Learn Java programming concepts to design automation testing frameworks Java is one of the most commonly-used software languages by programmers and developers. Are you from a non-technical background ...
Then Hands-On Automation Testing with Java for Beginners is for you. This book provides you with efficient techniques to effectively handle Java-related automation projects. You will learn how to ...
Watij(发音为wattage)代表Java中的Web应用程序测试。 基于Watir的简单性并借助Java的强大功能,Watij通过真实的浏览器http://groups.google.com/group/watij自动执行Web应用程序的功能测试。
【标题】:“单元测试之道Java版(Pragmatic Unit Testing in Java with JUnit)” 【描述】:本书“单元测试之道Java版”专注于讲解如何在Java开发中运用JUnit进行有效的单元测试,旨在帮助开发者理解单元测试的...
Learn a use-case approach for developing Java enterprise applications in a continuously test-driven fashion. With this hands-on guide, authors and JBoss project leaders Andrew Lee Rubinger and Aslak ...
Testing in Scala starts with an introduction of the Scala programming language, explains why project infrastructure is critical, and provides compelling reasons to use Scala testing frameworks to not ...