Book Image

Test-Driven Java Development

Book Image

Test-Driven Java Development

Overview of this book

Table of Contents (17 chapters)
Test-Driven Java Development
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
8
Refactoring Legacy Code – Making it Young Again
Index

Summary


In his chapter, we used TestNG as our testing framework of choice. There wasn't much difference when compared to JUnit, simply because we didn't use any of the more advanced features of TestNG (for example, data providers, factories, and so on). With TDD, it is questionable whether we'll ever have a need for those features.

Visit http://testng.org/, explore it, and decide for yourself which framework best suits your needs.

The main objective of this chapter was to learn how to focus on one unit at a time. We already had a lot of helper classes and we tried our best to ignore their internal workings. In many cases, we did not write specifications that verified that the end result was correct, but we checked whether the method we were working on invoked the correct method from those helper classes. In the real world, you will be working on projects together with other team members, and it is important to learn how to focus on your tasks and trust that what others do works as expected...