#14 Write a test suite
Opened 3 years ago by adamwill. Modified 3 years ago

I'd really recommend writing a test suite before the code gets any more complex. You've already got quite the forest of conditionals in polish_data, for instance, and it's very easy for that to get thrown off. Ditto most of interpreter.py.

As part of this you may find it easier to refactor a bunch of those elif forests into separate functions / methods - then you can test each one separately.


Yes, I have the suite in my plans. I have also thought about splitting the elif forest into functions, but then I decided not to, because I still would need the elif trunk to steer the code fetching separate functions that would never be used elsewhere. The only reason for the split is to increase the testability of the code, that's true, so I will see how that goes.

As I said, I would like to devote some time to Fedora 33 testing, so I will revisit this after Fedora has been released.

Metadata Update from @lruzicka:
- Issue assigned to lruzicka

3 years ago

I do tend to find that unwinding these just makes the code more human-readable too. When you separate the conditional flow from the actual 'do stuff' code, it's easier to read both than when they're kinda folded together.

Login to comment on this ticket.

Metadata