The (Unofficial) ITWorx Technical Architecture Blog

Archive for July, 2007

What are the Best Practices for Versioning?

Posted by archworx on July 5, 2007

Versioning is mainly used to identify multiple revisions of the same unit of information/code. Versioning is the corner stone of Software Development – it is used to differentiate between the different work you do everyday. If you do not version it is almost like you haven’t accomplished anything.

Version number should be stored in object code, for example a .NET assembly.

  • This is so it can be accessed from the code itself. This is important because, for instance you can use it to gauge compatibility with other systems that you need to interact with. For example:

    • If you are using a web service, there should be a way to query the web service’s version number from the web service itself. The Web Service itself may also need to know its client’s version numbers. With this information, you can programmatically control version compatibility, for instance the web service can deny the service to its clients because it knows that it is of an incompatible version.

Version Numbers Must be Unique and non-repeated.

  • No two releases with any differences can hold the same version number. Even if it is just a minor bug fix. Even if it is a spelling mistake.

Version Numbers must be related to the Source Control Label/Tag.

  • This works both ways, for example:
    1. The Source Safe label used in labeling a release should contain the same version number stored in the compiled binary, or part thereof.
    2. The Version Number produced inside the binary must be as closely related as possible to the label/tag name. Ideally part of the version number should be retrieved from the Source Control system. For example, using SourceSafe/KeyWordExpansion

Version numbers must be user accessible.

  • Users of the application must be able to find out which version of the software they are using. Do not hide it from them, and make sure they can access it relatively easily.

Version numbers must be consistent across Configuration Items

  • The version numbers stored inside the product binary must be the same as that reported to the user, as well as being strongly related to the source control label/tag name. The best way to achieve this is via a build control tool such as NAnt and/or Cruise Control for example.

More about Version numbers:

  • Version numbers can look like x.x.x or x.x.x.x depending on mechanism or technology used.

Posted in Configuration Management, MZayet | 10 Comments »

Testing Webservices with NUnit

Posted by archworx on July 1, 2007

Because NUnit is an exe and you sometimes you need to access web.config and objects that are only present in a web context, you will need to do the following:

– Open the command prompt and cd to C:\Program Files\Microsoft Visual Studio 8\VC, or in Visual Studio 2005 Command Prompt, type wsdl url (where url is the WSDL URL). A C# file will be generated with the name of the webservice. You can add some command line arguments to change the file name or the language. Just type wsdl without any arguments to show the help.

– Move the file to your test project and use it. It will call the webservice 🙂

There’s a great article about Implementing Service-Oriented Integration with ASP.NET .. check it out.

Posted in El-Geish, Unit Testing | 4 Comments »