Selenium RC, Server, and .NET Unit Tests Part 5 – The (Second) Trial Run

August 31st, 2010

By now, I’ve already created a new solution for testing my Selenium Unit Tests.  I named my solution ‘SeleniumTesting.sln’.  I created a new Unit Test Class, and copied the C# code generated by Selenium IDE into my new Unit Test Class.  I renamed the NUnit test attributes to Microsoft Unit Test Attributes (see previous post).  I was to the point of testing, and then I discovered that I hadn’t started Selenium Server.  I ran the server on the same machine on which I had both the Unit Test Solution, my Web Application, and Selenium Server running.  I was just at the point where I needed to run Selenium Server on a separate machine, and test how it worked that way.

Fortunately, I just happen to have a desktop nearby that nobody else is using.  It’s got Windows XP Professional, but I don’t remember seeing any hard and fast limitations to running Selenium server, so I copied the folder from my laptop to the desktop.  I terminal service into the desktop (which I guess you could call a server the way I use it), and go the ‘c:\Selenium\selenium-server-1.0.3′ folder (where I copied Selenium Server to).  I navigated to the folder, and double-clicked on selenium-server.jar.  It’s now up and running.  You can’t really tell, it’s running as a javaw process.  I started the test, and the first thing I noticed was that in my remote desktop, a console popped up along with a web browser.

Selenium Remote Control - Remote Desktop Session

The First Thing I Saw Were A Console And Web Browser

As each command executed, the Command History would display the command.  At the same time, the browser would show the command output.  As I let it run through, everything worked fine until the:

Test method SeleniumTesting.InitialSeleniumTest.TestMethod threw exception:  Selenium.SeleniumException: Timed out after 5000ms.

I tried adding a Click-And-Wait command. Since Selenium is a JavaScript-based tool, I checked my IE version. The desktop was running IE6. I rashly concluded that this was the problem, and proceeded to test again on my laptop, just to be sure. Imagine my surprise when I got the same error, but at a different place in code!!

With some pretty fancy research (if I say so myself – inasmuch as research can be fancy), I discovered the following:

  1. Selenium 1.0.3 does not seem to like IE6. It’s as if the ‘WaitForPageLoad’ gives up the ghost.  I never got it to load successfully.
  2. Depending on network connectivity, Selenium RC varies how quickly it access a page. This means that about half of the time, the client attempts to access the page before the elements are rendered.  WaitForPageLoad is wonky, too, and doesn’t really work with my .NET web application.
  3. selenium.SetSpeed(string) is your friend. This is the way to make sure that the page is loaded before attempting to access an element.  Mine seems to work all right set at “1000″.
  4. selenium.SelectWindow(null) is your friend, too. Believe it or not, every once in a while, the client will lose focus on the browser.  I haven’t yet figured out what it’s focusing on (as I don’t have infinite time), but it seems like, in those cases, SelectWindow(null) is sufficient.
  5. Beware selenium.Select/selenium.Click combinations. ‘Select’ selects an option in drop-down.  ‘Click’ will click an Element.  When recording, if the tester clicks an option, it may record both the act of selection and act of clicking.  In playback, the selection will trigger the click event (in .NET), and the clicking will attempt to click an element which no longer exists because the page is being refreshed if the drop-down has AutoPostback.
  6. For Developers: Beware Dynamically-Named Controls.  Selenium uses a number of things to determine which control you are trying to click.  It seems to check the control ‘id’ attribute first.  If, like we had in some legacy code, someone thinks it’s a good idea to use a GUID.NewGuid().Replace(“-”, “_”) as a control id, smack them on the head.  Offhand, I can’t think of any reason, ever, to do this.  If you have so many controls on your page that you need GUIDs to identify them, your application will most likely not run.  Dynamically-created controls should be named in a predictable, consistent manner, so that Selenium can correctly identify them.
  7. Selenium.SeleniumException: ERROR: Element ctlName not found. This is a common error.  The error happens in response to the selenium.Select/selenium.Click problem I’ve mentioned (5 above), as well as if a page doesn’t load quickly enough.  You can use the
    selenium.WaitForPageToLoad("5000");

    to give yourself more time.  In my situation, I initially got the error so frequently that I almost threw out Selenium as a tool, until I met

    selenium.SetSped("1000");

    . The command sets the delay between actions in milliseconds. Sweet!

