Monday, October 18, 2010

Bug in Silverlight 4 : HtmlPage.PopupWindow cannot resize poup

When trying to open a resizable popup window throught Silverlight, don't try to find out why it doesn't work with IE in some cases, works with FF in some others, etc... don't waste your time, simply because HtmlPage.PopupWindow is flawed.

Indeed, this sounds silly, but  because of a spelling mistake that is around for at least a year, and Microsoft is aware of that.

Take a look at Reflector :

The bit of code appends an invalid JavaScript command ("resizeable" instead of "resizable").

How to solve it ? ... wait for a patch..., or use the good old JavaScript, for example :

string javascriptOpenWindow = "window.open('" + link + "','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=1,resizable=1,width=1024,height=800,left=20,top=20')";
               
System.Windows.Browser.HtmlPage.Window.Eval(javascriptOpenWindow);




How Genetic Algorithm can ease your User Test cases (UI Tests)

 Let consider a large application to develop; it is not possible to list the entire exhaustive combination of User Test Cases : You could have millions of possible ways of using your complex application, hence millions of User Test Cases to record and run within the automated Software Factory.

When dealing with large and complex scenarios, Genetic Algorithms are good to find a solution quickly, whereas calculating all possible ways would last more than decades even with the fastest computer.

Let us assume that the red biomorph fractal below is THE best User Test Case that you are looking for, because it covers 100% of the needs (hence you don't have to tests all possible combinations, where many of them would likely to do nearly the same thing), and would guarantee no software regressions over years.

Since you don't know yet the solution, you would try to identify programmatically for exemple 1000 random combinations (24 of them are represented as white biomorph fractals below).
By letting them evolve throw a reproduction process (with various factors such as mutations) during a large number of iterations, this would lead to find a solution within minutes.
This may be not the perfect one, but the closest to the sought solution.
  

"Genetic Algorithm Viewer 1.0", by Jean-Philippe Rennard, is the software above that can demo the principles, based on biomorph fractals : http://www.rennard.org/alife/french/gavintr.html.

This post only shows an example of what could be done; it is up to you to either implement or buy a software that will help you implementing ONLY relevant User Test Cases (hence the minimum required tests), and not a large number of combinations anymore.

Some other links on AI or GA :
http://dotnetkicks.com/csharp/How_to_Create_a_Neural_Network_and_Genetic_Algorithm_in_C_NET
http://www.codeguru.com/Cpp/misc/misc/article.php/c3795
http://www.codeguru.com/cpp/cpp/algorithms/general/article.php/c14825

Tuesday, October 5, 2010

Monitor the code quality over time

Here is a quick post to show an example of a code quality report over time for a CMMI project. The rendering of the graph is done via the FusionCharts Flash library, that is bound to an XML file.
It could be noted that the Flash graph could be rotated around to better see the values.
Anyway, since we are talking of a 3 years report, we are just interested in visualizing the trends, not the exact values.


You can find online examples here : http://www.fusioncharts.com/Gallery/Category.asp?Column3D