Meta-engineering

I’m beginning to think I should have approached this maths modelling stuff from an engineering point of view: with a requirements document, version control and unit testing. Constructing a reasonably complicated mathematical model seems to have enough in common with software development that such things could be quite useful.

I’m calling this “meta-engineering”, because I’d be engineering the development of a model which itself describes (part of) the software engineering process.

The only problem is that formal maths notation can’t just be compiled and executed like source code, and source code is far too verbose (and lacking in variety of symbols) to give you a decent view of the maths.

Fortunately, Bayesian networks provide a kind of high-level design notation; perhaps the UML of probability analysis. Mine look like some sort of demented public transport system. However, drawing them in LaTeX using TikZ/PGF gives me a warm fuzzy feeling.

What am I doing?

Over the past few weeks I’ve had numerous questions of the form: “how’s your work going?” I find I can only ever answer this with banalities like “good” or “meh”.

It’s not that I don’t know what I’m doing. At any given point in time, I have a list of minor challenges written up on the whiteboard (which accumulate with monotonous regularity). However, my first problem is that I never remember what these are when I’m not actually working on them. I write them down so that I don’t have to remember, of course.

My second problem is that, even if I did remember what I was supposed to be doing, there just isn’t any short explanation. Currently I have on the whiteboard such startling conversation pieces as “Express CI in terms of S and U”. This may or may not tickle your curiosity (depending on how much of a nerd you are), but explaining what it means – and granted, I’ll have to do that eventually anyway – demands as much mental energy as solving the problem itself.

My third problem is  that I regularly shuffle around the meaning of the letters, to ensure I don’t run out of them and also to resolve inconsistencies. I’m currently using the entire English alphabet in my equations and a large proportion of the Greek one, so naming variables is a minor headache in itself. For instance, since I wrote the todo item “Express CI in terms of S and U”, I’ve decided to rename the variable “CI” to “CS“. Also, “S” used to be “T”, and “U” used to be two separate variables. This is mostly cosmetic, but I recoil at the prospect of explaining something so obviously in flux.

I choose to believe that I’ll be able to explain everything once I’ve written my thesis… and hopefully as I’m writing my thesis.

Horrible Java

Apologies to non-geeks. The following Java code determines whether infinity is even or odd. It compiles, runs, finishes immediately, and outputs “false” (meaning that infinity is odd).

class Infinity \u007b static \u0062\u006f\u006f\u006c\u0065\u0061\u006e\u0020\u0065\u0076\u0065\u006e\u003b static
{
    // Configure infinite speed
    System.nanoTime(\u002f\u002a);
    boolean even = true;
    double i = 0.0;
    while(i <= infinity)
    {
        even = !even;
        i += 1.0;
    }
    System.normalTime(\u002a\u002f);
    System.out.println("Infinity is even: " + even);
    System.exit(0);\u007d
}

Yes, it's all smoke and mirrors, but I've been having fun with it.

The Zim desktop wiki

I’ve discovered that Zim is a great little brainstorming tool, for me at least. While I occasionally “think in images”, my brain usually works on words and symbols. A wiki – especially one that sports a LaTeX equation editor – seems to be a powerful way to assist a text-based brainstorming session. Being a desktop application (rather than a web application), Zim is also very simple to set up and use.

I spent today and yesterday using it to construct some arcane maths involving matrix multiplication. Said maths mostly turned out to be wrong, of course, but that’s all part of the process.

Theoretical frameworks, part 3

The first and second instalments of this saga discussed the thinking and writing processes. However, I also need to fess up to reality and do some measuring.

A theoretical framework is not a theory. The point of a theoretical framework is to frame theories – to provide all the concepts and variables that a theory might then make predictions about. (If I were a physicist these might be things like light and mass). You can test whether a theory is right or wrong by comparing its predictions to reality. You can’t do that for theoretical frameworks, because there are no predictions, only concepts and variables. The best you can do is determine whether those concepts and variables are useful. This really means you have to demonstrate some sort of use.

And so it falls to me to prove that there’s a point to all my cogitations, and to do so I need data. In fact, I need quite complex data, and in deference to approaching deadlines and my somewhat fatigued brain, I need someone else’s quite complex data.

