Any time you ship your application or make it available to customers and prospects, it is pivotal to test everything thoroughly. The licensing logic added to your application should be included in this testing to help prevent unforeseen issues from arising. This topic will help guide you through this process, and may even serve as a helpful 'checklist' for you to keep track of what test has been done for new and updated applications.
As with any task, it is important to ensure you have the right set of tools to help ensure the task is completed well and efficiently. Here are some types of tools that we can recommend for your consideration.
Although this is not required, using virtualization software to run virtual machines is very helpful for a wide variety of reasons.
Keep in mind that if your licensing requirements call for the detection of virtual machine guest environments to alter the way your licensing logic behaves (or even to prevent the application from running in these environments entirely), you may need to make additional considerations and adjustments for your testing procedures. These adjustments can include creating special test builds which are never publicly released, and could include testing on physical computers in place of or in addition to testing in virtual machine guests.
Microsoft provides for free many Windows versions installed for many different virtual machine players/hosts. These virtual machines are setup with a 90 day evaluation of Windows.
There are many free and commercial tools available for automating your build and testing processes. Some free tools include, but are not limited to, Power Shell scripts or batch files, shell scripts, home-grown scripts and applications you might already have in place. Having scripts related to building and testing helps avoid missing crucial steps to building applications properly, and also helps automate any mundane building and testing tasks. Additionally, unit testing can also help identify potential issues during development, and is a particularly convenient way of testing all possible execution paths in your code. Most integrated development environments (IDEs) have built-in features for assisting with unit testing, and many also have various code analysis features that can also help identify areas of code that could be problematic or be adjusted to follow best practices.
Since every application is different, each will have a different set of tests that should be run before releasing a new build to customers and prospects. Below is a list designed to help you get started on a checklist for testing the licensing features (and potentially other features) in your applications.
When testing activation and Electronic License Management (ELM) features in your application, it is important to test each possible means of performing the tasks that users are allowed/able to perform.
You should perform the tests below with a test system that has a direct Internet connection if you allow activating online. If you allow activation through another system's Internet connection, make sure you test with manual request files while the test system lacks Internet connectivity. Furthermore, if your application supports several different types of licenses (such as full/non-expiring, time-limited, etc...), make sure you also run the tests below for each type of license.
Activation is also possible using a manual numeric challenge-response mechanism called Trigger Codes. Trigger Codes afford your customers the convenience of being able to activate systems which lack Internet connectivity (especially systems in remote locations) by manually exchanging numeric codes with you or your customer service representatives via phone or fax.
Manual activation using Trigger Codes should only be used when absolutely necessary!
Like any other challenge/response scheme, allowing activation via Trigger Codes introduces the potential to be exploited by hackers to make key generators (which are programs that issue unauthorized activations for your application) available. If the customer is able to activate online through another computer, that is a more robust and secure approach for activating disconnected devices or systems.
By definition, a Trigger Code is essentially just an encrypted value which gets decoded to a numeric value between 1 and 50 (which is the Trigger Code number). When processing the activation codes, the resulting Trigger Code number is used to then identify which actions should be taken in your program to alter the state of the application's license. Instant Protection PLUS 3 can process these Trigger Codes. Make sure you test activations with each Trigger Code number supported by your application. Check that the application activates without issue, and make sure the license is altered as intended.
Your application can identify a system which has been activated to ensure its license is only used on the system on which it was activated. You can use the Enhanced Computer ID Algorithms or the Legacy Algorithms, and here is a generalized test for you to consider:
If your application uses time-limited licenses (which are licenses that are only valid for a limited amount of time), then you should test your application's behavior thoroughly.
The safest approach for testing time-limited licenses is to utilize virtualization software. If virtualization software is not an option, then using another computer that is dedicated to testing is recommended. The reasons for this include:
If your application supports multiple types of time-limited licenses (such as an evaluation and an activated, lease or subscription style license), run the tests for each type of license. Before you begin your testing, make sure your test system is not configured to synchronize with network/Internet time. In Windows, you can change this setting in the Internet Time tab located in the same dialog where you can adjust your system's date/time.
If your application requires validating its status with SOLO Server, you will need to make sure you test this functionality with and without Internet connectivity. Here are some tests you can run:
Sometimes it is necessary to use multiple build configurations of an application to produce different builds or releases for various reasons. Reasons could include things like branding changes, using separate builds to omit certain features that are not easily enforced through licensing alone if you are not wrapping (i.e. an evaluation build is sometimes necessary to omit unprotected content), etc... All tests should ideally be performed against all possible build configurations, especially when code is conditionally compiled for different build configurations (typically done via preprocessor directives).
All tests should be repeated for each platform supported. So for example, if your application is supported on Windows 7 and later, you would typically test your application on the 32 bit and 64 bit versions of Windows 7, Windows Server 2008 R2, Windows 8, and Windows 8 Server.
Additionally, if your application supports multiple languages, all tests should be repeated with the typical regional settings expected with each language supported.
Many standard desktop applications exhibit their load on systems during normal use and testing. However, if your application is expected to be run in an environment using terminal services or Citrix, or if your application includes a web application, service, or any multithreaded functionality, it is very important to test your applications performance under heavy use. For example, if your application were to be used by hundreds or thousands of users on a single machine via terminal services or Citrix, frequent license validation (especially validation with SOLO Server) could congest system and network resources.
As you apply changes, updates, and fixes through its lifecycle, it is important to perform regression tests to ensure that recent changes do not introduce new issues. Although it may not be practical to test everything each time a new build is created, it is best to automate as many tests as possible (often done via unit tests) to help prevent the introduction of new issues.
While testing, it is often necessary to create a "clean" installation of your application. By resetting or deleting all license and alias files in the registry, windows folder, and system folder, the licensing will function as if the protected application was run on a computer for the first time. Normally, the license files remain even if you uninstall or delete the application itself, so they must be specifically reset or deleted.
You can revert to a previous snapshot when using a virtual machine, but if you are not using a virtual machine for testing, the following methods allow you to reset the local license files on your development computer or on any computer.
The easiest way to reset licenses is by having Instant Protection PLUS 3 installed on the same machine.
First, close the licensed application you are wanting to reset. Next, in Instant Protection PLUS 3, open your project file from the File / Open menu then use one of the following options:
From the menu, select Product / Reset Product Licenses.
You will be prompted that the licenses have been reset on this computer.
You may now run your application and it will be as if it run for the first time.
There is a similar option that will automatically reset licenses when wrapping an application or saving an XML for use with the Instant Protection PLUS 3 DLL interface.
From the menu, select Tools / Options
In the General tab, enable Reset licenses when injecting/wrapping or saving XML
Uncheck this option to leave any local licenses for the current product as they are when wrapping and saving an XML file.
To reset the local license files on any computer, you can process an activation that uses Trigger Code 49.
If your license is invalid or expired, the activation dialog will be shown at start-up. If the activation dialog is not displaying, just hold down the shift key when you launch your application. This will show the following dialog allowing the licensing dialog to be displayed.
If you have launched with the shift key down, click the Yes button and continue to the licensing dialog.
If you allow manual activations, you can process the manual activation using Instant Protection PLUS 3 and Trigger Code 49.
If using SOLO Server, you can create a Product Option that uses Trigger Code 49. When a License ID is created from that Option, activating with it will reset the local license files.
For testing purposes, you can add a Test License for this Option.
In the SOLO Server menu select Customers / Add a Test License.
A list will be shown with all the products available for adding a license.
With this license, we now have the License ID and Activation Password we need to activate our protected application in order to reset the licenses.
Choose to Activate Online, and enter the License ID and Activation Password for the Reset License. You should get a confirmation that the activation was successful, and once the application is closed and restarted, the licensing will be as if it was run for the first time.