Refactoring 0 Remove Unneeded Code

There are five test methods for the array-based version and five test methods for the ArrayList version. Because the GenerateArray method is being removed, it appears that we can remove the tests for that method. We can do this safely because we are not losing any test coverage by removing the array-based tests. The ArrayList-based tests are exact duplicates in terms of what is being tested.

After the array-based tests are removed, the following tests remain:


■ ListBasic m ListLots

We can also get rid of the utility method Contains because it was used only by the array- based tests. After we finish removing the code, we compile and run the tests. The test method count drops to five and we have a green bar, so it is time to move on.

0 0

Post a comment