So, Selenium, at this point, still seemed promising to me.  Unfortunately, the version of the test that testers would record is going to have to be significantly changed before the test can actually be used as a unit test.  The changes, though, are pretty consistent, and to me, worth the pain in order to have good regression testing.  Selenium is not the be-all-end-all, by any means.  If I had ten-thousand dollars, I would buy something different, possibly.  In the perfect case, I would go ahead and invest in extending our TFS/Visual Studio infrastructure to include Microsoft’s testing package (out w/VS 2010).

For part 6, I’m going to start setting up the infrastructure.  I got our infrastructure guy to set up a virtual server for me, and a virtual workstation.  I’ll keep you posted on how that works out.

Selenium RC, Server, and .NET Unit Tests Part 4 – The Trial Run

August 30th, 2010

For those of you still with me, the last we talked I had recorded a test, and I was preparing to run it.  Then I hit you with a bunch of references and stuff.  Here’s what I ended up with after some cutting and pasting (my Basic C# Selenium Unit Test).

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Selenium;
 
namespace SeleniumTesting
{
    ///
    /// Summary description for UnitTest1
    ///
    [TestClass]
    public class InitialSeleniumTest
    {
        public InitialSeleniumTest()
        {
            //
            // TODO: Add constructor logic here
            //
        }
 
        private TestContext testContextInstance;
        private ISelenium selenium;
        private StringBuilder verificationErrors;
 
        ///
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }
 
        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext) { }
 
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup() { }
 
        // Use TestInitialize to run code before running each test
        [TestInitialize()]
        public void MyTestInitialize() {
            selenium = new DefaultSelenium("localhost", 4444, "*iehta", "http://www.google.com/");
            selenium.Start();
            verificationErrors = new StringBuilder();
        }
 
        // Use TestCleanup to run code after each test has run
        [TestCleanup()]
        public void MyTestCleanup() {
            try
            {
                selenium.Stop();
            }
            catch (Exception ex)
            {
                //ignore errors
            }
            Assert.AreEqual("", verificationErrors.ToString());
        }
        #endregion
 
        [TestMethod]
        public void TestMethod()
        {
            // Open Google search engine.
            selenium.Open("http://www.google.com/");
 
            // Assert Title of page.
            Assert.AreEqual("Google", selenium.GetTitle());
 
            // Provide search term as "Selenium OpenQA"
            selenium.Type("q", "Selenium OpenQA");
 
            // Read the keyed search term and assert it.
            Assert.AreEqual("Selenium OpenQA", selenium.GetValue("q"));
 
            // Click on Search button.
            selenium.Click("btnG");
 
            // Wait for page to load.
            selenium.WaitForPageToLoad("5000");
 
            // Assert that "www.openqa.org" is available in search results.
            Assert.IsTrue(selenium.IsTextPresent("www.openqa.org"));
 
            // Assert that page title is - "Selenium OpenQA - Google Search"
            Assert.AreEqual("Selenium OpenQA - Google Search",
                         selenium.GetTitle());
        }
    }
}

Okay, notice a couple of differences between that one (the one I recorded) and the one I started out with. Note that I am not doing the same thing. I downloaded the later test from Selenium, and use that one because it has more variety in commands, and I was trying to learn the language a little bit too. Also notice the third parameter to the DefaultSelenium constructor:

//old
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://www.google.com/");
 
//new
selenium = new DefaultSelenium("localhost", 4444, "*iehta", "http://www.google.com/");

