Search posts, tags, users, and pages
Maxi Contieri
Software Engineer
TL;DR: Don't leave a hardcoded mess on IFs. Problems Testability Hardcoded values Open/Closed Principle Violation Solutions Replace all IFs with a dynamic condition or polymorphism. Context Hard-coding iF conditions is great when doing Test-D...
Miki Szeles
Everything related to test automation
Great post, Maxi!
Is there any magic number from which it is better to use a map than an if? For example I have 2 mappings(0->false, 1-> true) only and I am sure I won't need more. Would you use dictionary in that case too?
Hi Smells are hints. My advice would be to change it whenever it 'smells', not before, not after.
I think 2 is too soon, 10 is too late :)
Thanks, Maxi Contieri for the answer. ๐
Miki Szeles
Everything related to test automation
Great post, Maxi!
Is there any magic number from which it is better to use a map than an if? For example I have 2 mappings(0->false, 1-> true) only and I am sure I won't need more. Would you use dictionary in that case too?