I'm happy to announce the immediate availability of my thesis! It was handed in in July 2010 as my diplom thesis in the academic program of Media Informatics at Beuth Hochschule für Technik Berlin (University of Applied Sciences). A German Diplom is comparable to a combined bachelor's and master's degree. Originally it has been written in German, so I'm very happy it's also available for English speaking readers now: thanks a lot to the awesome Sander Van de Moortel for translating it into English, and to CouchOne for sponsoring the translation. Read also my thank you notes for more gratefulness.
I hope the thesis is an interesting read and useful for your research or development!
If you have a couchapp and want to have nice URLS, go read this blogpost. If you still don't get it, here is how to do it. It doesn't work with my outliner app, because it is so entangled with old couchapp and jquery.couch.js versions and I'm not up to upgrade hell right now. But I'll write it down for my next project and for you, yay.
Let's say you have an app running at http://account.couchone.com/mydb/_design/doingnotes/index.html and want to add the additional URL http://account.couchone.com/index.html. First you have to set up a virtual host. (Want to know why? Go back read the blogpost). If you are using a hosted CouchDB instance and don't have access to the local.ini file, you can also do this remotely:
I'm done!! Three weeks ago I handed in my diplom thesis. The practical part was the design and implementation of a distributed, replicatable outliner with the NoSQL database CouchDB. As theoretical work I evaluated Distributed Systems, CouchDB, various web technologies and programming strategies. I still have to pass the oral exam, but my degree is finally very close - soon I can call myself a graduated computer scientist. Yay!
As soon as academic procedures allow it, I'll publish the text and the source code of the thesis here. Until then I'd like to say thank you to a few people. As the foreword of thesis won't get as much attention as this blog, I'll do it here.
CouchDB stores the information about the database users in a special database, the authentication_db. The default authentication_db is called "_users". So this is where your user data is saved when you sign up without taking care about the details, e.g. when you use the signup method provided by the JQuery HTTP API. Read more about the ways to interact with the authentication_db in the HTTP API documentation (JQuery methods), and read more about general CouchDB security in the CouchDB Wiki or in The Definitive Guide.
How to set the authentication_db
When you e.g. create database users from within your tests, how can you make sure they don't mess up the actual authentication_db, the one the unsuspecting user might use in production?
What is this HTTP API?
Here are the slides. When you have a look at them, make sure to also read the notes (next to the comments), so the slides make sense to you.
To illustrate - "normal" code looks like this:
One major pain at testing with culerity so far was a HtmlUnit bug that causes a ScriptException with PUT AJAX requests in jQuery. When you tried to test an update you got a "java.lang.IllegalArgumentException: The content cannot be null". Fortunately, this bug is fixed now. With latest HtmlUnit build culerity should run fine, and I tell you how.
I narrowed the selection down to those being currently developed, or are in use in "big" projects. JsUnit seems to be one of the major players, but I found almost no documentation, and the code base hasn't changed a lot in the last years. That's not a negative thing in itself, but having an active community around is a good thing. QUnit is used for testing JQuery, it looked like you could work with it as well, but its syntax and setup didn't make me go "wow" exactly. Same goes for JQUnit, about which I had read good stuff in several blog posts. It's also what Sammy.js is tested with.