Sunday, March 29, 2015

Star(schema) Commander, Iteration 3

So much for micro releases.  :|

So far I have experienced a few interesting things:

  • Micro releases are not that satisfying when doing initial development - especially across three interconnected projects - core, cli and gui libraries.
  • Unit testing user interfaces really sucks.  I tried to find something but no solution seems to be around for very long.  In the end I created my own UI framework based on standalone components and messaging which made testing very easy and meant the runtime app just had to wire them together properly.  It also achieved a nice encapsulation of the different UI parts.
  • It is WAY too easy to get stuck testing every detail in a UI and it can eat up a LOT of time because everything you have to do is a new one-off.
  • The internet is not very helpful on the issue of user interface testing.  If I have to read another lecture about separation of responsibility and how you should test the domain layer, not the UI objects, blah blah barf, I will delete the internet.  Guess what, people? User interfaces have requirements as well and those must be tested with the same level of reliability as other parts.
  • When testing a user interface, there is a lot you have to let go.  Unit testing Java code can be very granular and specific, but if you try that in a user interface it will be a train-wreck.  E.G., if a table has headers that read "Name", and "Schema", testing those is going to add more semi-useless tests and will make any change to the UI break way too many tests.  Besides which I would like to refactor my UI (changing lists to tables, etc) without extra tests breaking.
  • I did manage to temper my desire to create the perfect user interface library.  I simply created what I needed and refactored as I realized that I needed more functionality.  There is a word for that but it escapes me at the moment (and most other times) ;)  . . .
  • I am toying with the idea of rewriting my UI using JxBrowser - a Java library for using an embedded Chromium container.  My Java desktop apps look so crappy and take so much work to wire together and are therefore resistant to change, and HTML makes a nice container for UI code - as compared to Java code.  I am concerned about the extreme commercial nature of the project - $1600 per license minimum; I don't know what they think they are providing that is worth that price - even if I do have a free open source license at my disposal.

Thursday, March 5, 2015

YAJUEHP - Yet Another JUnit Exception-Handling Post . . . *yawn*

I can't imagine anyone will find this useful when it is so tiresome to me, but after a jaunt in UI Testing purgatory I had to go back and test some plain old library code, but this time with a new twist.  I have been using the rather awesome ExpectedException class with nice results.  The Code Under Test in this case, however, threw InvocationTargetException's with wrapped cause's which made that approach too brittle.  I found this nice post about it which solved my issue:

JUNIT EXPECTEDEXCEPTION RULE: BEYOND BASICS

Toward the bottom there is a nice discussion of verifying causes.  I found another article he wrote comparing various exception strategies in JUnit here:

6 WAYS OF HANDLING EXCEPTIONS IN JUNIT. WHICH ONE TO CHOOSE?

I thought these were pretty handy - hopefully someone else will as well.

Wednesday, February 4, 2015

Star(schema) Commander, Iteration 2

I got version 1.1 and 1.2 out in the same night.  I have dimensions and reporting areas, and a mechanism to import dimensions from a database.  Not too useful yet, but facts are coming.

Saturday, January 24, 2015

JUnit System Rules

I found this today - it was very helpful for some testing I was doing.

System Rules

It has all kinds of cool stuff in it, but what I was looking for was a way to have tests override system properties (Specifically to test code which relied on user.home) and after each test completes the properties are restored.

Wednesday, January 21, 2015

Star(schema) Commander, Iteration 1

I have created an API, a maven project, and set it up for maven central synching.  That's not much value, but it is a lot of legwork.

For the next release I am going to aim for at least the ability to create a profile.

Tuesday, January 20, 2015

Star(schema) Commander, Iteration 0

Because I am constantly writing queries against dimensionally modeled star-schemas, I decided to write a small app to make the process easier.  I thought I would approach it in an agile manner - incorporating small releases and focussing on delivered value.

