Click here to Skip to main content
15,886,026 members
Articles / Desktop Programming / MFC
Article

Bug Fix Tracking in C# Executable Files

Rate me:
Please Sign up or sign in to vote.
4.06/5 (15 votes)
1 Mar 20043 min read 67.1K   916   15   6
Enter bug fix comments in C# source code and explore it from binary files.

Sample image

Introduction

Bug Fixing is one of the major tasks in Software Development Lifecycle. At testing stage, responsibility of the software developer is not only to fix bugs, but also to do the proper documentation for the fixes. Companies will purchase any popular Defect Tracking Products available in the market to manage Entering, Fixing and Reviewing of the defects. The testers will record the defects found by them, into those Defect Tracking Systems and the developers will fix it and update the Defect Tracking Database with ample Fix details. There are lots of benefits through using a Defect Tracking System. One important factor is that we can implement certain workflow into the system. Also, the bugs can be listed in a specific-centralized place that can be accessed by any members in the project team, and the defects taken care of.

But, think about tracking a bug in a later stage? Consider a situation that, your team had developed an application, tested it, fixed defects reported, and finally released to the customer. What will you do in a later stage, when any of the bugs fixed were not in the right way or created some troubles. The history of the fixed bugs can be taken from the Defect Tracking System but it will give you difficulty in searching those issues in the Source Code or you have to take the history of the check-ins of the source codes from the Source Control System to trace or track the problems. This will make it more time consuming and may give more troubles if you are in a hurry to detach the issues.

How will it be useful for you if you are able to find the bug descriptions within the delivered binary files? I hope it will make your work easier to track the bug fixes you have done in the earlier period, in the delivered binary files.

A solution to track bugs in binary files

Here is a solution to track such bugs within the assembly files, of a project that is developed using C#. Normally for the bug fixes, we will add comments in the code regarding the fix done for that. Instead of giving comments or in addition to giving comments, you can exercise a specific methodology for bug fixes, to quick-track at a later stage in the binary files.

Microsoft .NET provides two functionalities in C# – Attributes and Reflection.

Attributes provide a powerful method to associate declarative information with C# code (types, methods, properties, and so forth). Once associated with a program entity, the attribute can be queried at run time and used in any number of ways.

Reflection is runtime type discovery. That is, using reflection services you are able to load an assembly at runtime and find the classes, methods, properties etc. In addition to finding the types in the assembly, you can also dynamically invoke (late binding) those types.

If you are a beginner to C#, please have an idea about attributes and reflection in C#, before going through the applications provided with this article.

Overview of the applications

Download the application from the link provided.

The download will contain 3 projects:

  • Solution1 – BugFixAttribute: A Class Library application, which defines the BugFixAttribute. This solution contains a class BugFixAttribute, which is inherited from Attribute. The attribute contains members BugNumber, FixedBy, FixedDate, FixDescription. Using properties the values of these members are exposed.
  • Solution2 – TrackBugChanges: A Windows Application, to display the bug details (as attributes) available in a C# assembly file. In this application, you have to give an assembly name (for example, the executable file of Solution3). This application will explore the binary and will show all the bug fixes done on that assembly with class name and method name.
  • Solution3 – DoBugFix: A sample console application, that has bug fix attributes implemented in it. This application will give you an idea about how to use the BugFixAttribute.

In Solution2 and Solution3, the Class Library BugFixAttribute is referred.

Conclusion

Since it is a small application provided with this article, there is no need of explanation of code here. Required comments are added into the class files accordingly.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Program Manager
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralA Brilliant Idea Pin
jabailo22-Jul-04 12:43
jabailo22-Jul-04 12:43 
GeneralRe: A Brilliant Idea Pin
rcardare12-Mar-05 7:40
rcardare12-Mar-05 7:40 
GeneralSorry, but no... Pin
Aurelian Georgescu2-Mar-04 19:51
Aurelian Georgescu2-Mar-04 19:51 
GeneralRe: Sorry, but no... Pin
Simon Segal28-Mar-04 17:21
Simon Segal28-Mar-04 17:21 
GeneralImprovements Pin
Anonymous2-Mar-04 4:39
Anonymous2-Mar-04 4:39 
GeneralRe: Improvements Pin
Jayababu2-Mar-04 5:28
Jayababu2-Mar-04 5:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.