That’s the money-maker for me. I need to test in Microsoft Internet Explorer. It’s nice to be able to test in Firefox, but IE7 is the target browser for our customers. The third parameter is what sets the browser Selenium will try to load when you run the test. Okay, now look at that first parameter. That’s just the machine you’re trying to get to (not to be confused with the URI you’re trying to get to – fourth parameter). You would have probably figured that out, but you don’t have to.

My script didn’t do anything.  I ran the Unit Test and it failed.  Remember that line, “java -jar selenium-server.jar”.  It turns out, you have to run that before you start the unit test.  That command loads the server and opens up listening on the 4444 port (or whichever port you specify).  Once I started the server and ran the Unit test again, I noticed the test succeeded (with the notable exception that I had to change some of the asserts – the Google return content had changed since that particular unit test was available for download).

That’s good stuff.  I had a running server, I ran the test, got a success notification.  Now I had a baseline test to see if I had my server set up correctly.  The test was insufficient, though.  I had an entire testing architecture in my head, and part of that was for the Selenium server to be on a server machine.  The reason for this was because our production-quality code had to use client certificates.  No matter how good a product is, once certificates get involved, things get interesting.  Selenium, it turns out, does not support X.509 certificates.  That’s not a problem.  Situations like that are exactly why Microsoft invented compilation constants (that’s a joke – don’t kill me).  In the appropriate mode, I can display a list of users to select from, or allow a tester to login as whatever role they want, through the user interface.  Consequently, if I want to test other than end-production-quality code, I’ve got to have a place to put it.  If I leave it on my machine, then my testers can’t get to it, and that creates a lot more work for me, as opposed to helping either me or them out at all.

I’ll fill you in on how that went next time.  I did learn some more interesting stuff.

Selenium RC, Server, and .NET Unit Tests Part 3 – Information Only

August 30th, 2010

This page contains a list of Selenium-related stuff I found important enough to record.  You can skip this one if you want to.

  1. The Selenium Server has two parts, a server, and a client library.  That reminds me, all of the client libraries are version 1.0.1, with no intention of updating any time soon.
  2. Download Selenium RC. If you want to follow with what I did, you’ll want to do this.
  3. Extract to c:\Selenium.  This should give you the following subdirectories:  selenium-dotnet-client-driver-1.0.1/, selenium-java-client-driver-1.0.1/, selenium-perl-client-driver-1.0.1/, selenium-php-client-driver-1.0.1/, selenium-python-client-driver-1.0.1/, selenium-ruby-client-driver-1.0.1/, selenium-server-1.0.3/.  In the ‘selenium-dotnet-client-driver-1.0.1/’ folder, you should see: ThoughtWorks.Selenium.Core.dll, and ThoughtWorks.Selenium.UnitTests.dll.
  4. Detailed installation instructions (the ones I followed) are at: http://seleniumhq.org/docs/05-selenium-rc.html.
  5. The command I used to start the server was: java -jar selenium-server.jar.  You can also double-click if you have java associated with .jar files.
  6. Selenium does *not* have to run on N-Unit.  The framework can be run from any C# (started narrowing down) application.
  7. .NET Client Configuration on: http://seleniumhq.org/docs/appendix_installing_dotnet_driver_client.html#configuring-selenium-rc-net-reference.

Contact Map Prediction Part 2 – What I Didn’t Know

August 30th, 2010

You could write books about what I didn’t know about contact map prediction.  I thought I knew some things, but it turned out I was wrong about those.

I thought (for instance) initially that PSI-BLAST was a central server where I go to get Protein 3-D Structure files.  I eventually discovered that PSI-BLAST is where you go to get 3-D predictions, not authoritative files.  Worse than that, PSI-BLAST isn’t even a server, it’s an algorithm.  The tool is actually BLAST (Basic Local Alignment Search Tool), and the ‘PSI’ part of that is for ‘Position Specific Iterative’, meaning exactly what it says.  PSI-BLAST is a refined BLAST algorithm (in a way).

My second wrong assumption was that World-Wide Protein Data Bank was a centralized repository where I could easily go in and download 3-D prediction files.  That was wrong too.  The WWPDB is more of a portal, linking to the various Protein Data Banks around the world.