The truth is – I’m probably not going to get it; at least, not all of it.  Ideally, I need data on:

  • the length of time programmers take to assimilate specific pieces of knowledge about a piece of software;
  • the specific types of knowledge required to assimilate other specific types of knowledge;
  • the probability that programmers will succeed in understanding something, including the probability that they find a defect;
  • the probability that a given software defect will be judged sufficiently important to correct;
  • the precise consequences, in terms of subsequent defect removal efforts, of leaving a defect uncorrected;
  • the cost to the end user of a given software defect;
  • the propensity of programmers to find higher-cost defects; and
  • the total number of defects present in a piece of software in the first place.

I also need each of these broken down according to some classification scheme for knowledge and software defects. I also need not just ranges of values but entire probability distributions. Such is the pain of a theoretical framework that attempts to connect rudimentary cognitive psychology to economics via software engineering.

With luck, I may be able to stitch together enough different sources of data to create a usable data set. I hope to demonstrate usefulness by using this data to make recommendations about how best to find defects in software.

The university of technology

All Curtin students and staff know about OASIS.

OASIS purportedly stands for “Online Access to Student Information Service” . Is that the best they could do, you ask? Evidentially, that full name is now such an embarrassment that it doesn’t seem to appear anywhere on the official OASIS website. However, I’m still not sure which is sillier – the full title, the abbreviation (a transparent backronym), or the slogan bestowed upon us when it first launched: “One site to rule them all”.

It’s bigger than Jesus!

The centrepiece of OASIS is the OCC (Official Communication Channel), through which students receive official correspondence from the University. Replacing physical mail with electronic mail is commendable, but OCC has two small drawbacks. One is that you can’t choose to receive OCC messages via email, or even to receive email notifications. You must remember to log in to OASIS. The other is best illustrated in the following pie chart, representing all the messages (now archived) I’ve received:

oasis_occ

In the past 27 months, I’ve received 21 useful messages: about 0.18 per week. I realise that at some level the University is obliged to send me the other messages as well, but that’s not the point. Logging into OASIS isn’t hard, but you quickly forget because it’s usually such a fruitless exercise. According to the official policy, one “performance indicator” for the OCC is: “The percentage of students with active OASIS accounts that access their official correspondence at least once per week.” They’re not advertising this metric, of course.

It’s not until a library book is recalled (whether you’re the original borrower or the recaller) that you appreciate the true splendour of the OCC. I simply didn’t know about mine until after fines had already started accumulating, and the person who’d recalled the book probably wasn’t too happy about it either. With email, I’d have returned the book the same day.

Not to be entirely defeated, however, I created a script on my laptop that automatically logs into OASIS for me at 11:30 am each day and forwards all new OCC messages to my email account. The Curtin bureaucracy hasn’t quite mastered that idea yet.

Theoretical frameworks

One of the chapters of my much-delayed thesis describes (or rather will describe) a theoretical framework, which is academic-speak for “a way of understanding stuff” in a given field. In my case, stuff = software inspections, and my way of understanding them is a mixture of abstractions of abstractions of abstractions and some slightly crazy maths, just to give it that extra bit of abstractedness that seemed to be lacking.

It’s very easy when engaged in abstract theorising to forget what it is you’re actually modelling. All those boxes and lines look positively elegant on a whiteboard, but when you come to describe what the concepts represent and how someone would actually use it, things frequently go a bit pear-shaped. The problem, as far as I’ve been able to tell, is the limited short-term memory available for all this mental tinkering. What you need is to keep the concrete and the abstract in your head simultaneously, but this is easier said than done (especially if one’s head is full of concrete to begin with). When the abstract gets very abstract and there’s lots of it, the real-world stuff slips quietly out of your consciousness without telling you.

Sometimes it’s only a small thing that gets you. Sometimes you realise that it all mostly makes sense, if only this box was called something else. Then there are times when you finish your sketch with a dramatic flourish, try to find some way of describing the point of the whole thing, and shortly after sit back in an embarrassing silence.

My latest accomplishment, or perhaps crime against reason, is the introduction of integrals into my slightly crazy maths (already liberally strewn with capital sigmas). An integral, for the uninitiated, looks a bit like an S, but rather pronounced “dear god, no”. You can think of it as the sum of an infinite number of infinitely small things, which of course is impossible. However, it does allow my theoretical framework to abstract… no, nevermind.

Bouncy bouncy

When my housemate told me of his scheme for constructing a physics simulation, I did the only decent thing I could. I stole his idea. I turned to my copy of Serway and Beichner (a ~1600 page physics book that I keep under my pillow for just such emergencies) and sat down to work out how to get 2D circles to bounce off each other in the expected manner. Not that anyone has actually seen two-dimensional circles bouncing off each other in everyday life, what with the universe being three-dimensional and everything, but somehow we still have a conception of what it would be like if it were possible.

