Sunday, February 06, 2011

How to write a good bug report?

Here is the synopsis on writing a good bug report. Hope you all know about Bugs. Here I’ll tell you how can we write better bug reports and how to use bug tracker.

Why we need a good Bug report?
If your bug report is effective, chances are higher that it will get fixed. So fixing a bug depends on how effectively you report it. If tester is not reporting bug correctly, programmer will most likely reject this bug stating as irreproducible.
1) Reproducible:If your bug is not reproducible it will never get fixed. You should clearly mention the steps to reproduce the bug. Do not assume or skip any reproducing step. Step by step described bug problem is easy to reproduce and fix.
2) Be Specific:Do not write a essay about the problem. Be Specific and to the point. Try to summarize the problem in minimum words yet in effective way. Do not combine multiple problems even they seem to be similar. Write different reports for each problem.
3) Having clearly specified bug number: When you are talking about the bug, identify it with bug number. Ex: Issue 101 etc. This will help to identify the bug record. Note the number and brief description of each bug you reported.

How to Report a Bug in Bug tracker?
While reporting a bug, don’t forget to mention version, Product, component or module, Platform (Ex: Mention the hardware platform where you found this bug. The various platforms like ‘PC’, ‘MAC’ etc.).
Operating system (Ex: Mention all operating systems where you found the bug. Operating systems like Windows, Linux, Unix, SunOS, Mac OS. Mention the different OS versions also if applicable like Windows NT, Windows 2000, Windows XP etc.)
Title: Should be easy specific to the bug.
Priority: When bug should be fixed? Priority is generally set from High to Low.
Status: When you are logging the bug in bug tracking system you can find different status, I have given more detail about test status in my blog here.
Comments: A brief summary of the bug mostly in 60 or below words. Make sure your summary is reflecting what the problem is and where it is.

A detailed description of bug. Use following fields for description field:
Reproduce steps: Clearly mention the steps to reproduce the bug.
Expected result: How application should behave on above mentioned steps.
Actual result: What is the actual result on running above steps i.e. the bug behavior.

URL: The page URL on which bug occurred is always helpful
All your comments will be seen in chronological order.

Attachments: Any screen shot or related document is helpful for developer or your manager. A picture is more powerful than mere words.

History: History will tell you all the activities related to the issue among the users.

Some Bonus tips to write a good bug report:

1) Report the problem immediately: If you found any bug while testing, do not wait to write detail bug report later. Instead write the bug report immediately. This will ensure a good and reproducible bug report. If you decide to write the bug report later on then chances are high to miss the important steps in your report.
2) Reproduce the bug three times before writing bug report: Your bug should be reproducible. Make sure your steps are robust enough to reproduce the bug without any ambiguity. If your bug is not reproducible every time you can still file a bug mentioning the periodic nature of the bug.
3) Test the same bug occurrence on other similar module:
Sometimes developer use same code for different similar modules. So chances are high that bug in one module can occur in other similar modules as well. Even you can try to find more severe version of the bug you found.
4) Write a good bug summary:
Bug summary will help developers to quickly analyze the bug nature. Poor quality report will unnecessarily increase the development and testing time. Communicate well through your bug report summary. Keep in mind bug summary is used as a reference to search the bug in bug inventory.
5) Read bug report before hitting Submit button:Read all sentences, wording, steps used in bug report. See if any sentence is creating ambiguity that can lead to misinterpretation. Misleading words or sentences should be avoided in order to have a clear bug report.

Conclusion:
Your efforts towards writing good bug report will not only save company resources but also create a good relationship between you and developers.

Friday, January 14, 2011

Internet Information Services (IIS) 7.5 Express

Microsoft has released final version of it’s so called lighter version of IIS 7.5 called as “IIS 7.5 Express” which makes developers to utilize the features of IIS 7.5 in Windows XP and above Operating system environments. IIS 7.5 Express is a simple and self-contained version of IIS 7.5 that is optimized for developers. IIS 7.5 Express enhances your ability to develop and test web applications on Windows by combining the power of IIS 7.5 with the convenience of a lightweight web server like the ASP.NET Development Server (also known as Cassini). IIS 7.5 Express is included with Microsoft Web Matrix, an integrated suite of tools designed to make developing web applications on Windows simple and seamless. IIS 7.5 Express can also be used with Visual Studio 2010 as a powerful alternative to Cassini. The benefits of using IIS 7.5 Express include:

  • The same web server that runs on your production server is now available on your development computer.
  • Most tasks can be done without the need for administrative privileges.
  • IIS 7.5 Express runs on Windows XP and all later versions of Windows.
  • Many users can work independently on the same computer.

Download: IIS 7.5 Express Final

Thursday, January 13, 2011

Export GridView to Excel in ASP.NET

Here is the same code to export GridView from C# in ASP.NET

protected void ExportButton_Click(object sender, EventArgs e)
{
   Response.AddHeader("content-disposition", "attachment;filename=Contacts.xls");
   Response.Charset = String.Empty;
   Response.ContentType = "application/vnd.xls";
   System.IO.StringWriter sw = new System.IO.StringWriter();
   System.Web.UI.HtmlTextWriter hw = new HtmlTextWriter(sw);
   ContactsGridView.RenderControl(hw);
   Response.Write(sw.ToString());
   Response.End();
 }
Hope this is useful Just kidding

How to update Web.config dynamically?

I need to update web.config dynamically? So this is what I did, this code below has done the trick for me.

string value = "webmaster@company.com";
Configuration config = webConfigurationManager.OpenWebConfiguration("~");
AppSettingsSection appsetting = config.GetSection("appSettings");
appsetting.Settings("fromAddress").Value = value;
config.Save();
Make sure to add System.Web.Configuration in the namespace. Have fun Light bulb

Thursday, January 06, 2011

assemblyBinding: Using Shared DLLs in .NET

How to Share DLLs in VS 2010. Recently I and my team had a problem working with a Shared DLL. Our developers are saving our project in different locations of our computer. Few are saving in D drive and few in E drive. So while getting latest solution from the Visual source safe some of us are having missing references problem with the DLLs when we have Shared DLLs in a location. So to resolve this we have created a folder in *\bin folder with name Shareddlls and placed all the Shared dls in that folder.

Once we have done this we need to add piece of code in web.config.

 <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="bin;bin/shareddlls" />
    </assemblyBinding>
  </runtime>

This worked perfectly for me. Microsoft rocks. When I first read that .NET assemblies could be "redirected" at runtime, I was stunned and a little bit suspicious. By using Assembly Binding Redirection you can redirect an assembly binding reference to another version of an assembly by using entries in the application or machine configuration files. You can redirect references to .NET Framework assemblies, third-party assemblies, or assemblies of your own application. Each version of the .NET Framework has a machine configuration file, and any redirection information in that file affect all applications running under that version of the .NET Framework.


Redirecting .NET Framework Assembly Binding


The .NET Framework assembly unification model treats all .NET Framework assemblies of a given version, and the runtime of that version, as a single unit. The redirections that occur with this model are the default behavior for the runtime.
There are several ways to instruct the runtime to load a .NET Framework assembly with a different version than that of the loaded runtime:



  • Add settings in the application configuration file.

  • Add settings in the machine configuration file.

  • Create a publisher policy file that is distributed with a component to specify which assemblies a component should use.

A binding redirection in an application configuration file for a unified .NET Framework assembly cancels the unification for that assembly. To redirect an assembly binding reference for an assembly that is not part of the .NET Framework, specify the binding redirection information in the application configuration file using the <assemblyBinding> element.