Twitter Does Not Allow For Nuance 20
If you have something deep to say, 140 characters is not going to cut it very often. And sometimes, when it does, it’s almost too opaque to be grasped by anybody who doesn’t already grok it.
Here’s one example:Polymorphsim – Same request different response.
That’s the essence of polymorphism, which can help with the SRP and the OCP. That one happens to fit in to a single bullet of < 140 characters. However, there’s a lot there. In fact, while that could be the definition, it has many ramifications and the context matters. So this probably falls in the opaque category.
Test is Definition (TDD), therefore code w/o Test, not defined. Therefore, it is broken (or never wrong, take your pick).I wanted to make that fit in a single tweet. I forgot to put in to whom I was replying (and now I cannot remember[sorry]). Anyway, I got the following replies:
@dws – Test is a form of definition. It’s a very good form, but it’s not the only one.
@jamesmarcusbach – If test is definition, then * must be the same as +, because 2+2=4 & 2 * 2=4. No, a test is just an event. (via )
@ecomba I love this statement!I wanted to reply with a little more length, so I figured this was a good place to do it.
To @ecomba, thank you. I’m assuming your reply was in response to that statement, but if not, then thanks anyway!-)
To jamesmarcusbach – I do not agree. When I assess “Test is Definition (TDD)”, that suggests to me that there are many, many unit tests (and even acceptance test, load tests, smoke tests, manual tests, exploratory tests, debugging, ...). The union of all of those tests form the definition. You’ve picked one example and erroneously extrapolated from it to discount a tweet, and I don’t think you did it. (And to be clear, I strongly prefer certain forms of tests over others.)
I also do not agree with your interpretation of testing as an event. At the very least it is a process. Even more so, it is a continuous process that is only done when the project is done, which is when the customer stops paying. So I think you and I are using the same 4 letters (test) in very different ways. I suspect, however, that I’ve committed the same error in interpreting your use of the word event as you’ve interpreted my use of the word test.
And finally, I don’t agree with your example for many reasons, two of which are:- I mentioned TDD, I don’t check the compiler very often, so I won’t be testing 2+2 or 2*2.
- However, if I am, I would not only pick your two examples. I’d have many trying to capture all of the equivalence classes.
To @dws – Sure, test is a form a definition. And I also agree that it is not the only form. I never said it was the only form (I think that came from you). As for not including the word form in my tweet, I did include TDD. Does that not invoke a large context, part of which is that TDD can possibly be a form of definition? Of course, saying Test is Definition is actually a metaphor, right?
OK, having replied with > 140 characters, I’m going to restate the tweet. Since the restatement is longer than > 140 characters it will have the luxury of being wrong in many more ways than the original.
Test is one form of Definition (TDD). If you do not have any other form [the context of the original tweet I believe, to which I was responding but mistakenly forgot to include the @..] (e.g., some requirements specification or a verbal agreement with some sales person), then the tests are one good definition of what is/is not correct. If we go with the definition of our system in terms of the tests, then where there are no tests, there is no definition and therefore any behavior is OK. Sure you can argue, the system should not crash when a user enters a character into a field that expects numbers, but really, if that behavior is not defined, saying “it should not do that because of common sense” really is saying “Well I assumed it would not do that, you violated my assumption therefore I will prove you wrong in a battle royal.” Even more, it’s great because when it happens, the user will be so mad that s/he will make sure to let you know your definition of the system is incorrect. You can respond by writing another test to improved the fidelity of your understanding of the system.This last part is really a tip of the hat to Jerry Weinberg who said (and I paraphrase probably incorrectly):
If there are no requirements, any solution will do.Of course, he was probably referring to Alice in Wonderland…
There’s a lot more to this subject. For example, I don’t believe in proving systems correct. Why? Even if you’ve proven that your system conforms 100% to your formal specification, there’s no reasonable way to prove:
- Your formal description is complete (yes you can for simple data structures, BFD, don’t care about formally proving a simple data structure).
- For any complex system described in terms of a formal language, the original inception of the system was in natural language. Prove the transformation, and then prove the natural language specification is correct/complete.
- I’m a big fan of Gödel’s incompleteness theorem. It is related to this at least loosely because.
By logical extension, you can pick up from this that I’m not a big fan of using formal languages like UML to build my system “from the diagrams.”
So in conclusion I like my original statement. I understand that it is not literally true or “The Truth.” It’s a way of thinking about things. I think the feedback was valuable because communication is ambiguous.
I could have been more clear. Maybe I should not have tried to even express the idea on Twitter. By throwing something out there, it gets refined through feedback and there’s a bettering understanding to be had. At some point we can create some pithy statement that has all of the meaning and none of the meaning at the same time. When we’ve done that, we get to start all over again.
Maybe the statement is simply wrong. At the very least it has an agenda. Question is, does it help, hinder or simply represent a single drop in an infinite bucket?
Flame on. I deserve it.
FitNesse Scenario Tables 69
This is a slightly rougher draft that the previous tutorials. Bob and I have talked about writing a new FitNesse book and these tutorials are practice for one part of the book. By the time these examples make it into a book, they will be the 3rd or 4th major revision.
In any case, here’s a tutorial that picks up where Script tables left off: http://schuchert.wikispaces.com/FitNesse.Tutorials.ScenarioTables.
I’ll be updating it over the weekend and into next week. I also hope to get the table table example done so I’ll have a complete set. If you are chomping at the bits for a table table example, let me know.
If you have comments about any of the tutorials or a wish list of what you’d like to see in a book related to acceptance testing with FitNesse, please post a comment or email me directly. shoe at objectmentor dot com.
FitNesse Script Tables Tutorials + updates 37
There is now a 4th FitNesse tutorial at: http://schuchert.wikispaces.com/FitNesse.Tutorials.ScriptTables. As the URL suggests, this is about Script Tables.
Next up: Scenario Tables and then Table Tables.
One other change, each of the 4 first tutorials now have source available at github along with tags:- FitNesse.Tutorials.0.Start
- FitNesse.Tutorials.1.Start
- FitNesse.Tutorials.2.Start
- FitNesse.Tutorials.ScenarioTables.Start
- FitNesse.Tutorials.ScriptTables.Start
So you can start at any of the tutorials rather than having to work your way through each one from the beginning. (Of course, that last tag is my starting point for the next tutorial, which will take a few days to update and add to this sequence of tutorials.)
Comments/suggestions/requests please.
FitNesse Tutorials 187
Here is another tutorial for FitNesse: http://schuchert.wikispaces.com/FitNesse.Tutorials.2.
This tutorial and the first now all fit together and form one ongoing example. If you work though the first three tutorials at: http://schuchert.wikispaces.com/FitNesse.Tutorials, you’ll have practiced:- Using Decision Tables
- Using Query Tables
- Refactoring within FitNesse
- Using SetUp and TearDown pages
- Understanding inheritance of SetUp and TearDown pages
- Basic test organization under a suite
- Switching into unit testing from acceptance testing
There’s more to go, but that’s a good start to get you cracking at the fundamentals of FitNesse.
As a bonus, there’s a demonstration of some code in Java that produces query results in a snap. The source code is on github: http://github.com/schuchert/queryresultbuilder/tree/master.
Here is one such example taken from that tutorial:public List<Object> query() { List<Program> programs = CreateSeasonPassFor.getSeasonPassManager() .toDoListContentsFor(programId); QueryResultBuilder builder = new QueryResultBuilder(Program.class); builder.register("timeSlot", new TimeSlotPropertyHandler()); QueryResult result = builder.build(programs); return result.render(); }
Hope this is useful!
FitNesse Decision Tables, a Tutorial 126
There’s a new tutorial on using FitNesse decision tables: http://schuchert.wikispaces.com/FitNesse.Tutorials.1.
This tutorial is a lead-up into using Query tables (that’s the next one I’ll be writing), which will describe some code you can get from github that will turn an object/collection into a well-formed query result.
These tutorials are background for a presentation I gave at SD West 2009 and will probably be giving at Agile 2009.
Comments Welcome.
Different Test Examples in C++ Using C++ CppUTest 69
Here are several versions of the same unit tests written in different styles using CppUTest: C++ Unit Test Examples. If you look near the bottom, you’ll see what looks like story tests in C++. Shocking!
These are all based on Bob’s Prime Factors Kata.
Tdd with C++ and Boost 38
I’m going to give Boost another whirl. There appears to be a great installer for Visual Studio. It requires free registration. I’m on the fence about what to use first and was wondering if you have any suggestions.
I’m thinking about basic things initially:- Regex
- Threading
- Sockets
Maybe a multi-threaded server responding to message via socket, with client threads processing requests using regex?
If you have anything you’d like to see, reply to this blog and I’ll follow up with you.
FitNesse.Slim Scenario Shenanigans 67
I was working with Uncle Bob today and we came across a case where we wanted to invoke a curried method, but it was in FitNesse. It took me a while to grok it. Now I do, but it took some time.
On the surface it involves a Decision Table using a Scenario Table, which uses a Scenario Table that ultimately uses a named Fixture. It’s a bit of a long read but the results do suggest a way to express a generic test and then invoke it while reducing duplicated information.
Here’s the link: http://schuchert.wikispaces.com/FitNesse.Tutorials.ScenarioTables
This is a rough draft. I’ll be updating it over the next few days. If something does not make sense, please post a comment and I’ll update it.
For C# users: I have not tried this example using Slim.Net. It should work if you follow the instructions from the previous tutorial and simply replace the Java code with C# (not really a big deal when you see the code). In fact, C# offers a more flexible switch, so it would be a bit cleaner.
Getting Started with FitNesse in C# 97
The tutorial I mentioned yesterday now has a Java path and a C# path. Check out http://schuchert.wikispaces.com/FitNesse.Tutorials.0.
In addition, you’ll need to get Slim.net. Check out here: http://schuchert.wikispaces.com/Acceptance+Testing.UsingSlimDotNetInFitNesse.
Getting Started with FitNesse 59
Want to know the very basics of getting a first FitNesse example up and running? Check it out here: http://schuchert.wikispaces.com/FitNesse.Tutorials.0.
This is really bare-bones basic. I’ll be adding more tutorials (mostly by request).
Please place requests in the comments if you’d like to see other subjects (e.g. same thing with .Net and C#).
I’ll be sticking to Slim-based implementations unless there’s many requests for Fit.