Most embarrassingly, I confused ‘Secondary Structure’ of a protein with a protein contact map.  Secondary structure is quite simply a designation of sections of a sequence as being part of an alpha-helix, or beta-sheet.  There are others too.  By the way, another source of confusion for me were the alpha-helix and beta-sheet.  It turns out, so you don’t struggle as I have, that the helix was discovered first, and beta-sheet was discovered second.  That’s it, as far as I’ve been able to tell.  Actually, I started a list of useful terms when I first began.  Here are some of them.

  1. Amino Acid (yes – I did) – molecules containing the amine group, carboxylic acid group, and a side chain.  In an alpha-amino acid, the amino acid and carboxylate groups are attached to the same carbon atom, called the alpha-carbon.
  2. Carboxylic Acid – organic acid consisting of at least one carboxyl group.
  3. Carboxyl Group - functional group consisting of carbonyl (O=C) and hydroxyl (OH, -OH, OH-).
  4. Distance Formula (in 3-D) – sqrt( sqr(xa – xc) + sqr(ya – yc) + sqr(za – zc))
  5. Residues are in contact when they are less than a specified distance apart from each other.  This distance varies depending on the research being done.
  6. Angstrom - unit of measuring distance, about 0.1 nanometers.
  7. Primary Structure – alphabetic sequence of amino acids.
  8. There are 20 amino acids.  Only 20.  There are two different ways of representing them within the community – using a three-character or one-character abbreviation.  The one-character abbreviations are not intuitive at all.
  9. Support Vector Machine (SVM) – This is a data mining technique.  Basically (and my understanding is only fundamental at this point), you classify all vectors as meeting or not meeting a classification standard, and then find a function separating the vectors which meet the classification criteria from those which don’t.  What you want, ultimately would be the rough equivalent in 2-D space of a line which is the farthest possible from all values in one class versus another.
  10. PSSM- position-specific scoring matrix.  This is the key to how PSI-BLAST works.  It does an alignment, determines a likelihood based on neighborhood proteins of whether a particular amino acid will end up in a certain spot.  It does this for all possible positions (so that you get a feature set 20 columns and n rows, where n is the number of samples).  The score is represented as a log-odds score, which I’m still not 100% on.

I could go on forever, but I’ll stop there for now (mainly because that’s the end of page 6 in my notebook, and page seven is my plan for downloading SVM Prat the following day).  You’re going to love the shenanigans involved in doing that.

Selenium RC, Server, and .NET Unit Tests Part 2 – Selenium IDE to Unit Test

August 30th, 2010

I had discovered that Selenium met my requirements for ease of use (so testers can record and automate test scripts).  I also determined that, because Selenium IDE allowed saving recorded tests as NUnit C# Unit Tests, I might be able to go one step further, and use the tests which the …testers… make my developer testing more comprehensive.  Using Selenium RC, I thought I might be able to have an end-to-end automated testing solution for the application layer of our application for little more than the time necessary to research it.  It was time to see what I needed, and to download the pieces.

The first thing I needed to do was get the Selenium IDE.  Fortunately, I love FireFox, and I happened to have the very latest version on my work laptop, even though most of our development work targets IE 7.  I upgraded to 3.6.8 prior to installing my Selenium IDE, just to be on the safe side.  This had the unfortunate side effect of disabling my IETab, but I could always reinstall that once a new version comes out.  Downloading the appropriate stuff was easy.  Everything I needed was available from the SeleniumHQ Downloads page.  I downloaded and installed the FireFox Plugin with no problems.  I started Selenium IDE, to see what it was capable of (Tools->Selenium IDE).  I was presented with the IDE:

The Selenium IDE Firefox Window

The Selenium IDE Firefox Window

My goal was to make sure that what was advertised about the product was true.  To get my end-to-end automated testing environment, I needed to:

  1. Record an automated test.
  2. Export the test as C# Unit Test.
  3. Load the test into a C# Unit Test project.
  4. Run the test.

