Unit Test « Test « Java Articles

Home
Java Articles
1.Build Deploy
2.Class
3.Core Library
4.Data Types
5.Database JDBC
6.Design
7.Development
8.File Input Output
9.Graphics Desktop
10.J2EE Enterprise
11.J2ME Wireless
12.JVM
13.Language
14.Library Product
15.Network
16.Security
17.SOA Web Services
18.Test
19.Web Development
20.XML
Java Articles » Test » Unit Test 

1. Add Zing to your unit tests    javaworld.com

However, unit test cases are not generic. Any functional method handles multiple data scenarios. We write one test method for every data scenario because we create the test data, fire the test, and validate the output in the same test method. If a new requirement adds additional data scenarios for the method, then we end up writing more test methods. Thus, test-case maintenance requires effort. The complexity of tests further increases when testing server-side components against data that changes during transactions. In addition, we must ensure that the tests are always correct. All of these issues require considerable time to address and increase the complexity of the test cases. Overall, we yearn for something that will remove the complications involved in writing test cases and provide a generic set of test cases that are free from maintenance.

2. Don't sweat unit tests    javaworld.com

This article assumes you're comfortable working with Java and Ant, Maven or the CLASSPATH, and that you have written at least one or two simple JUnit tests.

3. Is unit testing doomed?    javaworld.com

SAN FRANCISCO (08/11/2008) - The agile revolution that began in software development in the 1990s has been inexorably making its way into mainstream IT organizations. Today, one of the most adopted agile practices is unit testing, where developers write hundreds of small tests for exercising their own code. Although the benefits of unit testing are widely recognized, there's growing evidence that unit testing might have reached its high-water mark and be entering a period of stagnation or even decline.

4. Subverting Java Access Protection for Unit Testing    onjava.com

However, when it comes to testing, sometimes these clean interfaces are not as good as they could be. There are often member variables that the test suite would like to access but that have been scoped private or protected, and making these members public would expose the internals, ruining the clean design. C++ has a way of working around this: by declaring the test suite as a friend class, the access protection is sidelined. In Java, a similar approach can be used by making certain members package scope and putting the test classes into the same package. However, this leads to an unsatisfactory design, as some members are private or protected for good reasons, and then an arbitrary set of members are package scope solely for the current test suite.

5. Effective Unit Testing with DbUnit    onjava.com

DbUnit's elegant design makes learning how to properly utilize its features a breeze. Once it's in place as a part of an effective testing strategy, overall code stability will increase dramatically, along with the collective confidence of your development team.

6. Design to Unit Test    theserverside.com

More often than not, enterprise code is badly unit tested or worse, not unit tested. While the reasons for this could vary from time constraints, budget constraints or lack of developer knowledge, surprisingly many times it is because the design of the application was rigid or poor not allowing writing unit tests. Test driven development (TDD) proliferated by agile methodology has not yet been completely embraced by all enterprises. As long as unit tests are written after the code has been developed (and thus after the design), developers run into the problem of unit testing with ease.

7. j1-2k7-mtT10: Turning Unit Tests into Performance and Reliability Tests    today.java.net

Java developers undertake a lot of effort to build unit and functional tests while they build software services and applications. PushToTest is the open-source SOA governance and test automation platform that turns unit and functional tests into scalability and performance tests. The new PushToTest Release 5 runtime adds support for JSR 223 dynamic scripting languages so unit tests may be written in Java, Jython, Groovy, JRuby, Rhino and many other languages. In this session Frank Cohen, founder of PushToTest, demonstrates creating a unit test and operating it as a scalability test in a distributed environment of test machines.

8. Unit Testing In Java    today.java.net

Those new to test-driven development often have difficulty with creating a GUI. What do you test? Don't you need to actually bring the GUI up on a screen and click buttons? Johannes Link answers many of your questions in this excerpt from his book Unit Testing in Java: How tests drive the code, published by Morgan Kaufmann.

