Tuesday, November 11, 2008

Idea: Automatic unit tests

Although the TDD folks have been pushing the concept of "test code first, actual code next", I've seen that doing that actually requires some maturity and a larger amount of discipline. But what struck me was that all developers actually do test their code before putting it out; they just dont code the unit tests always. How do they do this? Well, by running the code and looking at the output - be it in a debugger or with SOP prints or logger output, or GUI display. Everything that a junit requires is there, except the assertion which is done visually by the developer.

So how about creating a Record mode for the program run - probably as an Eclipse plugin. Once you click record, it would record the state of the program run - every method call and its inputs and outputs. This by itself is a solved problem - debuggers do it all the time. Then when the program's finished running, you present the developer with the execution trace, and ask him to pick the ones he'd like to convert into tests. When he picks particular method calls, the plugin then allows him to choose what preconditions of that method call need to go into the setup() (and corresponding postconditions into the tearDown()) and also allows him to inspect the output and create assertions. Once these are chosen, a test is created with these values automatically, and added to that class' test suite.

Idea: GTD version of Lightning

Been using Thunderbird with Lightning, and its a bit tough as I'm trying to use it GTD style. So this idea is to tweak lightning so its Task features become more GTD friendly.
  • First off, tasks should have sub tasks
  • Also, they must be allowed true categories, ie one task can be in multiple categories. Right now only one category is allowed.
  • Search Tasks feature should be there
  • Group by multiple attributes would be useful. Eg group by category (Next Action, Someday/Maybe) and then by context (@Home, @PC, etc - which I use the location field for)
  • Link tasks to the messages or events that they have been converted into.
.. and some more that i cannot remember now.