I also thought it might be interesting to post my experiences mainly to help keep myself on task.  My goal is to have a very usable UI - but I have tried that before and I think it will end up like a messy iOS app with code scattered all over user interface components.  It would also take a long time for me to be able to do anything meaningful - and an application opening a window is not value.  E.G., It might take months to make the UI work, but probably only a few weeks to have a command-line tool I can use to generate queries.  That would be a win by itself.

So, anyway, here I go.

This is the bitbucket project (currently blank):  https://bitbucket.org/bradleysmithllc/star-schema-commander

This is where I will actually document it (also currently blank): https://etlunit.atlassian.net/wiki/display/STAR/StarSchemaCommander

Monday, January 5, 2015

The Opiate of the Masses . . . ?

Karl Marx once said, in effect, that Religion is the opiate of the masses.  To be exact, this is the English translation of the quote according to Wikipedia:

"Religion is the sigh of the oppressed creature, the heart of a heartless world, and the soul of soulless conditions. It is the opium of the people."

I was thinking about this recently because I had an experience which brought this quote to mind, and about how off target this is - at least in our time.


Religion, or Faith?


He was wrong primarily in mistaking religion for faith.  It is tempting to give Marx the benefit of the doubt and assume that he understood the difference, but I don't believe that someone who has never experienced genuine faith in something greater than oneself can really know what it is.  Faith is not a drug to dull our senses and numb our emotions - it is a genuine devotion.

He further believed that he could substitute devotion to the collective - or more specifically the government institution - for a genuine faith.

Why is he wrong?  Because Opium induces a delirious high - perhaps helping the addict to release cares due to the drug.  True faith, however, yields hope - or, in the words of the Apostle Paul:



Galatians 5:22-23
But the fruit of the Spirit is love, joy, peace, forbearance, kindness, goodness, faithfulness, gentleness and self-control. Against such things there is no law. 
Galatians 5:21-24 (in Context) Galatians 5 (Whole Chapter)

If you compare this list to what Opium use produces, the comparison becomes laughable:


  • Lying or other deceptive behavior
  • Sudden worsening of performance in school or work, including expulsion or loss of jobs
  • Loss of motivation and apathy toward future goals
  • Withdrawal from friends and family, instead spending time with new friends with no natural tie
  • Repeatedly stealing or borrowing money from loved ones, or unexplained absence of valuables
  • Hostile behaviors toward loved ones, including blaming them for withdrawal or broken commitments
  • Regular comments indicating a decline in self esteem or worsening body image


The true Opiate of our Times


So, if religion is not the opiate of our times, then what is?  I mentioned earlier that an experience I had brought this to mind.  I was feeling a little down at work (combination of stress and disillusionment with lack of ability to finish projects), and I put on some music - specifically Schubert's Winterreise.  I immediately felt an emotional ambivalence - the very effect I had hoped for.  I realized then how we use music in so many different ways in our world - from entertainment to mood alteration and even behavior modification.  Looking at it objectively, there are very few times in our lives when there is complete silence.  Music in the car, in the elevator, when we are on hold on the phone, in movies, blaring at sporting events in between any pause in action, etc.  In fact, situations which lack music seem lackluster and boring.  Clearly this pales in comparison to opium use, but that was Marx's choice, not mine, and I believe it is a more appropriate comparison than religion since the goal of music is similar, even if the results are dissimilar.

Our cultural infatuation with Music-like sounds (Most of the time not musical at all) was demonstrated to me when I went to an OU / Texas game at the Cotton Bowl.  Music was blaring the entire time there wasn't action directly in front of us - and it was horrible.  An acoustic assault on our senses.  Just because I love football, does that automatically mean I like AC/DC??!?!?  I am not sure the intention was even to entertain musically, but rather to incite an intensity and rush that is expected of a big-time football game.  It also aids some drunken fans in getting up for the stupid fights that sometimes occur afterwards.

The worst part is that I have spent a significant portion of my life as a musician, and music lover, which means in affect that I am both a dealer and a user.

Hi.  My name is Brad - I am an addict.