Book Image

Mastering Netbeans

5 (1)
Book Image

Mastering Netbeans

5 (1)

Overview of this book

Table of Contents (17 chapters)
Mastering NetBeans
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Performing TDD within NetBeans


Now that we've seen all the different aspects of the development life cycle, let's pull it all together and give a brief demonstration of how to use these techniques to perform TDD within NetBeans.

TDD is a software development process where the developer writes a test for a piece of functionality before writing the functionality itself. The test will obviously fail at this point as the implementation has not been written. The next stage is to write just enough of the implementation to get the test to succeed. Subsequently, the developer needs to take stock of their code and refactor it to remove any unnecessary code.

Due to the way that tests initially fail, then are fixed and then refactored, the TDD cycle is often referred to as the Red-Green-Refactor cycle.

Tip

For more information about TDD, check out http://en.wikipedia.org/wiki/Test-driven_development.

To give an overview of how to perform TDD within NetBeans, let's use TDD to write a method that calculates...