Those are the broad strokes.  So the first thing I did was go to Google.  I typed in “http://www.google.com”, and did a search for ‘test’.  I clicked on a random link (University of Maryland – Testudo).  Then I checked out the options under the File menu.  At first, I made the mistake of performing a ‘Save As…’, which didn’t give me any option to save as C#.  I tried again, but this time saw the ‘Export…’ option, and I was able to export the test as C#.

using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using NUnit.Framework;
using Selenium;
 
namespace SeleniumTests
{
	[TestFixture]
	public class ExportedTest
	{
		private ISelenium selenium;
		private StringBuilder verificationErrors;
 
		[SetUp]
		public void SetupTest()
		{
			selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://www.google.com/");
			selenium.Start();
			verificationErrors = new StringBuilder();
		}
 
		[TearDown]
		public void TeardownTest()
		{
			try
			{
				selenium.Stop();
			}
			catch (Exception)
			{
				// Ignore errors if unable to close the browser
			}
			Assert.AreEqual("", verificationErrors.ToString());
		}
 
		[Test]
		public void TheExportedTest()
		{
			selenium.Open("/");
			selenium.Click("//span[@id='main']/div[5]/div/table/tbody/tr[1]/td/table/tbody/tr/td");
			selenium.Type("q", "testudo");
			selenium.Click("link=University of Maryland | Testudo | Schedule of Classes");
		}
	}
}

That was the extent of what I needed to prove, almost. I needed to demonstrate that it worked with the .NET Unit Test Framework. That meant I had to do some code editing. I made the following chages:
[TestFixture]->[TestClass]
[SetUp]->[TestInitialize]
[TearDown]->[TestCleanup]
[Test]->[TestMethod]
Once those were done, I had only to add the Microsoft.VisualStudio.TestTools.UnitTesting ‘using’ directive, and it compiled nicely. With that much under my belt, I was ready to actually try to run it.

Selenium RC, Server, and .NET Unit Tests Part 1 – Motivation

August 30th, 2010

Where I work, we have been working toward CMMI certification.  From this effort arose the necessity of writing documentation, tons and tons of documentation.  One type of document we create is the Test Scripts, which are manual instructions regarding how to ensure that a certain piece of functionality is present.  A full requirement might be broken down into Use Cases, which can be broken down into Test Cases (testing failure scenarios, boundary conditions, etc.), which can then have Test Scripts generated from them.  These Test Scripts are delivered to the user so that they can have a methodical method of testing that our application satisfies the requirement.  This is not unique to our organization, and is just an implementation of the Rational Unified Process.

Since Visual Studio 2008, Microsoft included a Unit Test Framework.  This framework allows unit tests to be included with projects out-of-the-box.  The framework is similar to NUnit in the way it behaves.  In my perfect world, I would like to build unit tests to automate some of those test scripts, so that whenever we make a change to some piece of functionality, we can do more comprehensive testing than the incident testing which we currently do.  This is a vital improvement, because we are a small company, and don’t really have a lot of people available to do as comprehensive testing as we would like.

Fortunately, I wasn’t the only one with this idea.  The folks at ThoughtWorks decided that they needed something like that for a while.  Actually, they had slightly different requirements.  They had one web application, and were trying to do compatibility testing to ensure that their applications worked across multiple web browsers.  This led to the development of Selenium.  Now, many people have used Selenium before, so that is nothing new.  I’ll briefly explain what it is, so that when I forget three years down the line, I have a reference.  Maybe it’ll help you as well.

