We have a big, long method which runs on the main thread, activted by a timer (tick) event every X seconds.
This is a complex legacy code with calls to other methods that run SQL queries (long blocking).
While the program is waiting for the queries to run the GUI freezes and we can't open the app when it's minimized, close it, etc.
The method has many branches (if conditionals) and loops and accesses many GUI component properties (e.g. to check if a Checkbox is checked, etc.).
We are looking for the best way to refactor our class. Are there some useful refactorings for this task? Would Unit Testing be useful for this? (we don't currently have any tests in place).
Aucun commentaire:
Enregistrer un commentaire