Testing is an important part of sotware development and engineering. There are many components of testing, and it needs to be considered at every phase of the software development life cycle (SDLC).
Test-Driven Development (TDD) is a software development approach in which tests are written before the code they are intended to validate.
The TDD process typically follows a cycle known as the "Red-Green-Refactor" cycle.
This cycle is repeated iteratively, with new tests added for additional functionality or changes. The goal of TDD is to produce well-designed, maintainable code that meets the requirements and has a suite of tests validating its correctness.
The linked video resource below provides a good introduction to creating Java projects in Eclipse, and using the JUnit test framework.
| time | topic |
|---|---|
| 0:05 | Eclipse |
| 0:15 | Create a new Java project |
| 0:25 | Create a new package |
| 0:27 | Create a new Java class |
| 0:56 | Adding a simple method to the class |
| 1:33 | Add another method to the class |
| 4:25 | Create a new JUnit test case |
| 6:10 | assertEquals() |
| 6:44 | Run the test(s) |
| 7:00 | Demonstrate a failed test |
| 7:15 | Add another test case |
| 9:15 | Combine test cases into a new test suite |