For the movie buffs like me

December 9, 2006

Movies to be released in December (and not to be missed)

1. Rocky Balboa (this is going to be huge. the trailers rock!)

2. SpiderMan 3

3. Pursuit of happiness

Sesh


Model based testing

October 5, 2006

What is the best way to test software?

Delivering quality code and keeping customers happy is the ultimate goal for any software development effort. Common problems people complain about software are that it does not do what they expect it to. Lot of times, particularly in R&D environments the specs are not clear and there are 2-3 iterations before the customers and developers agree that they have a working solution. While ambiguous specs do lead to some kind of re-work, in my personal experience developers do spend time fixing issues reported by the customer. Instead of adding new features, time is spent on fixing bugs in a previous release. If most of the bugs were to be found before the release, there is a good chance of project success as the customers get a stable ‘working’ build.

Software testing plays an important role in ensuring that the application released to customers does what it is supposed to do and without any errors. The definition for testing that I like most is “software testing is running the code in a controlled environment with the intent of finding errors”.  Automated testing has come a long way in ensuring that a software product is tested consistently through its various releases. Through automated testing it is possible to excercise so many scenarios that are impossible to be executed manually within a limtied time and with limited resources.

Helpful as it is, traditional automated testing suffers from the pesticide paradox. Just like how a pesticide can kill only a particular type of pests and how useless it becomes once those bugs have been killed, the throughput from automated testing drops drastically over time. Automated tests are still good for smoke tests and regression testing where you are interested to find if some core functionality is working or if old functionality remained unbroken.

However one of the bigger challenges for product release is to extensively test the software. All the functionalities have to be tested, all the code in the application has to be excercised with various inputs to ensure that the program behavior is verified in all its possible states.

This verification of program behavior in all its possible states is quite difficult with traditional testing techniques.

Here comes Model Based Testing.

In model based testing, a behavior model of the software is constructed that describes all the possible functionalities of the system and the manner in which the software system transitions from one state to another. A typical tool used to represent such behavior models are the finite state machines.

A typical model based testing framework consists of (or is developed as):

1. Create or define a model of the system under test. Examples of models are state transition table or the finite state machines.

2. A separate component then uses the model to generate test cases. From the state transition table or the FSM a directed graph can be built with the different states of the system as nodes and the transitions as the edges. Using graph traversal techniques it is possible to determine a sequence of input actions that leads the software to a particular state. The sequence of input actions form the test case and the final state is the excpected result.

3. As the software evolves, only the model needs to be updated with any new states and transitions. The test suite can then be updated automatically. Another advantage of this methodology is that the expected behavior (test oracle) is also built into the scheme.

An excellent and comprehensive reference to MBT is available at www.model-based-testing.org and www.geocities.com/harry_robinson_testing. This is maintained by Googler Harry Robinson.

In future posts, I will share examples of creating behavior models and also blog about creating a model based testing framework.


Project ideas

September 29, 2006

1. super script engine for .net applications.

2. plugin that reads out the contents of gmail.


XAML contest

September 21, 2006

Michael Swanson has announced a XAML conversion contest. You need to write a tool that convert certain graphics formats to Microsoft’s XAML, the mark up language for GUI in vista. Details are available here and here.

Seshagiri


Movies for iPod: available on iTunes

September 20, 2006

Moveis are now available on the iTunes stores. Price ranges from 9.99 to 14.99. Cool, isnt, it?


Design for a testable rich client application

September 19, 2006

Using Model View Presenter Pattern for testable applications:

The model-view-presenter pattern can be used to design testable applications. It is quite similar to the MVC pattern except that the view receives messages/ events from the user rather than the controller. The presenter acts as a bridge between the model and the corresponding GUI.


A brief note on value type and reference types

September 12, 2006

A brief note on value type and reference types

Value type variables simply associate a data in memory to a name. The size of the memory slot is dependent on the type of the variable. For example,

int a = 10;

There is a slot of 4 bytes (for integer type) on the stack and the name for the slot is ‘a’.

Reference type variables always point to a location on the heap. The size of a reference type variable is always 4 bytes (32 bit systems, 8 bytes in 64 bit systems). This 4 byte reference points to the actual data on the heap.

Rules:
1. reference variables created on stack get destroyed when the stack unwinds (e.g. control exits out of the function). Note here that the actual data this variable was referring to will stay in memory as long other variables are referring it.

So irrespective of value type or reference type, all local variables are stored on stack.

2. Function parameters are also local to the function and stored on stack. However if the parameter has an ‘ref’ modifier then this argument shares the slot with the variable in the calling function.

3. Instances of a value type are stored in the same context as the variable that declares the value type. For example if a struct (value type) is defined as a data member in a class (reference type) then in all instance of the class, this struct instances will be created on heap.

4. Static variables and strings are always stored on the heap. Static variables are NOT stored on the garbage collected heap but on a different one called the high frequency heap.

5. If you declare two strings in a class like
string s1 = “ABC”;
string s2 = “ABC”;

note that both have same value. In such cases only one “ABC” is created on the heap and s1 and s2 will be referring to this memory location. If either s1 or s2 gets changed then a new string is created.

Further reading:
1. What is “ArrayList” and what are its uses
2. What is boxing in .net and why is this important
3. what are generics in .net 2.0 and what problem do they solve?


Google desktop gadget idea

September 5, 2006

At work we decided to start using Kanban cards as a part of adopting agile development process. We started off using infopath to create tasks and then asign timelines for each task.

For sometime, wanted to create a desktop gadget using the google SDK. Sounds like it will be good idea to create a gadget application that allows one to create tasks, manage time lines and progress and then also share the task list with colleagues. Finally it will be also possible for  the managers to create reports from the tasks. The only drawback could be that communication between similar gadgets across different computers is through google talk so not sure how it would fit in the office (e.g. would the network security team allow it?).

Even for a single user, this looks like a good idea. The gadget will have the following features:

1. Create project list

2. For each project, add list of tasks to be completed in a week

3. Add descriptive notes for each task if required

4. At any time later pull out any task and assign the start time/ start date and end time/ end date. End date or someother flag signifies that task is closed.

5. Be able to create time summary (and other reports) project wise. For example at the end of the week find out how much time was spent on each project.

Seshagiri


‘finally’ pitfalls

June 15, 2006

The ‘finally’ clause is very helpful to do clean up operations when working with costly resources, database connections etc. Even when an exception occurs, the finally clause is guarenteed to be executed thus ensuring that there are no resource leaks.

The pitfall is that its quite easy to end up writing some functionality code in the finally clause thinking that it would be executed after certain tasks. For example you might put your report writing code in a finally clause. So in case an exception occurs, the functionality code is also executed resulting in even more bugs!!


Cool cartoon

June 15, 2006

Coercing Your DeveloperPerhaphs I should be posting the link instead of copying the picture itself (http://www.bugbash.net/comic/52.html)