BUG PATTERN IN JAVA - Programming Articles

Bug Patterns in Java - The Orphaned Thread

Overview When your multithread program freezes and stack traces don't print to standard error, there's a chance you've discovered the hard-to-track Orphaned Thread bug pattern. We discuss the obvious fix and detail ways to detect and prevent th ...

0 Comments. 1553 views since Jan 5, 2009

Bug Pattern in Java - Other Obstacles to Factoring Out Code.

Other Obstacles to Factoring Out Code Factoring out common code is a good practice, but it can't be done in all cases. And, because it's not always an easy matter to actually eliminate the potential for such rogue tiles in a static ...

0 Comments. 877 views since Dec 8, 2008

Bug Pattern in Java - The Broken Dispatch

Overview When you employ inheritance polymorphism—a feature of object-oriented languages that allows you to override methods—in combination with static overloading—a feature that allows you to overload methods based on the static ty ...

0 Comments. 810 views since Dec 29, 2008

Bug Pattern in Java - Debugging & the Testing Process

We highlight the essential interplay between continuous testing and effective debugging. Designing for Testability Before leaving the topic of development, let's discuss the issue of software that's hard to test. As I have stressed, effec ...

0 Comments. 783 views since Dec 8, 2008

Bug Pattern in Java - Agile Methods in a Chaotic Environment

We discuss the context in which modern software is developed, and identify some of the shortcomings of the old approaches to development and debugging. Examining Trends in Software Design, Implementation, and Maintenance Over the past few ...

0 Comments. 750 views since Dec 8, 2008

Bug Pattern in Java - The Double Descent

Overview When your program recursively descends a composite data structure so that occasionally more than one step down is taken via a single recursive call, you've come upon the Double Descent pattern. We discuss ClassCastExceptions and th ...

0 Comments. 728 views since Dec 29, 2008

Bug Pattern in Java - Null Pointers Everywhere

This article is a quick interlude to expose you to null pointers and the NullPointerException, a frequently occurring cause of several bug patterns. One of the most common (and most commonly complained about) symptoms of bugs in Java progra ...

0 Comments. 713 views since Dec 8, 2008

Design Patterns for Debugging - Maximizing Static Type Checking

The following points, also motivated by the bug patterns we've discussed, are some important keys to minimize the introduction of bugs into your code. Remember, these methods may be in conflict with the goals of maximizing static type checking, the oth ...

0 Comments. 688 views since Jan 5, 2009

Bug Patterns in Java - Platform-Dependent Patterns

Overview When you detect any problem that can't be replicated across the vendor, version, or operating system spectrum, chances are the bug is linked to the platform in some way. We discuss the key to diagnosis with this family of patterns—re ...

0 Comments. 685 views since Jan 5, 2009

Bug Patterns in Java - The Split Cleaner

Overview When a program leaks or frees resources too early—resources such as memory, files, or database connections—a Split Cleaner may be the problem. We look at how the resource is managed as a potential cause. One key feature of ...

0 Comments. 668 views since Dec 31, 2008

Design Patterns for Debugging

Overview In this final chapter, we discuss the yin-yang motivations for employing bug patterns when designing a program: maximizing static checking use and minimizing error introduction. Now that we've taken a trip through some of the mos ...

1 Comments. 645 views since Jan 5, 2009

Bug Pattern in Java - The Liar View

Overview GUIs are usually designed with a Model-View-Controller architecture in which the view is decoupled from the model. This separation presents a challenge to automated testing because it's difficult to verify that a state change in the mo ...

0 Comments. 644 views since Dec 30, 2008

Bug Pattern in Java - Saboteur Data

Overview When a program crashes due to corrupted data, the reason can be elusive. Often a program can crash dead in its tracks while manipulating its own internal data, even after working flawlessly for long periods. You've probably alrea ...

0 Comments. 641 views since Dec 29, 2008

Design Patterns for Debugging - Maximizing Static Type Checking

Java is a statically typed language, but, as we've discovered, the language alone does not determine how much of an advantage that static checking provides. The programmer must actively seek to utilize the type system to get as much static checking as ...

0 Comments. 641 views since Jan 5, 2009

Bug Pattern in Java - Saboteur Data

Overview When a program crashes due to corrupted data, the reason can be elusive. Often a program can crash dead in its tracks while manipulating its own internal data, even after working flawlessly for long periods. You've probably alrea ...

0 Comments. 638 views since Dec 29, 2008

Bug Pattern in Java - Debugging & the Development Process

We discuss the crucial interdependence between effective debugging and effective development, highlight extreme programming development methods, and peek at the potential future of test-oriented languages. Debugging as Scientific Experiment ...

0 Comments. 627 views since Dec 8, 2008

Bug Pattern in Java - The Impostor Type

Overview When special tags in fields are used to distinguish between types of objects, errors are possible in which a tag mislabels the associated data—a bug pattern known as the Impostor Type. We'll examine the symptoms and causes, def ...

0 Comments. 610 views since Dec 29, 2008

Bug Patterns in Java - The Fictitious Implementation

Overview When an interface implementation doesn't satisfy all necessary invariants, you may have encountered the difficult-to-diagnose Fictitious Implementation bug pattern. We look at a double threat prevention method—assertions and un ...

0 Comments. 602 views since Jan 5, 2009

Bug Pattern in Java - Building Cost-Effective Specifications with Stories

One good way to develop software requirements incrementally is in the manner advocated by extreme programming (XP), an agile software-development method that has become quite popular over the past few years. The name comes from the concept that many co ...

0 Comments. 582 views since Dec 8, 2008

Bug Patterns in Java - The Run-On Initialization

Overview When you get a NullPointerException and you suspect that class-definition constructors don't take enough arguments to initialize all the class's fields, you may be looking at the Run-On Initializer pattern. We discuss initializing all ...

0 Comments. 575 views since Jan 5, 2009

Bug Pattern in Java - About the Bug Patterns

We discuss why knowledge of patterns is important to effective creation, implementation, debugging, and maintenance of software; we explain why these patterns have been chosen (and why they are important to your coding efforts); and we offer a t ...

0 Comments. 571 views since Dec 8, 2008

Bug Pattern in Java - Bug Specifications & Implementations

We rigorously define the concept of a bug, explain why a specification is crucial for controlling software bugs, highlight the differences between a specification and an implementation, and discuss a cost-effective means for developing specifications.< ...

0 Comments. 541 views since Dec 8, 2008