¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Tests ¡°scoped¡± to implementation


 

I don¡¯t know how many tests you really need for a python one-liner like that.

`return any((sum(pair)==6) for pair in permutations(list, 2))`

Check empty list returns false?
Check for no matches
Check for one match
Check for invalid input handling

There really aren¡¯t many invariants to lock down for refactoring purposes.
I guess you could do more than that, but at some point you¡¯re testing the compiler and the library (someone else¡¯s code) and not your algorithm.


--
Peace,
Tim
-------------------------------------


Join [email protected] to automatically receive all group messages.