Posts

Showing posts from 2005

New home for Cheesecake and Sparkplot

As Titus mentioned in a recent post, I've been moving two of my projects over to a Linux VPS server from JohnCompanies. The two projects are Cheesecake and Sparkplot. They each have their own domain name (pycheesecake.org and sparkplot.org) and they are each running on their own Trac instance. Thanks to Titus for setting up a huge amount of packages and server processes in an amazingly short amount of time (and I'm talking HUGE amount: Apache 2, Subversion, Darcs, tailor, Trac with WSGI, SCGI, and the list goes on.)

I also want to thank Micah Elliott for providing a temporary home for Cheesecake at TracOS. I prefer to have my projects on a server that's co-located though, and I also want more control over the environment (I have a sudo-level account on the new VPS server).

Update 12/23/05: Thanks to Ian Bicking's suggestion, I reorganized the project under Subversion so that it now includes trunk, branches and tags directories.

You can check out the main trunk of the Chee…

More Cheesecake bits

Thanks to Michael Bernstein for updating the Index Measurement Ideas Wiki page for the Cheesecake project with some great information regarding standard file naming practices. He cites from ESR's The Art of Unix Programming, namely from Chapter 19 on Open Source:
Here are some standard top-level file names and what they mean. Not every distribution needs all of these. README - The roadmap file, to be read first. INSTALL - Configuration, build, and installation instructions. AUTHORS - List of project contributors (GNU convention). NEWS - Recent project news. HISTORY - Project history. CHANGES - Log of significant changes between revisions. COPYING - Project license terms (GNU convention). LICENSE - Project license terms. FAQ - Plain-text Frequently-Asked-Questions document for the project. Clearly not all these files are required, but this confirms Will Guaraldi's idea of adding points to the Cheesecake index if at least a certain percentage of these (and other similar) files i…

A whiff of Cheesecake

I've been pretty busy lately, but I wanted to take the time to work a bit on the Cheesecake project, especially because I finally got some feedback on it. I still haven't produced an official release yet, but people interested in this project (you two know who you are :-) can grab the source code via either svn or cvs:

SVN from tracos.org:
svn co http://svn.tracos.org/cheesecake CVS from SourceForge:
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/cheesecake co -P cheesecake

(all in one line)
Here are some things that have changed:
The cheesecake module now computes 3 partial indexes, in addition to the overall Cheesecake index (thanks to PJE for the suggestion):an INSTALLABILITY index (can the package be downloaded/unpacked/installed in a temporary directory)a DOCUMENTATION index (which of the expected files and directories are present, what is the percentage of modules/classes/methods/functions with docstrings)a CODE KWALITEE index (average of pylint score)
The license f…

Damian Conway on code maintainability

One of the random quotes displayed in Bugzilla:

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." -- Damian Conway

Swamped and stuff

