Testability is how effectively and efficiently software can be tested. Designing for testability also supports maintainability: focused tests check whether a method produces expected results, while repeated testing helps catch broken functionality. section 15.1
Testing a money transfer
A transfer method looks up two accounts, calculates their new balances, and updates them. Identify relevant scenarios for that logic, then write a test method for each in a test class. section 15.1
Figure 15.3 For any piece of logic you test, you need to find the relevant test scenarios. For each test scenario, you write a test method in a test class. You add the test classes in the app’s Maven project test folder. In this figure, the TransferMoneyUnitTests class is a test class that contains the test scenarios for the transferMoney() method. TransferMoneyUnitTests defines multiple test case methods to test each relevant scenario in the transferMoney()’s method logic.

See how a test class groups separate test methods for the scenarios of one transfer method. section 15.1






