4 ms·
Yeah you can have bad architecture with or without tests, having tests does not mean you don't have to think about design! I disagree that tests lock you down t
by olavk 10y ago
Yeah you can have bad architecture with or without tests, having tests does not mean you don't have to think about design! I disagree that tests lock you down though, it really depends on how they are written.
- wvenable 10y agoYou can't have unit tests that don't lock you down to a particular structure of units. That's really the definition of unit testing. I'm not saying anything about bad architecture. You have a good architecture for today's requirements that is a bad architecture for next year's requirements. Tests lock you down to whatever your first architecture is.
- olavk 10y agoI tend to avoid the term unit-test since there is some disagreement about what "unit" mean. Some think it means testing everything down to the level of individual private methods. This will indeed lock you down. And if it paired with extensive "mocking", where you only ever test that method A calls method B when invoked, then yes, you have locked your self down and you wont get a lot of value from the tests. I prefer automated tests of larger units or subsystems, and testing against requirements, protocols and specifications rater than implementation details would change. Of course anything will change over time, but I believe this kind of tests provides higher value and lives longer.