开发者

Best way to create automated testing in a Java environment

I have been tasked with finding the best way to do integrated unit testing. We have a very large Java EE 5 application (desktop). Right now we use a tool called QF-TEST which is pretty cumbersome for large tests and can be difficult to use (easy to break) with any code changes.

We now want to do something that is more standard and gives the developers more control.

I have read a开发者_如何学运维 few posts here:

Unit testing in Java EE environment

Automated Testing - kind of cool, although for .Net

Best practice approach for automated testing

easiest Automated testing tool in Java

From the general information I have read JUnit/JUnitEE is probably the best (by best I mean quickest to learn and possibly the JAVA standard).

Is JUnit the way to go for large Java EE applications? What are some other options that others find better (if there are any)?

Thanks!


That's a very broad question. It's the topic of many books. Start with JUnit, start reading about test-driven design/development (TDD), and build from there. Ask more specific questions as you come across them. You could start with "Test Infected", a rather old, yet still applicable article on the JUnit site.


I think for java I would go with either with junit or testNG frameworks, If you have persistence/data base involved in the application, I would add dbUnit to the mix.

If you have build scripts like maven or ant or gradle, I would also suggest you look into Jenkins and similar tools to automate builds.

I am suggesting maven because it has life cycle events for testing, You can add targets with ant, I have not used gradle but if I was given choice, I would choose gradle


JUnit is not the way to go for large Java EE applications, it is a bare minimum.

But since you already have an application writing jUnit tests will not help you, because jUnit is not a testing tool. jUnit is used for TDD and refactoring safety, writing jUnit tests as an afterthought simply does not work.

That said you should learn jUnit4 as soon as possible (it can be done in 60 seconds) and than learn about TDD (it can be done in 2-3 hours) and use jUnit for every future code change you make to your application.

As for code you already have, what you need is 'code analyzers'. That means tools that will check your source code for violated coding standards, code duplication, do code coverage, dependency analysis and complexity monitoring. (All of these and more exist as eclipse plugins)

You will probably also need some 'java gui testing' framework (to replace QF-TEST) There are a lot of open source alternatives there, search the web.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