Description. Test code that makes optimistic assumptions about the existence (or absence) and state of external resources (such as particular directories or database tables) can cause non-deterministic behavior in test outcomes. The situation where tests run fine at one time and fail miserably the other time is not a situation you want to find yourself in. Use Setup External Resource (2) to allocate and / or initialize all resources that are used.
Detection. A test method utilizes an instance of a File class without calling the exists(), isFile() or notExists() methods of the object.
Description. Test code that makes optimistic assumptions about the existence (or absence) and state of external resources (such as particular directories or database tables) can cause non-deterministic behavior in test outcomes. The situation where tests run fine at one time and fail miserably the other time is not a situation you want to find yourself in. Use Setup External Resource (2) to allocate and / or initialize all resources that are used.
Detection. A test method utilizes an instance of a File class without calling the exists(), isFile() or notExists() methods of the object.