The Design by Contract (DBC) theory can dramatically raise software quality and reusability levels by forcing you to think in terms of contracts. Contracts formally specify the responsibility relationship between a client (class user) and a supplier (class). Additionally, DBC clearly separates specification (what) from implementation (how). This article explains DBC's importance in object-oriented development and describes a DBCProxy framework that achieves DBC transparently in Java using dynamic proxy classes.
(translated from German) Test-first development is a JIT design technique to respond to JIT requirements. Programmers write a test case before writing any new line of code. Only after the test failed, because the function is not implemented yet, the program is changed to make the tests pass. After that, the design will be improved through a myriad of tiny refactoring moves, running the test suite after every change. [Article Text]
Interfaces and Abstract Classes are language constructs that appear over and over in many design patterns and even just in good design techniques. It is common for a single interface or abstract class to have many different descendants or implementations. A good example of this scenario is the Strategy Pattern which relies heavily on many implementations of the same interface. It is desirable to have one test suite that tests functional compliance with the interface that could be applied to each of the implementing classes.
If you're a developer who isn't currently using unit tests, then this article will show you some reasons to start and, we hope, convince you that writing tests for everything you do will actually make your job easier and your systems better. And if you’re a developer who is testing as you code, then maybe the article will help you feel just a little smug. [Article Text]
Testing is usually an afterthought in the development process. The developer's main focus is to design and write code. Of course, the developer runs the program many times during development to make sure the code runs and produces the expected results; however, this testing has no real structure and the main goal is to ensure the program runs at that moment. Most developers rely too much on QA or the end user to make sure the program works properly and meets requirements. [Article Text]
A series of articles on the Test First Challenges [Article Text]
The tests should drive you to write the code, the reason you write code is to get a test to succeed, and you should only write the minimal code to do so. Note that test-first-design is more than just unit testing. Unit testing by itself does not change the design of the code. In addition to documenting how code should be used, test-first-design helps you keep the design simple right from the start, and keeps the design easy to change. [Article Text]
Unit testing driving you nuts? Learn how using inner classes with the JUnit testing framework can bring you inner peace [Article Text]
This is an introduction/tutorial for using junit as part of the XP (Extreme Programming) style of software development. It uses the example of a simple linked list containing Person objects. [Article Text]
The DragonSlaying technical consulting team's Willy Farrell describes how they used the JUnit framework within VisualAge for Java to unit test the Java classes, including Enterprise JavaBeans (EJB) components, for the Go-ForIt project. This article gives a brief overview of the JUnit framework, describes the team's overall unit testing strategy, and discusses testing considerations for EJBs. [Article Text]