code-society-25-2

Lesson 15: Test Driven Development (Slides)

Pre-work

Please review the following resources before lecture:

Homework

Unit Testing

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.

Stretch assignment

For this stretch assignment, you will create a unique folder and copy the lesson 10 libraries app typescript project to it. Then, create integration tests for the MediaCollectionApp that ensures it can load CSV data using a specific loader. Also configure a code coverage framework and ensure that code coverage is at least 70% is achieved for the whole app. Lastly, add a script to the package.json that allows for running the integration tests separately from the main unit tests.