Just when I was getting into a rhythm with my blog postings, I had to drop out for a while because of increased work load. Plus I started to work with Titus on an application we'll present at our "Agile development and testing in Python" tutorial at PyCon 06. And here's where the "stuff" part of the post comes into play. We've been developing and testing for a week now, and it's been a most enjoyable experience. I won't go into details about the app itself, which is still in its infancy/prototype stage, but here are some methodology ideas we've been trying to follow:
1-week iterations We release working software every 3 weeks 10 iterations and 3 releases until Feb. 23rd (PyCon'06 tutorial day) Enter releases as milestones in Trac Features are developed as stories A story should fit on an index card During each iteration, one or more stories are completed A story is not completed if it is not tested Two types of tests per story Unit tests…

First consumer of Cheesecake spotted in the wild

That would be Will Guaraldi, the main developer of PyBlosxom. In a recent blog post, he talks about using the Cheesecake metrics as an indicator of the 'kwalitee' of his software. I'm glad to see that somebody is actually using this stuff, it motivates me to keep working on it. I also welcome comments such as the ones made by PJE:

I wouldn't take the Cheesecake metrics too seriously at this point; there are too many oddly-biased measurements in there. For example, to score all the points for documentation, you'd have to include both a News and a Changelog, as well as a FAQ, Announce, and a Thanks - to name just a few. Including that many files for anything but a huge project seems counterproductive. PyLint is also incredibly picky by default about things that really don't matter, and you're also being penalized for not including ez_setup.py even though you're not using setuptools. (On the flip side, you're given 10 points free for having PKG-INFO, wh…

More updates to PTTT

The Python Testing Tools Taxonomy Wiki has seen more updates recently. Here are some examples:
Kent Johnson added two "miscellaneous" Python testing tools: HeapPy, written by Sverker Nilsson, and PySizer, written by Nick Smallbone; both tools aid in debugging, profiling and optimizing memory usage issues in Python programsNed Batchelder added Pester, a Python port of a very interesting Java tool called Jester, written by Ivan Moore; the idea behind Jester is to mutate the source code, then run your unit tests and find those tests that don't fail and should failDave Kirby added Python Mock, a tool he wrote that enables the easy creation of mock objectsInspired by Dave's reference to mock objects, I added another mock-related Python tool I came across: pMock, written by Graham Carlyle and inspired by the Java jMock library

RegExLib

Came across RegExLib.com, which seems pretty useful if you don't want to reinvent the wheel every time you need a regular expression for things such as phone numbers, zip codes, etc.

Jim Shore on FIT and Agile Requirements

Jim Shore just posted a blog entry with links to many of his articles/essays on FIT and Agile Requirements. Mandatory reading for people interested in agile methodologies and acceptance testing with FIT.

Tutorial at PyCon 2006

Titus and I will be giving a tutorial at PyCon 2006: "Agile development and testing in Python". The tutorial will happen only if there will be enough interest -- so if you're planning on going to PyCon next year, I urge you to sign up :-) It will be on Thursday Feb. 23rd, on the day before the conference starts. It should be a fun and interactive 3 hours.

Here is the outline we have so far. If you're interested in other topics related to agile methodologies applied to a Python project, please leave a comment.
Agile development and testing in PythonWe will present a Python application that we developed together as an "agile team", using agile development and testing approaches, techniques and tools. The value of the tutorial will consist on one hand in detailing the development and testing methodologies we used, and on the other hand in demonstrating specific Python tools that we used for our development and testing. We will cover TDD, unit testing, code cover…

Splunk'ed

Image
Via an email from SourceForge, I found out about splunk, a piece of software that indexes and searches log files (actually not only logs, but any "fast-moving IT data", as they put it). I downloaded the free version and installed it on a server I have, then indexed the /var/log/messages file and played with it a bit.

Here is the search results page for "Failed password". A thing to note is that every single word on the results page is clickable, and if you click on it a new search is done on that word. If you want to add the word to the current search words, click Ctrl and the word, or if you want to exclude the work from the search, click Ctrl-Alt and the word.




Pretty impressive. It uses various AJAX techniques to enhance the user experience, and best of all, part of the server software is written in Python! The search interface is based on Twisted:

root 504 1 0 11:26 pts/0 00:00:04 python /opt/splunk/lib/python2.4/site-packages/twisted/scripts/twistd.py --pidfile=/o…

New home for Selenium project: OpenQA

I just found out yesterday that the Selenium project will have a new home at the OpenQA site.

OpenQA is a JIRA-based site created by Patrick Lightbody, who intends it to be a portal for open-source testing-related projects. Selenium is the first such project, but Patrick will be adding another one soon: a test management application he's working on.

I'll be copying over some Wiki pages from the current Selenium Confluence wiki to the new Open QA wiki. OpenQA is very much a work in progress, so please be patient until it's getting fleshed out some more.

QA Podcast with Kent Beck

Nothing earth-shattering, but it's always nice to hear Kent Beck's perspective on XP and testing.

Xooglers

Fascinating blog I came across a couple of days ago: Xooglers (which stands for "ex-Googlers"). A real page-turner about the anticipated ups, but mostly about the unexpected downs of life as a Googler.

Updates to PTTT

...where PTTT stands of course for Python Testing Tools Taxonomy. I'm glad to see that people are updating the Wiki page and adding more stuff to their tool description or adding other tools to the list. Some examples:
Ori Peleg updated the description of his TestOOB tool: "unittest enhancements; test filtering via regex/glob patterns; reporting in XML/HTML; colorized output; runs pdb on failing tests; run in parallel in threads/processes; verbose asserts; report failures immediately; and a little more;"Ian Bicking added his paste TestFileEnvironment tool ("A simple environment for testing command-line applications, running commands and seeing what files they write to")Geoff Bache added his TextTest tool, an acceptance testing tool "written in python but it can be used to test programs written in any language. Comes with extensive self tests which serve as examples of how to use it, ie how to test a non-trivial application with a pyGTK GUI"; TextTest l…

Martin Fowler on In-Memory Databases and Testing

Just came across Martin Fowler's post on In-Memory Databases. I was glad to see his mention of Firebird, which has been a favorite of mine for a number of years. Fowler talks about the primary use of in-memory databases: testing, or to be more precise test-driven development, where speed is of the essence. He also mentions SQLite, which I've only recently started playing with, mainly by going through the Django tutorial. I'd like to explore it further though in the context of testing.

Python Testing Tools Taxonomy

There's been a flurry of blogposts recently on the subject of Python testing, especially on Web application testing tools. I thought it would be a good idea to put up a Wiki page with the tools I know of, so that anybody who's interested in contributing to the "Python Testing Tools Taxonomy" can do so easily. Here is what I have so far. Feel free to modify it.

Update 05/01/06

The PTTT page has moved here. Please update your bookmarks etc.

Cheesecake project update

Micah Elliott graciously offered to host my Cheesecake project at his TracOS site, a Trac-based Wiki that hosts a collection of Open Source projects. Check out the brand new Cheesecake home page and let me know what you think. I haven't had time to properly package my code (which is kind of ironic, considering that checking packages for their 'goodness' is after all the goal of the Cheesecake project), but you can grab the source code via subversion:
svn co http://svn.tracos.org/cheesecake I'll put the code up on SourceForge too at some point, but it seems to me that the Trac-based Wiki is much more "agile" than the SourceForge interface, so I'll make TracOS the primary home for my project.

Bob Koss on "Refrigerator Code"

Seen via Jeffrey Fredrick's blog: Bob Koss talks about Refrigerator Code, i.e. code that you're so proud of that you're ready to put it on the refrigerator, next to your kids' drawings. Nice metaphor. It reminds me of an expression used by the late Chick Hearn, the famous play-by-play announcer for the Lakers: "This game is in the refrigerator!"

Lightning Talks session at Star West 2005

Yesterday I gave a 5-minute Lightning Talk on Selenium at the Star West 2005 testing conference in Anaheim. There were 9 speakers in all, coordinated by Erik Petersen. It was my second Lightning Talk experience, after the one at PyCon 2005 earlier this year. It wasn't quite as interactive as at PyCon, mainly because it was based on slides rather than live demos (I did do a live demo of Selenium though), but it was still very interesting and intense. Erik made it even more fun by introducing every speaker with a little Vegas-style tune that evoked the Rat Pack's apparition on the stage.

My favorite presentation was Rob Sabourin's, who talked about the Iron Ring given to all Professional Engineers in Canada during a secret "Calling of the Engineers" ceremony. The ring is made of iron and is initially very coarse, but the engineers who receive it are supposed to wear it permanently on their working hand, so in time it becomes round and smooth. It is a symbol of pride…

Agile Dilbert

Article on All-pairs testing technique

From the agile-testing mailing list, courtesy of Todd Bradley, here's a link to a PDF version of an article by Bernie Berger on the All-pairs testing technique. If you're a tester, you need to get acquainted with this technique, so that you can mitigate the combinatorial explosion of your test cases.

Exciting times in the Python testing world

If you are a developer or tester using Python, you live in exciting, ebullient times. There are Python-based testing frameworks newly-announced or recently-updated almost every day. Here is a rundown of the latest I'm aware of:

Unit testing
py.test: no recent new release, but changes are happening almost daily in svnTestOOB: version 0.7 was released recently (TestOOB is an enhancement to the standard unittest module, offering many features that py.test offers)nose: version 0.7.2 was freshly released yesterday (nose, in its author's words, "provides an alternate test discovery and running process for unittest, one that is intended to mimic the behavior of py.test as much as is reasonably possible without resorting to too much magic"; nose will become, if it's not already, the official test framework for TurboGears)Web application testing
twill: version 0.7.4 was released on Nov. 11th, with unit tests that use nose, and with new commands to help developers use twill t…

SoCal Code Camp

From the xpsocal mailing list: the Southern California Code Camp will be held on Jan.21-22 2006 at Cal State Fullerton. I checked out the Sessions page and the organizers say "All technologies are welcome C++, C#, VB.Net, Java, Ruby, COBOL???, SQL, etc... if it is code... we want it." I noticed at least one glaring omission (what? no Python?) so I decided to remedy it by sending a proposal for a Python session, which is basically my PyCon 2005 talk on "Agile testing with Python test frameworks". Let's see if they go for it.

ibofobi's Django doctest framework

In the "This is way too cool" category: a new doctest-based framework for testing your Django apps. Other than doctest, it also uses Beautiful Soup and YAML. I need to check it out at some point.

Drucker on agility and testing

The other day I picked up a copy of "The Daily Drucker" from the local library. It was again one of those fortuitous events, almost as if the book told me to pick it up from the shelf. I had another similar experience last year at the same library when I picked up "XP Explained", so I think it's particularly fitting to find references to agility and testing in Drucker's ideas. I don't think Peter Drucker needs any introduction, but I have to confess I haven't read any of his books yet (although this is about to change!). "The Daily Drucker" is a collection of fragments from his books, put together in "a thought a day" format that's pretty agile in itself :-)

Here's what Drucker has to say on organizational inertia: "All organizations need to know that virtually no program or activity will perform effectively for a long time without modification and redesign. Eventually every activity becomes obsolete."

These are s…

"Articles and tutorials" page updated

Configuring Apache 2 and Tomcat 5.5 with mod_jk

Update May 15th 2007

If you're interested in setting up Apache virtual hosts with Tomcat 5.5 and mod_jk, check out my recent blog post on that subject.

I recently went through the painful exercise of configuring Tomcat 5.5 behind Apache 2 using the mod_jk connector. I had done it before with mod_jk2, but it seems that mod_jk2 is deprecated, so I wanted to redo it with the officially supported mod_jk connector. Although I found plenty of tutorials and howtos on Google, they all missed some important details or were not exactly tailored to my situation. So here's my own howto:

Step 1: Install Apache 2

I won't go into many details, as this a very well documented process. I installed httpd-2.0.55 and I used the following configuration options:

./configure --enable-so --enable-mods-shared=most

In the following discussion, I will assume that Apache 2 is installed in /usr/local/apache2.

Step 2: Install JDK 1.5

In my case, I put the JDK files in /usr/local/java and I added this line to …

Mailing lists for Cheesecake project at SourceForge

At Titus's prompting (he challenged me to be a Real Man and not use wimpy Forums but Mailing Lists), I created two mailing lists for the Cheesecake project at SourceForge.net: cheesecake-devel and cheesecake-users. Feel free to check them out and contribute if you're interested in this project.

Proper location for LICENSE, CHANGELOG and other files?

What do people think should be the proper location for files such as LICENSE, ANNOUNCE, CHANGELOG, README?

Some projects have them in the top-level directory, some have them in a sub-directory such as 'docs'. Currently the Cheesecake index penalizes projects that do not have these files in the top-level project directory.

If you have any ideas, please leave a comment here or, even better, post to this Cheesecake Open Discussion thread.

Update: I also created two mailing lists for the Cheesecake project at SourceForge.net: cheesecake-devel and cheesecake-users.

Recommended blog: Maeda's 'Simplicity'

"Thoughts on Simplicity" is the blog of John Maeda, a professor at the MIT Media Lab. I've been reading it for a couple of months and I always take away intriguing ideas, especially about how to strive for simplicity and elegant design in our cluttered and complex world.

Maeda periodically posts his Laws of Simplicity and he says he'll stop the blog when he'll reach the sixteenth. He's now up to ten. Here is Maeda's Tenth Law of Simplicity:

Less breeds less; more breeds more.
Equilibrium is found at many
points between less and more,
but never nearest the extrema.

Ward Cunningham joins the Eclipse Foundation

It seems that Microsoft is not that agile-friendly after all...See this article (via Grady Booch's blog): "Father of Wiki Quits Microsoft; Moves to Open-Source Foundation"

Cheesecake project on SourceForge

I registered Cheesecake at SourceForge. People interested in the idea of putting together a "Cheesecake index" that measures the goodness of Python projects are welcome to post in the Open Discussion forum. I got things going there by posting a few ideas contributed by Micah Elliott. If you're interested in participating in the project, send me an email at grig at gheorghiu dot net and I'll add you to the developer list.

Jakob Nielsen on Blog Usability

Usability guru Jakob Nielsen talks about "Weblog Usability: The Top Ten Design Mistakes". I guess I'm guilty of #1 (no author bio), #2 (no author photo) and #10 (generic blog domain name). Oh well, nobody's perfect :-)

Article on Selenium in October issue of "Better Software"

My "Tool Look: A Look at Selenium" article was published in the Oct. 2005 issue of Better Software. I can now post a PDF version of the article that you can download from here. The "Sticky Notes" are online:
Example of a Selenium test tableMore on the syntax of Selenium commandsMore on the Selenium Twisted implementationGetting started with Selenium

Cheesecake: how tasty is your code?

Update 3/20/06: I'm republishing this post in order to fix this blog's atom.xml index file by getting rid of some malformed XML.

Our friends in the Perl community came up with the concept of KWALITEE: "It looks like quality, it sounds like quality, but it's not quite quality". Kwalitee is an empiric measure of how good a specific body of code is. It defines quality indicators and measures the code along them. It is currently used by the CPANTS Testing Service to evaluate the 'goodness' of CPAN packages. Here are some of the quality indicators that measure kwalitee:
extractable: does the package use a known packaging format?has_version: does the package name contain a version number?has_readme: does the package contain a README file?has_buildtool: does the package contain a Makefile?has_tests: does the package contain tests? I think it would be worth having a similar quality indicator for Python modules. Since the Python CPAN equivalent is the PyPI hosted at…

Software Test and Performance magazine

Came across stpmag.com via a blog post by Alexander Podelko. The neat thing is that you can download all back issues in PDF format. I checked out the October issue and it has some really interesting articles on performance testing, and also on agile software development -- which is very aptly compared to candlestick making (dip a string in wax, get a prototype of a candle, repeat until you get a finished candle while always having a 'working' candle in your hands).

Mini HOWTO #3: compiling and installing a custom Linux kernel

Go to the /usr/src/linux directory, where linux is a link to the appropriate kernel version (e.g. /usr/src/linux-2.4)Edit the EXTRAVERSION line of /usr/src/linux/Makefile. Change the definition for EXTRAVERSION=versionnumber to something that uniquely identifies your kernel, for example EXTRAVERSION=RHcustom.Run make mrproperto ensure your source files are in a consistent and clean state.Save a copy of the old configuration file /usr/src/linux/.config to a secure location.If you want to reuse an old configuration file as a starting point, copy it to /usr/src/.config and run make oldconfigCustomize the kernel. Use make configfor a text-based interface, make menuconfigfor a curses-based interface or make xconfig for an X-based interface. Select all desired/needed options.Run make depto set up all dependencies correctly.Run make bzImageto create a gzip-compressed kernel image file. This will compile the kerne…

Mini HOWTO #2: system monitoring via SNMP

Goal: We want to monitor system resources such as CPU utilization, memory utilization, disk space, processes, system load via SNMP

Solution: Install and configure Net-SNMP

1. Install Net-SNMP
if installing from source, the configuration file snmpd.conf will go into /usr/local/share/snmpby default there is no configuration file; it can be generated via the snmpconf Perl utility2. Configure Net-SNMP by editing /usr/local/share/snmp/snmp.conf

2a. Keep things simple with access control; the following entries can be defined (as opposed to more complicated com2sec, group etc.):

# rwuser: a SNMPv3 read-write user
# arguments: user [noauth|auth|priv] [restriction_oid]
rwuser topsecretv3

# rouser: a SNMPv3 read-only user
# arguments: user [noauth|auth|priv] [restriction_oid]
rouser topsecretv3_ro

# rocommunity: a SNMPv1/SNMPv2c read-only access community name
# arguments: community [default|hostname|network/bits] [oid]
rocommunity topsecret_ro

# rwcommunity: a SNMPv1/SNMPv2c read-w…

Mini HOWTO #1: chroot-ed FTP with wu-ftpd

Scenario: We have an Apache server whose DocumentRoot directory is /var/www/html. We have wu-ftpd running as the FTP server.

Goal: We want developers to be able to access /var/www/html via ftp, but we want to grant access only to that directory and below.

Solution: Set up a chroot-ed ftp environment

1. Create special 'ftpuser' user and group:

useradd ftpuser

2. Change /etc/passwd entry for user ftpuser to:

ftpuser:x:501:501::/var/www/html/.:/sbin/nologin

(note the dot after the chroot directory)

3. Add /sbin/nologin to /etc/shells.

4. Create and set permissions on the following directories under the chroot directory:

cd /var/www/html
mkdir -p bin dev etc usr/lib
chmod 0555 bin dev etc usr/lib

5. Copy ls and more binaries to the bin subdirectory:

cp /bin/ls bin
cp /bin/more bin
chmod 111 bin/ls bin/more

Also copy to usr/lib all libraries needed by ls and more. Do "ldd /bin/ls" to see the shared libraries you need to copy. For example:

-rwxr-xr-x 1 root root 495474 Jan 7…

System administration and security mini HOWTOs

Over the years I kept notes on how to do various sysadmin/security-related tasks. I thought it might be a good idea to post some of them on this blog, both for my own reference and for other folks who might be interested. The first "Mini HOWTO" post will be on setting up a chroot-ed FTP environment with wu-ftpd.

Configuring OpenLDAP as a replacement for NIS

Image
Here's a step-by-step tutorial on installing OpenLDAP on a Red Hat Linux system and configuring it as a replacement for NIS. In a future blog post I intend to cover the python-ldap package.

Install OpenLDAP
Download openldap-stable-20050429.tgz Build and install # tar xvfz openldap-stable-20050429.tgz
# cd openldap-2.2.26
# ./configure
# make
# make install

Configure and run the OpenLDAP server process slapd
In what follows, the LDAP domain is 'myldap'
Change the slapd root password: [root@myhost openldap]# slappasswd
New password:
Re-enter new password:
{SSHA}dYjrA1-JukrfESe/8b1HdZWfcToVE/cC
Edit /usr/local/etc/openldap/slapd.conf Change my-domain to myldap Point 'directory' entry to /usr/local/var/openldap-data/myldap Point 'rootpw' entry to line obtained via slappasswd: 'rootpw {SSHA}dYjrA1-JukrfESe/8b1HdZWfcToVE/cC' Add following lines after 'include /usr/local/etc/openldap/schema/core.schema' line: include /usr/local/et…