DRAFT
A series of exercises to illustrate testing. This workshop will take you on a journey to improve a small application that was built without testing in mind. Each exercise is in its own branch and is called a chapter. The README.md
file in each chapter contains a situation description and a mission for you to do, should you choose to accept it. Successive chapters contain a solution to the previous chapter. This is not a test and there are no right answers. For now, we are just covering the basics of testing and refactoring.
branch | status | description |
---|---|---|
chapter1 | Write your first test and execute it locally. Learn how to do a PR. | |
chapter2 | Get your CI system to run your test, does it work? If not, fix it. | |
chapter3 | Measure and increase code coverage. | |
chapter4 | Extract code from main() method. | |
chapter5 | Extract parsing functionality. | |
chapter6 | Write first unit tests. | |
chapter7 | Extract report functionality using interfaces. | |
chapter8 | Write unit tests for reports. | |
chapter9 | Asserting on System.out. | |
chapter10 | Simple dependency injection. | |
chapter11 | Mocking dependencies in the unit tests. | |
chapter12 | Assert on only the functionality of the class under test. | |
chapter13 | Complete the mocking for a fully isolated test. | |
chapter14 | Using AssertJ for fluent assertions. | |
chapter15 | Basic test-driven development by implementing a new requirement | |
chapter16 | The final solution |