Selenium IDE is the starting point, I believe, for learning about Selenium.  The reason for this is because the tool records your interaction with websites in a manner which allows the information to be played back.  That’s cool if you want to record and play tests, and have somebody run the test to see what breaks.  However, the Selenium folks didn’t stop there.  They went farther and decided that just because they record a test using Firefox, that doesn’t mean that is the only browser they want to test against.  That would defeat the whole purpose of multiple platform testing.  They decided that you should be able to save your tests to run in one of several languages (for instance, C#) as unit tests.  From there, you can officially run tests from within your (Visual Studio) IDE.  Then, they divined something really cool called Selenium Remote Control.  Selenium Remote Control (RC) allows you to set up a server to run the tests on, which you can use your unit tests to connect to.  This is pretty high-level right now, but for the basics, it’s okay.

I didn’t just look at Selenium and stop.  I looked at WATIR, but I had requirements that precluded me from selecting that one.  I wanted something which would record automated tests.  WATIR allowed scripting automated tests, but not point-and-click recording (or at least, I couldn’t find it).  It did allow for writing tests in the relatively easy to use Ruby language and interactive command line, but like I mentioned earlier, we’re a small company and everyone is already doing twenty things at once.  I couldn’t, in good conscious, ask our testing crew (who I had assumed would be ultimately responsible for creating and managing the tests) to learn a new programming language.  I looked at a few more as well, but I couldn’t find any which I thought to be extremely impressive (which is a shame, because I went through this whole ordeal five years ago, with similar results).  Wait, I should say that my second requirement, being a small company, was that we don’t have $10,000 to spend on automated testing software.  Open-source or free is what we needed.

That’s the mental process that got me to the decision to do the case study.  The ‘case study’ is the process by which I attempted to install, configure, and integrate Selenium SC, Server, and .NET Unit Tests into our development process.

Contact Map Prediction Part 1 – Motivation

August 27th, 2010

In the summer months of 2010, I started work with the GMU MLBio+ Laboratory, attempting to understand Protein Contact Map Prediction.  During my first year back to school in 5 years of professional programming, I discovered (as I begrudgingly attended CS 101) that there was an area of overlap between my basic Computer Science degree, and understanding the biological world.  It turns out that there are many, many gigabytes of information out there resulting from experiments in the biological community.  That’s a lot of information.  Understanding and making sense of a lot of information is something that computer scientists have been doing for some time in the fields of machine learning and data mining.  At some point, it became clear that there is enough work shared between computer scientists and biologists that someone came up with a cool name for the field – bioinformatics.  I was fortunate enough to happen upon GMU just before they created that major, and now I am working toward a degree in bioinformatics.

What enticed me about the field is that the things bioinformatics is used for are some of the fundamental, very basic, components of life.  Proteins, Amino Acids, DNA, and RNA, are just a few areas where bioinformatics is useful.  This matters to me because since I was a young child, I’ve been interested in society and social constructs.  To truly understand society, I discovered you need to think about individuals and how they work together.  To truly understand individuals, you need to learn about what intelligence means, and what sets us apart from animals and insects.  To truly understand that divide, you must understand generally what life is.  I think I’ve picked a good place to stop.  From what I can tell, once you get a little farther down past chemistry, the rules of the game change significantly.  Who knows, maybe I’ll end up further down the hole eventually, but for now, I’ve found a good starting place.

Being a student, I had initially no idea of where to begin.  I’m a solid programmer, but I couldn’t begin to tell you where the cutting edge of bioinformatics was, or even really how to structure an experiment properly to get informative and useful results.  I needed help, so I sought out a professor at GMU (Prof. Rangwala) who was doing research in bioinformatics.  Specifically, he had two projects (or ideas for projects) to work on.  One was Protein Contact Map Prediction, one was Metagenomics.  Both sounded pretty cool to me, but there were already people working on the Metagenomics, so Contact Map Prediction was the way to go.  The only problem with that was, I knew absolutely nothing about proteins, amino acids, contact maps, etc, but I was willing to learn.  I’m starting this (hopefully) series of blogs to record what I’ve learned so that 1) I will always have a quick and easy reference, and 2)if somebody else has to spin up on this stuff, there’s at least one place they can go.

An Uncertain Future

August 14th, 2009

