Lesson 15: Test Driven Development (Slides)
Please review the following resources before lecture:
- Test-Driven Development (TDD): A Time-Tested Recipe for Quality Software (Article)
- Test-Driven Development explained in 3 minutes (Video)
- Complete Unit Testing assignment.
- Do pre-work for lesson 16.
For the code in the Lesson 15 app, you will write tests in the unit tests project. You must achieve a code coverage of 80% or more. The coverage report can be viewed at ./tdd/tdd_app/build/reports/jacoco/test/html/index.html after running ./gradlew check
or ./gradlew jacocoTestReport
.
In addition to writing unit tests, you will need to implement a new method on the Employee
class called getDetails
that returns a string describing the employee using the Test-Driven Development methodology.