This took a surprising amount of math (much of which was admittedly due to a series of mistakes). Collisions must preserve overall momentum and energy, and the direction of acceleration must be determined by the angle of collision. And it’s nice if you can remember the quadratic formula, and work out which of the two answers it gives you is the right one in this circumstance.

Eventually I got it working, using a combination of C++, KDevelop, CMake, SDL and OpenGL, all of which I was using for the first time in years, or in some cases ever. My housemate valiantly tried to suggest the use of autopointers, but I was all learned out at that point. So, having triumphed in two dimensions where others have merely succeeded years or decades ago in three dimensions, I now have a little black window containing 20 or so blue circles of various sizes (and virtual masses) bouncing around and hitting each other.

The algorithm assumes for the moment that a given circle can collide with at most one other circle in every discrete time unit. When multiple simultaneous collisions occur, at least two circles become entwined – partially overlapping. They constantly “collide”, in each and every time unit, each time alternating direction with respect to each other but never gaining sufficient velocity to escape. They each just vibrate back and forth. The net effect is that they become a combined object, which exhibits angular momentum. The two balls spin around each other, with the “heavier” one making less pronounced motions than the “lighter” one. And I haven’t even tried to model angular momentum yet.

The next step will be allowing for multiple collisions with the same object in the same time unit, which should theoretically stop this from happening. But I might just have to preserve the current version.

Corporate websites

Trawling through the sites of three hundred or so ICT companies gives you a new perspective of capitalism. It’s a perspective I could have done without.

It’s not the graphics-heavy sites, or the menus that pop up in inconvenient places, or the occasional horrifying overuse of flash. It’s the way in which corporate PR people stretch the laws of reality trying to make their firm stand out in the crowd while simultaneously studiously avoiding any reference to what it actually does. How do they manage it? The amount of effort that designers of ICT websites go to in pursuit of this infuriating paradox must be extraordinary.

To give you some context, I’m building a list of companies to contact regarding a software engineering industry survey. The companies should therefore be involved, in some small way at least, in software engineering. The list I’m working from is a list of ICT companies, many of whom merely supply software or provide other support services.

Do you think you can tell, just from looking at a company’s website, whether they make software or not? The very companies whose core business created the “information superhighway” seem pathologically unable to inform us of such fundamental facts. Some sites, it should be noted, are very well done and tell you exactly what you need to know. Others – often the ones with sleeker graphics – try exceedingly hard to tell you nothing at all, using terms like “innovation”, “solution”, “dynamic” and “changing environments”. They might indeed provide the most innovative solutions of anyone in dynamically changing environments, but what do they do? They seem to imply that if you don’t understand what they’re talking about you don’t deserve to be viewing their site.

Window focusing

The user interface of OS X has many things to commend it. Its click-to-focus function is not one of them.

OS X, by design apparently, lacks a click-through capability. As far as I can tell there is no way to enable it. This generally means that when you click on a window to select it, the window itself will be blissfully unaware of the event. If you want to press a button in an unselected window, you must click once to select the window and once again to press the button.

As far as I can tell (and I could have missed something here), this is designed to prevent you activating some random hideous piece of functionality by accidentally clicking off the edge of the selected window, on the window underneath. However, while in certain somewhat undesirable states of mind, this subtle obstacle can become unimaginably irritating.

But surely Dave, can’t you just get used to double-clicking to press a button in an unselected window?

But I damn well shouldn’t have to! What if you have more than one screen (something that OS X in general handles quite smoothly)? The whole rationale falls to pieces. You have multiple screens so that you can rapidly switch your attention between multiple windows without worrying about the mechanics of the window manager. That’s not to say I haven’t tried getting used to it, but unfortunately OS X provides only a subtle visual distinction between selected and unselected windows. It’s rather counterintuitive to have to modify your actions based on the colour of the buttons in the top-left of the window.

Even if I did get used to it, I’d still be screwed because if you double-click on an unselected window, the window receives a double-click event, not a single-click, and something unwanted is bound to happen. For instance, my text editor (Smultron) lists the currently-open files down the left side of the window. If you single-click on a filename, that file will be displayed. If you double-click, the file will be displayed in a whole new window. That in itself is a perfectly reasonable and useful thing for a text editor to do, IMO, but couple it with OS X’s window management and it can become a headache.

What you actually have to do is click once to select the window, wait a prescribed amount of time, and then click again to do what you wanted to do. Gah…