As a software engineer, I am sensitive to how the world is moved by technology, being responsible for creating some of that technology myself.  I see the streamlined processes, the fluid increases in efficiency, and all of those things which fall predictably from the very intentional application of a multitude of for-hire software development.  I am also quite keen to the unintentional and uncontrolled development out there, like a myriad of social networking sites, some of which (Twitter, for instance) have little more than glorified instant messaging capability.  The software engineer in me loves the bright lights and buzz, the instant connectivity to almost anyone at almost any time, and the feeling of improvement and quite honestly, status, in this intense abstraction of the world called the internet.

The poet and writer in me, however, often laments the destruction of melody in communication.  Quickly, in 140 characters or less, explain the human condition!  That’s specifically a Twitter limitation, but enforced through the medium of instant chat and text messages.  Can it be done?  Certainly.  For instance:

I live, but why? Because I am afraid to die?  Or is there a reason which I may not describe, and if so, where does it hide?

A little flippant, perhaps, but do-able.  I would assume that a similar feat could be accomplished in a few lines of a text message.  I heard on National Public Radio that someone was attempting to compress the Illiad into a series of tweets.  Be it a little trite, at least it could convey the content.  There is an intrinsic beauty to brevity and conciseness.  But what about the language?  What of the culture?

Basically, what happens to the stuff you cut away?  As we labor arduously to constrict our vernacular and mold and compress it into different technological mediums, are we stripping out the context?  Take as example my statement on the human condition above.  In 100 years, besides the fact that perhaps the word ‘die’ would have been replaced by the letter ‘d’ in common speak, what cultural implications can you derive from the statement?  The human condition is not likely to change, thus the verbiage above is ambiguous as to any significant cultural reference.

This effect I will call the ‘sanitization of communication’.  I do harbor the hope that such an effect will remain isolated in vernacular, and that the writers of the world will instinctively rebel to such things.  As I believe the purpose of writing, and indeed any art form, is to capture and hold those pieces of the world which are necessarily ripped from the cold calculations of business and now interpersonal communication.  That is to say, I hope that writers will become more verbose and descriptive and ‘keep alive’ the good traditions of literature, and that artists will continually strive to illuminate those aspects of culture which we, as high-minded citizens, might prefer to ignore.

I can’t help wondering if a continuing divide between colloquial communication and literature will ultimately lead to a more pronounced chasm between ‘high’ and ‘low’ speech.  What will the future hold in this regard?  Indeed, is it even worthwhile to attempt to avoid the sanitization of communication?  Is the abbreviation of terminology within communication even a real concern, or is it merely the musing of an unconfirmed self-professed writer engineer as myself?

Maybe We Shouldn’t Have Done That…

May 27th, 2009

I assume you’ve heard the following joke:

A Friend Is Someone Who Will Bail You out of Jail, but Your Best Friend Is the One Sitting next to you Saying ‘Maybe We Shouldn’t Have Done That’!’

The way I see it, I either did something stupid to end up in jail, or I was protesting the government in some way and that’s what got me there.  In the former situation, I would like to think that my best friend would not have ended up in my jail cell.  I like to believe that anyone who fills that role in my life is sensible enough to have at least tried to talk me out of whatever idiotic idea I might have come up with that would put me in that situation.  On the other hand, if I was in the latter situation, I hope that my friend would have been right there with me and thus ended up in jail by my side that way.

‘Blind loyalty’ is the problem, which is the whole I’ve got your back scenario, only… you’re about to rob a bank.  That kind of loyalty is a cause nothing but hardships in this world, if you think about it.  Gangs are formed from exactly that kind of loyalty.  Crusades are a form of that kind of loyalty in action.  Any person or cause to which you are loyal past thinking for yourself is a problem.

But we all secretly crave something like that, don’t we?  Someone who’s loyal to us above all others.  Someone to whom I can say, as in all the action adventure movies:

Me:  You know we’re probably going to die, right?

Friend:  Yep.

Me:  Well, you don’t have to go.

Friend (while loading shells into a shotgun):  Nobody else is going to stop these damn aliens.  I’m with you.

Or something like that.  That was an unfair situation, because I think we all know what to do when aliens attack (ask the scientologists to defend us).

