CalebFenton / simplify

Android virtual machine and deobfuscator
Other
4.41k stars 438 forks source link

Refactored ExecutionGraphManipulatorTest to use TempDir annotation #160

Closed eas5 closed 3 years ago

eas5 commented 3 years ago

This is a test refactoring. No original assertion was changed and I tried to remove the flaky exception when saving.

Problem: Tests that manipulate external file resources need to guarantee resource integrity and availability. Test suite design and maintainability may suffer from the addition of assurance steps to guarantee parallel execution scenarios and resource leakage from failed previous executions.

Solution: The use of @tempdir annotation assures a temporary directory being created and cleaned up for every test method execution, thus simplifying test maintenance steps.

CalebFenton commented 3 years ago

Cool, thanks for the explanation!