- 浏览: 71411 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
george.gu:
<div class="quote_title ...
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 1597Where ConcurrentModificationExc ... -
Memory Leak analyze
2012-03-12 06:21 887Shallow 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 805Search-->Copy-->Small ... -
Java Exception Design
2012-02-18 05:36 798Talk something used to happen i ... -
JMX in Weblogic
2012-02-17 19:20 1586Here I would like to list some ... -
Clean Code (1): Meaningful Method Signature
2012-02-10 21:31 835Remove useless method Remove m ... -
Answer Questions or Give solutions Consistent and Entirely
2012-02-10 18:59 1029Before answer a technical probl ... -
Continuous Improvement (1): Delivery Features as Easy and Stable as possible
2012-02-10 18:22 890We should delivery features as ... -
Java String Charset Encoding
2012-02-09 00:28 2976Charset Charset is a named map ... -
Weblogic 11g JSP cache
2012-01-31 00:41 2831Normally, 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 706During 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 970AOP References Please refe ... -
JMX Usage
2011-12-13 06:22 795There is long times since last ... -
Using Taglib to Implement Dynamic UI
2011-12-12 06:13 891What'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配套源代码
Pragmatic Unit Testing in Java 8 with JUnit_Code 源码 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
Pragmatic Unit Testing In Java With Junit
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, ...
单元测试之道-junit,不过是英文的。
JAV单元测试,教你如何使用junit推荐
JUnit设计模式分析及简化的JUnit代码 Junit 中的设计模式 感谢刘兵同志 (技术顾问 bliu76@yeah.net) JUnit 是一个优秀的Java 单元测试框架,由两位世界级软件大师Erich Gamma 和 Kent Beck 共同开发完 成。...
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 Testing with Spock teaches you how to use Spock for a wide range of testing use cases in Java. You’ll start with a quick overview of Spock and work through writing unit tests using the Groovy ...
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 ...
In Pro CDI 2 in Java EE 8, use CDI and the CDI 2.0 to automatically manage the life cycle of your enterprise Java, Java EE, or Jakarta EE application’s beans using predefined scopes and define custom...