9. Drive Your Unit Tests with Custom Scripts    artima.com

ScriptDrivenAccountSuite's execute method invokes processLine for each line it reads from the script file. The processLine method first removes any commments and trims any white space from either end of the line by passing the line to trimLine. If the trimmed line is empty, processLine simply returns. Otherwise, processLine attempts to interpret the trimmed line as test command.

10. Simplify Unit Testing for Spring Web Components    devx.com

This article describes Spring's testability features, specifically the practical features that make unit testing Web components as easy as testing plain old Java objects (POJOs).

11. Two Critical Tips for Unit Testing in Java    devx.com

For years, unit testing languished in the "I know I should be doing it" category, but now it finally has become part of the Java developer's professional toolkit. Being a guru-level java programmer is no longer good enough. Now you have to know how to properly unit test the code you write, which is a good thing because it leads to higher-quality code, higher productivity, and lower maintenance and evolution costs.

12. Jtest: Java Unit Testing & Code Compliance - Parasoft    parasoft.com

Parasoft Jtest is a comprehensive Java testing product for development teams building Java EE, SOA, Web, and other Java applications. Whether a team is trying to build quality into new code or extend a legacy code base without breaking existing functionality, Jtest provides them a practical way to ensure that their Java code works as expected. It empowers them to modify their code quickly and with confidence, resulting in optimization of development resources and control of development schedules and costs.

13. Diagnosing Java code: Unit tests and automated code analysis working together    ibm.com

This is yet another way in which unit tests can be an executable form of documentation. After speculative invariants are inductively inferred from the runs of the unit tests, the analysis tool may attempt to deductively verify that the invariants hold, or it may annotate the code with assertions that can be checked at run time.

14. Automate your team's build and unit-testing process    ibm.com

This article introduces CruiseControl, open source software you can use to automate the build and unit-testing process for multideveloper software projects. I'll explain why automatic builds are essential for successful development teams and take you step-by-step through configuration, installation, and maintenance of a continuous-integration system running CruiseControl.

15. Unit testing the Eclipse way    ibm.com

Begin by launching the Eclipse integrated development environment (IDE). Next, create a basic Java? project into which you'll import the JUnit, jMock, and RMock Java Archive (JAR) libraries. Name the Java project TestingExample. Within the Java Perspective, choose Project > Properties, then click the Libraries tab, as shown below.

16. Practically Groovy: Unit test your Java code faster with Groovy    ibm.com

In this first installment of Practically Groovy, you've learned about one of the most practical applications of this exciting new scripting language. For a growing number of developers, unit testing is an essential part of the development process; and with Groovy and JUnit, unit testing Java code is a snap.

17. Multithreaded unit testing with ConTest    ibm.com

In this article, we introduce ConTest, a tool for testing, debugging, and measuring the coverage of concurrent programs. As you'll quickly see, ConTest isn't a replacement for unit testing but a complementary technology that addresses the failures of unit testing for concurrency programs.

18. AOP@Work: Unit test your aspects    ibm.com

In this article, I introduce a catalog of techniques for testing crosscutting behavior implemented with aspects. I focus on unit tests for aspects, but I also present other patterns that can help you to build confidence in your aspect-oriented applications. As you'll quickly discover, testing aspects involves many of the same skills and concepts as testing objects, with many of the same practical and design benefits.

20. Automated Unit Testing Frameworks    developer.com

Beside the Java language, a world of Java frameworks exists. These frameworks can afford substantial improvements in programmer productivity and enhance the quality, performance, reliability, and interoperability of different Java applications. Fortunately, many of these popular and widely used frameworks are open source projects so anyone can benefit from them if he can invest some time in learning when and how to use such frameworks. This article, the third one in the frameworks series, encourages Java programmers to employ unit tests to get robust code quickly. It also introduces JUnit, an open source Java framework for unit testing any Java code.

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.