Everybody can author a new question

JavaBlackBelt

Subscribe to JavaBlackBelt: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get JavaBlackBelt: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Top Stories

Graphical user interface (GUI) testing is a potentially problematic area because constructing effective test cases is more difficult than the corresponding application logic. The roadblocks to effective functional GUI testing are: Traditional test coverage criteria like "80% coverage of the lines of code" may not be sufficient to trap all the user interaction scenarios. End users often use a different user task interaction model than the one conceived by the development team. Functional GUI testing needs to deal with GUI events as well as the effects of the underlying application logic that results in changes to the data and presentation. The common methods for functional GUI testing are the "record and execute" script technique and writing test programs for different scenarios. In the "record and execute," the test designer interacts with the GUI and all the eve... (more)

JDJ Editorial: IT Olympics

There are a number of esteemed contests for the greatest and fastest software developers among us - events where we can pit our coding prowess against fellow brainiacs and like-minded techies. I think it's high time we had an alternative set of awards, suited not to aspiring budding Turing machine engineers, but rooted more in the humdrum real, rather than artificial academic, world. The Herring Rouge Chase To win this award you have to think that when a piece of code you authored isn't working correctly that the problem isn't your error but instead lies elsewhere in the broken software stack. A colleague of mine was once so convinced the JVM was broken he got as far as talking to a Sun engineer by phone, when it transpired eventually that he'd just written a bad toString() method. Everyone has had or witnessed one of these moments, for which we should humbly remin... (more)

A Framework for REST in Java

Not long ago I worked on a team charged with building up a Java-based REST infrastructure. Our goals were to first support what was then an emerging specification for Java-based RESTful services called JAX-RS. Beyond that, we had thoughts of building an entire framework, both server and client, around RESTful services written in Java. Some of the people I worked with on that team are now part of the team that is responsible for an open source implementation called Apache Wink which embodies some of our early ideas and much more. Developers have been implementing RESTful services in Java for a long, long time, so what's the deal with JAX-RS and an entire framework? Well, the way developers have been implementing REST services typically involves writing their own custom servlet. Within the servlet they write custom code to route incoming requests to the proper back-e... (more)

Java for Managers -- What Should They Know?

Last month, JavaBlackBelt completed a survey where developers said their teams would be 25% more productive if their management committed to skills management... which led me to consider: Which Java technologies do developers think that managers should understand better in order to make great decisions about skills management? I'll suggest, as a start: -- Java SE and EE basics -- ORM's (Hibernate, ...) -- Web Frameworks (lStruts 2, ...) -- IDEs (Eclipse, ...) -- Source Code Mgmt -- Testing Methods -- JavaScript -- Ajax Very open to your thoughts, and who might find such a course useful... feel free to comment here and/or send email to java4managers@globalforcedirect.com. ... (more)

How to Diagnose Java Resource Starvation

We can visualize resource starvation using an elaborate rendition of the Dining Philosophers Problem. This classic metaphor of resource allocation among processes was first introduced in 1971 by Edsger Dijkstra in his paper "Hierarchical Ordering of Sequential Processes." It's been a model and universal method for verifying theories on resource allocation ever since. The metaphor goes like this: There are three well-known philosophers in an Asian bistro. Dinner is served but they are only given three chopsticks because the restaurant's supply truck has been stuck in a snow storm for a couple of days. Naturally each philosopher needs two chopsticks to eat his dinner and each is protected from interference while he uses a chopstick. Plato skipped lunch that day and insists that he should have priority or else he'll faint. If he doesn't give up his chopsticks, the other ... (more)

Java Kicks Ruby on Rails in the Butt

This article tries to demonstrate that Java can be more productive than Ruby. We are going to develop the same application of the article Rolling with Ruby on Rails Revisited (part 1 [1] and part 2 [2]) but using POJO [3]s annotated with JPA [4] and a Model Driven Framework, OpenXava [5] in this case. The result is that with less code, and less time you obtain a more powerful application. Ruby and rails: The regressive framework Ruby on rails [6] is so elegant, so easy, so productive. I cannot avoid read and heard continuously these comments. For example, the article Rolling with Ruby on Rails Revisited of Bill Walton says: “What would you think if I told you that you can develop a web application at least ten times faster with Rails than you can with a typical Java framework?” Oops! Ten times faster! Well, after these comments I decided to learn Ruby on Rails. I ne... (more)

The Trials of Software Testing

Software testing while one of the most important tasks done in a development project is often misunderstood and abused by everyone from programmers and managers to testers. Wikipedia calls testing "an empirical investigation conducted to provide stakeholders with information about the quality of the product or service under testing, with respect to the context in which it is intended to operate." This definition, like most that try to make software into a science, is bunk. The definition of testing that I buy and try to instill in others is that testing is done to find bugs in a piece of software before the user does. When a project subscribes to empirical ideology it causes a number of problems. The first is that developers write sloppy code because they somehow feel that testing is something done by others who will use imperfect and fancy overpriced tools to diss... (more)

Anatomy of a Java Finalizer

A couple of patterns that could cause Java heap exhaustion were identified from years of research at IBM. One interesting scenario was observed when Java applications generated an excessive amount of finalizable objects whose classes had non-trivial Java finalizers. What Is a Java Finalizer? A Java finalizer performs finalization tasks for an object. It's the opposite of a Java constructor, which creates and initializes an instance of a Java class. A Java finalizer can be used to perform postmortem cleanup tasks on an instance of a class or to release system resources such as file descriptors or network socket connections when an object is no longer needed and those resources have to be released for other objects. You don't need any argument or any return value for a finalizer. Unfortunately the current Java language specification does not define any finalizers for a... (more)

Insane Strings

Java Developer's Journal A cool article at http://www.roseindia.net/javatutorials/insane_strings.shtml You never know what can happen with Java code . ... (more)

IBM Could "Reinvent" Java: Mills

IBM News on Ulitzer Interarbor Solution principal analyst Dana Gardner had a drink with IBM Software chief Steve Mills last week. He said Mills thinks that the Oracle-Sun deal will go through but that Oracle CEO Larry Ellison is buying Sun because he doesn't "understand the hardware business" and won't get his money's worth at the $9.50 a share Oracle is proposing to pay for it. Well, what else is Mills (pictured on the main screen at JavaOne below, behind Sun CEO Jonathan Schwartz) going to say; IBM supposedly walked on the deal. Anyway, Gardner got Mills to talking about Java and Mills remarked that IBM has a long time to worry about Oracle's potentially iron grip on Java licensing because its renewal is years off and then Gardner made an interesting observation: that IBM had invented Java for the server for Sun and that it could reinvent it like making Apache Ha... (more)

Reflections on Java Command Line Options

Abstract There are many different types of command line options that programs need to recognize. Many languages (e.g.: bash and perl) has built-in processing of command line options; Java does not. The Java Command Line Options (JCLO) package performs this task for a variety of option styles. It also uses Java's reflection capability to automatically assign values to variables in a specified class. Introduction Even in these days of sophisticated graphical user interfaces, many programs have a wide variety of command line options that help specify their behavior. It is also the case that command line only programs continue to enjoy wide use. It is also the case the command line arguments can become quite complicated, e.g.: -Djava.util.logging.config.file=All.finest -1 --list --this=that Some languages have built-in parsers for command line options; perl and bash ar... (more)