Wednesday, March 10, 2010

File Hash Checker

Download here

This is a simple utility I wrote that displays the hash code of one or two files, and then compares them to see if they are the same. I used this to find duplicate image files (where the names of the files could be different).


Friday, March 5, 2010

Conditional Compilation

#define test = true
class TestClass {
void test() {
#if test
// do something
#else
// do something else
#endif
}}

Here's the equivalent code in VB.NET:

#Const test = True
Class TestClass
Sub test()
#If test
'do something
#Else
'do something else
#End If
End Sub
End Class

Here's the same but using the DEBUG constant which is automatically set by Visual Studio based on whether you are in debug mode:


Class TestClass
Sub test()
#If DEBUG
'do something
#Else
'do something else
#End If
End Sub
End Class

Software Testing

Unit Tests
The major benefits to be had from unit testing are

1. It allows the developer test parts of an application without waiting for the other parts to be available.

2. Exceptional conditions can be tested for the unit

3. The debugging process is simplified by limiting the search for bugs to a small unit rather than the complete application.

4. It helps avoid lengthy compile-build-debug cycles when debugging difficult problems.

5. Detection and removal of defects can be done at a much lower cost.

Integration Testing
The purpose of this kind of testing is to verify whether the major subsystems of the application are integrated. It helps in uncovering the errors that may arise due to conflicts between different units of an application. Integration testing is performed in different ways.

Bottom Up Approach: The testing is commenced from the smallest subsystem and progresses up the hierarchy to cover the whole system. This methodology requires the developer to write a number of test driver programs that test the integration between the subsystems.

Top down Approach: This begins at the top. The top level interfaces are first tested and then the smaller sub systems are examined. Stubs are written for modules that are not ready for testing.

Umbrella Approach: The focus in this methodology is on testing the modules that have a high degree of user interaction. Stubs are used in place of process intensive modules. This enables the developer test the graphical user interface and improves the functionality of the interface.

Regression Testing
Regression testing is performed whenever the program is modified. The process involves the rerun of all the tests mentioned in the preceding sections. It has two main goals:

  1. Verification of known bugs that were corrected
  2. Verification of new bugs.


Testing International Applications
Applications created for international usage are to be tested by checking for the language, the country and dependencies. The following factors are to be considered when testing such applications:

  • Whether the application’s data and user interface conform to the locale’s standards for date, time, numeric values, currency, list separators and measurements.
  • Whether the application runs on different languages and culture variants.
  • If Unicode has not been used in the application the culture/locale code of the operating system will have to be set to the localized version of the application.
  • The Input data in the language should be supported by the localized version.
  • In this section of the lesson we have focused upon the testing of Windows applications. In the sections that follow we shall briefly look at tracing windows applications.

Friday, December 4, 2009

WinFX = .NET 3.0 ~ = Win2008 ?

Did this come true?
"By now any seasoned .NET developer is used to getting their hands dirty by mixing Win32 unmanaged code (necessary for shell/OS integration) with pure .NET managed code. Fortunately this will all soon change with WinFX, a pure .NET “managed” operating system and API, that will finally remove the dependence on Interop, and provide access to the base operating system in managed .NET code"

Also see:
http://blogs.msdn.com/b/somasegar/archive/2006/06/09/624300.aspx

Avalon = XAML

WPF

Wednesday, November 4, 2009

ASP.NET MVC

Scott Mitchell says

"In a nutshell, ASP.NET MVC allows developers much finer control over the markup rendered by their web pages, a greater and clearer separation of concerns, better testability, and cleaner, more SEO-friendly URLs."


and in his first mention of jQuery


" jQuery can certainly be used in an ASP.NET application, although integrating client-side script into a Web Forms application can sometimes be a bit trying. JavaScript development fits more naturally with ASP.NET MVC applications; in fact, the ASP.NET MVC framework includes the jQuery libraries. "


(extracted from 4guysfromrolla.com)

Thursday, February 5, 2009

Javascript Error trapping


onerror=handleErr;
var noErrors = true;

function handleErr(msg,url,l)
{
if(noErrors){
txt="There was an error detected.\n\n";
txt+="Error: " + msg + "\n";
txt+="URL: " + url + "\n";
txt+="Line: " + l + "\n\n";
txt+="Click OK to continue.\n\n";
alert(txt);
noErrors = false;
return true;
}
else{
return true;
}
}