4 ms·
Without a single unit test how can this piece of software be called "system"?
by toppy 10y ago
Without a single unit test how can this piece of software be called "system"?
- VMG 10y agoSimple, just add a singleton: https://github.com/vvk-ehk/evalimine/blob/master/ivote-server/common/singleton.py https://github.com/vvk-ehk/evalimine/blob/master/ivote-serve...
- jessaustin 10y agoHaha; this seems pretty dumb: if __name__ == '__main__': pass
- SanFranManDan 10y agoHow they use the singleton is strange also. https://github.com/vvk-ehk/evalimine/blob/master/ivote-server/evui/evui.py https://github.com/vvk-ehk/evalimine/blob/master/ivote-serve... > Election().count_questions() > Election().is_hes() > for el in Election().get_questions() > Election().is_voters_list_disabled() Election is a singleton so they keep reinstantiating it every time they want to use it instead of just doing > election = Election() at the module level and having a more idiomatic singleton (module variable are singletons). But a singleton design probably isn't the best approach. The singleton example isn't that bad of code since it assumes that one server will run one election which is a valid assumption, but reading through this code makes me weary about e-voting. I think this proves that OpenSource doesn't always mean good code. There is little incentive for people outside of Estonia to contribute to the project.
- trymas 10y agoEstonians use a 'black box principle'. They have some voting system - a black box - and they believe it works and no one has hacked it.