I guess there’s something seductive also about being the person that someone will come to and ask for help in a similar situation.  There is something enticing about someone having the level of faith in you to ask for… well, anything, I suppose.  I would be flattered to be asked to go rob a bank, but in light of all of the thinking I’ve been doing on the subject (and a healthy spoonful of common sense), I’d probably say no.

That’s kind of part of the problem.  As humans, we were hardly given a road map to life.  We have to make up our rules as we go along.  To do so without killing each other, we’ve had to learn to compromise, even in situations where the immediate outcome of the compromise was uncertain.  Because in life, we are not alone.  And really, where are the lines drawn?

Is ‘the bank’ my friend has decided to rob really an oppressive institution?  Would I be morally right, even though legally wrong, to rob that bank?  In a fast-paced world where making the wrong allegiance could get you killed, it’s important to be able to count on those people you involve yourself with.  In harsher environments, there are factors more immediately important than moral rightness, and there are situations in which loyalty counts above everything else (consider being in Iraq or Afghanistan right now – I definitely wouldn’t want that guy beside me to question anything – not while we’re fighting).

I like to believe I take the time to consider each decision that comes before me, but I know, and I suspect so do you, that only the future will tell.  I’m not on the front lines in a war right now, and I’m not living day to day hunting for my food and roving in bands of nomads, so I have the luxury of questioning my loyalties.  And it seems now that I have the obligation to do so as well.

What Financial Institutions – Got to do With It? Got to do With It?

May 13th, 2009

By the end of my previous blog, we’ve just figured out how to gamble our money away in the stock market.  Apparently, it only takes a few degrees of separation from the source to turn legitimate business into legal gambling.  Now let’s talk about banks and asset-based/backed/securities/investments…. whatever.

What is that all about?  Well, think of it this way.  Someone did exactly what I outlined in the last article, only with homes.  A few people started to look at homes as an investment vice a place to live.  What did that do?  Well, as you would (now) expect, home prices shot up, and loads of people got in on the deal, building homes everywhere.

Homes were considered a stellar asset!  Nothing has as good a track record as homes (except Warren Buffet and possibly Chuck Norris for completely unrelated reasons) for positive return on investment.  So, consider what happened in our example from the last article?  The banks were smart and didn’t want to be left holding the bag, but they also wanted to get in on the action. They loaned a bunch of people a bunch of money, and then took that debt (read – steady payments over a long period of time with a minimal default rate – who wouldn’t buy it?) and grouped a bunch of housing debts together to sell them.  

Let’s talk about housing debt (or debt in general).  Say Thomas has loaned a few dollars to Joe (Joe swore he would ultimately give Thomas back his money and a couple of extra dollars).  Thomas is really interested in making back what he loaned, and maybe a dollar profit on top.  So, Thomas “sells” the owed $3 to Jeff for $4.  For Jeff, it’s a good deal, if Joe actually pays it back.  If Joe is considered reliable, of course Jeff would jump at the deal.

Now, multiply that times a few million, and package loans together in packages of a few thousand apiece, and you’ve got a rough idea of what asset-backed securities are.  Not so bad, right?  Well…not really that bad, believe it or not.  Still a pretty good buy.

Now, if I’m a bank, then the government is watching my every move, and making me report this and that and the other.  Everything they want me to report on costs money, so it’s in my best interest to hide as much as I can – not even trying to be shady about it – just to save a buck.  For some reason, the government says investment type xxxxx is unregulated.  Now, as a bank, I look at that and say to myself – self, how do I get this great money-making scheme into that unregulated type of security?

They figured it out, and the rest is history.  They were packaging many low-risk debts together with other ‘stuff’, trying to obscure things – they succeeded in obscuring things, and eventually, even though there were still a bunch of ‘relatively’ low risk investments out there, nobody could figure out how much they were.

And that’s about when people woke up and realized the stock market’s one big gamble.  Everyone freaked out, and ran for the hills, as far and as fast away from the banks as they could!