Why do we ignore your arguments?
With the release of Isolator Version 5.3, we have added the ability to simulate
external components based on the arguments passed to those components. We called this Conditional Behavior.
Our default is to ignore arguments, to fake a method without taking the arguments into consideration, neither the number of arguments (overloads) or the values of those arguments (conditional behavior).
There is a reason for this.
Lets see the values with which we create our API’s, taken from Roy’s post
- Consistency
- Discoverability
- Explicitness
- Single point of entry
- Readability
- Single way to achieve things
- Backwards compatibility
The value that I want to discuss is Explicitness: we decided early on to be as explicit as possible about the API, so that the least guessing needs to take place by the user
So how do we decide on our defaults?
We fight about them, we find out what will need the least guessing, but keep the tests short (Readable)?
We talk about what most users mean, what most users expect.
We talk about failing fast when writing the code and we talk about Brittle vs Fragile when running the code.
We argue about what default usage will break if the user changes (refactors) the production code, without changing its logic. We want those tests to succeed.
This is ultimately why we ignore the arguments, so that changing a value passed to a method or using an overloaded method instead, will not fail the test.
Those cases where the difference is required, are discoverable while writing the test. The test will fail fast, if an overloaded method needs a different behavior, or if the method acts differently based on its arguments, and that will allow the writer to add the conditional behavior.
Recent Posts
- Unacceptable: Unit testing will take 20 years to catch on
- The 4 reasons why we DIDN’T choose Oslo
- Typemock Academy Launch
- The First Rule to Software Craftsmanship
- Goal-driven Development
Categories
- .NET Tests
- Agile
- Code Integrity
- Community
- Debugging
- Fun
- Management for Geeks
- Marketing
- Product
- Release
- Reviews
- SharePoint
- TDD
- Time Management
- Uncategorized
- Unit Tests
Archives
- May 2010
- April 2010
- March 2010
- February 2010
- December 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- December 2008
- November 2008
- August 2008
- July 2008
- May 2008
- April 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
