Greetings, Christoph,
Thanks for writing with your questions. Here's some hints. I am cc'ing the
hackystat developer's list so they can keep up with your progress.
--On Tuesday, December 27, 2005 3:14 PM +0100 Christoph Ullwer
<[EMAIL PROTECTED]> wrote:
Dear Prof. Johnson,
Within the scope of my diploma thesis, I'm trying to implement a sensor
for the OpenOffice.org suite. After gaining some experiences with your
Hackystat framework, I was building some main functionality of my sensor.
But there are still some questions and problems and it would be very
kindly, if you could give me some hints. By the way: I am a student of
computer science at the Otto-von-Guericke-University Magdeburg, Germany (
http://www.uni-magdeburg.de/?lang=en ). My custodians are Prof. Reiner
Dumke and M. Sc. Martin Kunz from the Software Engineering Group (
http://wwwivs.cs.uni-magdeburg.de/sw-eng/agruppe/Eindex.shtml ).
So here are some of my questions:
1. )
The user of OpenOffice.org should get some feedback, to check the sensor
is installed properly. Therfore some information is printed on a dialog
box, when clicked. I try to get the HACKYSTAT_KEY of the
sensor.properties file to obtain and print out the current user Email.
But I encountered some problems with that key, because an User instance
from the UserManager does work with a different key!
Here some example source code:
SensorProperties sensorProps = new SensorProperties("openoffice");
User user = UserManager.getInstance().getUser("[EMAIL PROTECTED]");
<code snipped>
The problem here is that the User and UserManager abstractions are
server-side entities, and you are trying to manipulate them on the client
side (i.e. within the sensor). That's why you get strange results.
I suggest that initially you don't bother to try to get the user email
corresponding to the user key on the client side. Just provide feedback in
terms of the user key. Later, if you decide you really want to get the user
email corresponding to the user key, you'll need to make a request to the
hackystat server to get it. I can give you more details on how to do that
later.
2.)
While playing around with the MS Office 2000 sensor, I figured out, that
a statechange event only is registered, after saving a modified file. I
guess that the size of the buffer isn't really computed from buffer, but
from the file on the disk, whose size only changes after a save event. In
OpenOffice I have a similar problem, because getting the buffer-size
seems to be not so easy and it is more difficult to make a conclusion
from this size (because of OLE Objects, compressed file size, etc.). So
here is my question: Is it really appropriated to check the size of the
file, instead the size of the buffer? A user could write an Office
document for half an hour without saving (which is of course in the case
of power blackout bad). But Hackystat would monitor this user as not
working, which is in fact not true!
Yes, you're absolutely right, and in fact I didn't know that the MS Office
sensor was calculating state change that way! Other IDE sensors do in fact
check the buffer size rather than the disk file size, which is of course
the more appropriate way to do it. (Actually, in terms of deciding to emit
a state change event, you could do other things as well depending upon the
facilities provided by the IDE. For example, Emacs automatically saves the
timestamp associated with the last keystroke, which would be another good
way to decide about state change.) Note that you also have to determine
the active buffer as well as whether anything has changed for the purposes
of computing active time.
More info about the active time abstraction is available here:
<http://hackystat.ics.hawaii.edu/hackystat/docbook/apbs02.html>
3.)
I try to integrate the sensor in the Hackystat framework, i.e. installing
the sensor via the hackyInstaller jar (and maybe automatically hot-deploy
it together with the Hackystat framework). Unfortunately I couldn't find
any tutorial for integrating a sensor in the framework (e.g. deploy it in
the tomcat server) and all I do is more like guessing than knowing, how
this could work. What I've done so far is:
- putting a installer.openoffice.xml in an subdirectory of
sensorshell.jar (is this necessary?) and contained in
sensor.openoffice.jar - putting a sensor.openoffice.xml into
sensor.openoffice.jar
- putting the sensor.openoffice.jar into directory
jakarta-tomcat\webapps\hackystat\WEB-INF\sensor
Did I forget anything? Actually I don't really know if this manual way is
the appropriated, but it seems to work. I just don't know, how to
integrate and build it automatically via ant. Maybe you have any
unofficial how to build and integrate your own sensor tutorial?
As a matter of fact, you're the second person in the past couple of weeks
to ask this question! I am working on an enhanced documentation generation
system for Hackystat as we speak, and your tutorial is going to be the very
first new chapter produced once it's available. In the interim, here's the
abbreviated version of the "how to build and integrate your own sensor"
chapter:
1. First off, you should use Version 7 of Hackystat, which was designed
specifically to make third party enhancement easier. So, start off by
downloading the _sources_ of Version 7 from Subversion. See the
Administrator documentation or the http://www.hackystat.org/ home page for
instructions on how to do that.
2. Make sure you can build and run Hackystat from your source distribution,
following the instructions in the Administrator documentation. Remember to
invoke 'ant -f autoconfig.build.xml' to generate the modules.build.xml file
and a sample.hackystat.build.properties file (which you will rename to
hackystat.build.properties.) You can comment out a lot of the modules in
hackystat.build.properties. For your current purposes, I suggest you
comment out all of the hackySensor* and hackyApp* modules, which will leave
just the hackyCore and hackySdt subsystems. That will make the build run
reasonably quickly. To verify your installation and configuration, invoke
'ant -q freshStart all.junit' and that all of the tests pass. (If you run
into any problems while following the administrator documentation, send me
an email and I will help you out.)
3. Once you have your own local configuration of Hackystat V7 running from
sources, the next step is to create a new hackystat module directory
containing your new sensor definition in the same directory as the other
hackystat public modules. Given your email, you will probably want to call
this module/directory hackySensor_OpenOffice. What I suggest you do is
look at the current sensor modules, find one that is close to what you
need, and use it as a template for creating your hackySensor_OpenOffice
module. After creating the appropriate src directory and so forth, there
are two key integration pieces:
(a) the local.build.xml file.
(b) the installer/ subdirectory containing the code for integrating your
sensor into hackyInstaller.
To create appropriate versions of these two components, you might want to
look at a few different hackySensor_* modules and see how they do it, and
then send me an email with your questions. When I write the real
documentation, I will go through this part in detail. It's pretty
straightforward once you know what you're doing. :-)
4. Once you have an initial version of your hackySensor_OpenOffice module
ready for integration, you invoke 'ant -f autoconfig.build.xml' again.
What that will do is "discover" your new module directory, and rewrite the
modules.build.xml file to include references to it for (potential) use in
the build. It will also generate a new sample.hackystat.build.properties
file that includes a line like:
hackySensor_OpenOffice.available=true
You will need to include that line in your hackystat.build.properties file
so that the build system knows to include your new module when actually
doing a build.
5. Now you can actually attempt to build your configuration, using one of
the standard build commands like 'ant -q freshStart all.junit'.
6. Once your module is integrated into the configuration and builds
successfully, the result will be a locally running version of hackystat
(typically at http://localhost:8080/hackystat). You will now want to
manually test your integration by downloading, installing, and running your
OpenOffice sensor from your local version of the system. To do this, you
must first register with your local server and obtain a user key. Next, go
to the 'help page' of your local server, download the hackyInstaller.jar
file, and run it. In the initial screen, change the 'Hackystat Hostname'
field to "http://localhost:8080/", change the Hackystat Key field to your
new local key, and press 'Verify Hackystat host/key' which will both check
the validity and save out your new settings. Next, in the "Sensor
Settings" pane, you should have an entry for "OpenOffice". Select this
entry and press the 'Configure Selected Sensor' button to bring up its
configuration page. Then, install the sensor. Finally, exit
hackyInstaller, run OpenOffice, edit some files for a few minutes, exit
OpenOffice, and see if Activity data has been sent to your local version of
Hackystat.
The hard part, of course, is Step 3, which will be much less hard once I
make better documentation available. Your comments, questions, and
frustrations as you go through this process will help me understand better
what I need to include, so I look forward to your feedback!
4.)
I've been reading your paper Improving Software Development Management
through Software Project Telemetry, which was a good introduction in
this subject matter. Could you tell me some more references about
Software Telemetry in general?
There are a couple of other good references:
- The user guide chapter, which explains how to define telemetry streams
and provides a 'compendium' of examples:
<http://hackystat.ics.hawaii.edu/hackystat/docbook/ch05.html>
- Qin (Cedric) Zhang's Ph.D. proposal, which goes into more detail on the
related research and evaluation methodology for software project telemetry:
<http://csdl.ics.hawaii.edu/Publications/MasterList.html#csdl2-04-16>
Enjoy.
The specs of my system are:
- Win2k (SP4)
- Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
- hackystat-uh-6.8.1014 / hackystat-uh-7.0
- Apache Ant version 1.6.5
- jakarta-tomcat-4.1.31
- eclipse-SDK-3.0.2-win32
A couple of minor changes:
- Use the Version 7 sources from Subversion, not the version 6 or version 7
binary release.
- Use Tomcat 5.5.*
The administrator guide goes through this.
I wish you and your Hackystat crew a happy new years and thanks in
advance! Best regards from Magdeburg (Germany),
Christoph Ullwer
p.s.:
Let me know, if you are interested in the sensor for OpenOffice, so I
could send you the source code, when it's more sophisticated.
Sounds great! We'd be happy to have it.
Good luck and don't hesitate to email me when you have more questions.
Cheers,
Philip