Quality Management ROI Calculator - Focus on Test Automation
The Rational Quality Management ROI calculator is intended to give you an idea of what return you can garner from implementing our functional testing solutions. Our quality management solutions offer tools to develop a continuous process, powered by automation to govern software delivery.
» Gartner MarketScope: Application Quality Management Solutions, 1Q 08
This Gartner MarketScope provides guidance for enterprises seeking to purchase tools to manage risk and software quality. We focus on tools fit for large-scale enterprise use and that are ready out of the box to manage quality requirements and functional testing.
» Whitepaper: Tips for Writing Good Use Cases
Writing a good use case isnt easy, but, fortunately, our experience can be your guide. The concepts and principles assembled here represent the works of many people at IBM, and they form a foundation of proven best practices.
» Whitepaper: The Role of Integrated Requirements Management in Software Delivery
Learn about the critical role integrated requirements management can play in helping ensure your business goals and IT projects are continuously aligned-whether you are sourcing, integrat-ing, building or maintaining your software. It also looks at ways that integration and automation can help ensure managing projects and the required changes can be executed using manageable processes that satisfy stakeholders and development teams.
»
The script in this article will keep your customers on your site
and provide self-service package tracking capabilities for
Federal Express and/or UPS.
Overview
Both UPS and
Federal Express provide
package tracking information on their Web sites. When customers
purchase a product from your e-commerce site, it's preferable,
however, to keep them on your site instead of forcing them to go
off-site to track their package. You can provide this valuable
service to your customers on your site with a Perl script. Users
enter the order number, which is assigned by you and stored in a
comma delimited CSV file which can originate from a database or
spreadsheet. The order number cross-references the corresponding
tracking number for either Federal Express or UPS. The script
then uses the tracking number to look up the latest tracking data
from FedEx or UPS and prints the results to the user's browser.
To get this script to work on your site, put the
tracker.pl script in the cgi-bin
directory on your Web server. You will need a recent version of
Perl installed. If you are running a Windows platform, you can
download Perl from
Activestate; otherwise, you can download Perl from
CPAN. You will also need to download
tracker.csv
and place the file somewhere on your system.
In addition to Perl, you will need the
Business::UPS and
Text::CSV_XS modules, also available from CPAN. If you
are running Perl on a Windows server with
Activestate Perl, you can install the module by typing the
following commands from within a DOS prompt:
Throughout this article, I will be referring to the
numbered source code, so you might want to open this source
in a separate window for reference as we step through the code.
Looking up Tracking Numbers
When a customer places an order, you probably track that
customer's order with a unique number that originates from a
database or e-commerce application. The tracker.pl application
uses this number as a key in the tracker.csv file. This is the
number that the customer will enter on the package tracking form.
You will need to export this unique order number along with the
tracking number for the FedEx or UPS package. The CSV file should
contain 3 fields. The first field is the unique order number. The
second and third fields are the FedEx and UPS tracking numbers
respectively. Either the FedEx or UPS field will contain a value
depending on which carrier you used to ship the package. Below is
a sample tracker.csv file:
The first line of the sample CSV file is order number 123. The
package was shipped via FedEx and the tracking number is
830271123988. The second order number is 321 and was shipped via
UPS; its tracking number is 1Z 644 23W 02 4675 385 5.
The location of this CSV file is set in the
$csv_file variable on line 12 of
tracker.pl. When the customer submits their order
number to the Perl script, we need to parse the CSV file and
lookup the tracking number. To accomplish this, I created the
&get_tracking_num subroutine located on lines
41-58. Line 43 opens the CSV file and line 44 creates a new
instance of the Text::CSV_XS module. This module provides the
function to easily parse almost any type of CSV file, whether it
was created by a database export or a spreadsheet program. On
line 46, we loop over each line of the program, parse the line on
line 47 with the parse() method, and grab the fields
for the record with the fields() method on line 48.
If the order number that we are searching for matches the order
number in the record on line 49, we return the FedEx (or UPS)
tracking number to the caller.
Keeping this CSV file is beyond the scope of this article and
will be maintained automatically or manually by you. This script
only reads from it to determine what the tracking number is for
the order.