Archive

Monthly Archives: July 2009

I’m working with varied technology stacks these days and figured it was a good time to throw a few questions and tool suggestions out to the community.  First, the tools list.

IDEs & respective plugins/addons

Some of the Main Bits I’m Using These Days

That is about it.  I am amazed, looking at this list, how minimal it has become even with the increase in technology stacks I’ve been working with.

Beware, this is a LONG entry and if you don’t read all of it you may end up offended, but rest assured what I’m writing here is the absolute truth and recruiters, project managers, project leads, development leads, developers, and anyone getting into the software industry or that has been in the industry I have many points of advice and warning.

I was recently hanging out with one of my friendly local tech recruiters over a drink or three and some good food.  They asked me to proof their position they where about to post.  As I am a friendly guy, I decided I would.  It has been a LONG time since I’ve looked at a post like this, as I haven’t actually used Monster, Dice, or any of those sites in a rather long time.  Maybe I’ve thought the industry had matured a bit sense I last checked the pulse.  Being in Portland where the industry is generally about 5-10 years ahead of the rest of the country (and the world for that matter) I am always hopeful.  Here are some snippets from the post and an immediate translation.

Under the required skills section I saw a couple of points;

  • Creation of automated unit test cases.
  • Automated builds
  • Ability to manage multiple projects and tasks simultaneously.
  • Dedicated to completing assigned tasks on time.

Under the preferred skills and characteristics where some more real gems, but this one just stood out.

  • Willing to work overtime, holidays, and weekends as requested by management.

My first response when looking at this was, "are you serious?  you really expect someone to take this job?  It has abusive environment and poor conditions all over it!!!!"  I was seriously shocked, after all these years, and maybe I just don’t read job requirements much anymore and there are tons this crappy.  So let me elaborate a little more on this description.

First off, just from those descriptions the position looks aberrantly abusive, environmentally (i.e. work environment) bad, and probably psychologically torturous for a software developer.  Maybe I’m wrong, but whoever decided to put these requirements in the post is looking for either A: someone who is desperate for work and will last for a very short time under the abuse or B: someone who is already sadomasochistic and loves the pain of the torture.  There are amazingly software developers like that.

Now I have to pick apart some of these.  "Creation of automated unit test cases."  This immediately tells me a couple of things;

  • There are some tests, they are NOT unit tests if this has been slammed into a requirement spec for automated tests cases.
  • There are so many contradictory words in this request that it just doesn’t make any actual logical sense.
  • Unit tests are isolated, often used during refactoring, not always during automation.  Automation tests are not particularly unit, often are integration tests, and aren’t really used during refactoring but instead during QA. 
  • "Cases", well cases just hangs there as if Agile Processes & Waterfall Processes are having a subversive fisticuffs fight right after the specs are finished.  Whatever the "case" this requirement only really shows one thing, some type of testing is required, and the prospective candidate won’t know what kind and it appears nor does the person writing the requirement.

Let us hit on the next statement.  "Automated Builds".  Ok, this one sounds like a legitimate requirement.  But stop a second and think about it along with the other requirements.  Is it logical with the others or does it exacerbate the other requirements by its simple specification?  Considering people these days people are doing CI, continuous integration, along with automated builds it leaves me with this thought that someone hasn’t modernized the build process for a long while.  With that said it leaves me to this next specification and the point I want to make.

"Ability to manage multiple projects and tasks simultaneously" is a beauty.  That’s the spirit for destroying any good velocity and productivity a developer might have, interrupt them a lot and give them multiple tasks all at once!  If it is a contract position, one would probably want the hire to stay productive on task, if it is a permanent position you might want them to handle multiple efforts.  However stating this immediately, before any discussion or interview is made with an individual this specification should leave a developer with the inherent fear that the project, whatever it may be, IS BEING MANAGED POORLY!  This is a massive, glaring red flag.  Sure, most projects these days are probably running through rough spots, but don’t chase away the smart talent before the position even gets a glance at by the top talent.  I can promise you the top talent will look at this, and think, "well maybe they can hire me as a consultant to get them back on track, but I’m not going into the trenches because it already sounds like a "death march" with many "mythical man months" being consumed.

"Dedicated to completing assigned tasks on time" is always a hilarious thing to read.  This should be translated to "working insane hours to get tasks done based on a schedule that you have not be consulted on, or at least ignored after you?re consulted, and then getting reprimanded because you didn’t finish a task that has been mismanaged from the beginning!"  This specification is probably the biggest alarm of them all.  This specification almost immediately should tell a prospective candidate that the project, or project(s) are probably being mismanaged.  If the project has had so many problems as to need to put ?dedicated to completing?" in the specification as a point there are problems.

Now someone might read this and think, "but it sounds like a good trait" and I’ll state simply that it is a very good trait in a developer.  I can tell you with high confidence, developer’s absolutely have this trait but are often put in circumstances that they can’t meet deadlines.  I can also say with high confidence that probably 80% of the time a task is not met by a deadline it is not the developer’s fault, it is the planning process & management that is in place.  Mind you, 80% is a conservative estimate, a more accurate number would probably be in the 90% range.  Developer’s want to create, design, developer, and do good work. Developer’s are not your McDonald’s employees, these people are highly skilled.  Even the weakest developer is likely to want to get things done, but if the leadership has mismanaged the project, they’ll then have to fail.  It is a sad situation that it is so often this way, but that’s the cookie crumbling.

The last one anyone can see is a major red flag.  "Willing to work overtime, holidays, and weekends as requested by management".  If this where a contract position, that is a command to abuse the hours ? spend a ton of em’ and bill em’ because you know, just from this requirement that you’ll have to anyway.  If it is a permanent position, this is really bad news for the developer.  Right from the get go a developer should look at this and realize their social life, their
love life ? if they have one, marriage, or whatever else is about to go down the drain.  If something like this is in a job profile specification then you can bet money, that you’ll be expected to and will have to work ridiculous hours.

With all the other specifications combined the sad fact is that you’ll probably be stepping directly into a project death march from day one.  Simply put, this project, whatever it is will fail with about a 90% chance on delivery date and cost.

The Awesome Shiny Good News Out of All This!

There are ways that everyone in this scenario can get things straightened out (and no, I’m unfortunately not available right now I’m happily employed ;p ).  Here are the first 9 steps to getting things going in the right direction and staving off the death march and immanent failure.  I would have written up the first 10, but that seems touch?!

  1. Get existing members into a room that are involved in this project and show them this specification.  Then throw away the specification and dig deep to find the GOOD PARTS of the project that might make it fun and exciting to a prospective candidate!
  2. Immediately toss as much Waterfall Methodology in the dumpster out back AS FAST AS YOU CAN!  Read up immediately on Agile, lean style, scrum style, anything of that sort.
  3. This one will be painful for the project managers, but do it if you want to succeed.  Throw away the gantt charts and project plans, if you don’t you’ve already failed the software development effort.
  4. Sit down and create some stories about what this software has to do.  Talk to the users and get it straightened out, look at the components that might need to communicate.  Bring in all the key stakeholders again and tell them the project is at RISK.
  5. Find ways to get happy developers, existing and future.  If you don?t have happy developers you WILL NOT have a solid, reliable, quality product or service in the end.
  6. Either figure out your burn down chart or your iterations, get stories lined up for the next steps ? i.e. the ones in the immediate next week or two and DO NOT start putting stories on a scheduled chart or out past the 2nd or 3rd iteration.
  7. Get a steady velocity, stop abusing the developers, stop working overtime at every opportunity.  Overtime slows down a project, don’t tell me you have to because there isn’t enough time because you’re perpetuating the lie that OT will build a product.  Steady, consistent, happy, clear thinking developers get a product built.  Some OT might happen, but get it the hell out of a job specification and reduce it to a minimum on the job.  You want developers that want to do a little extra, not developers that feel slave driven.
  8. Make sure the teams eat lunch, communicate, get to know who everyone is, and can deal with their respective team members traits and can communicate.  Without effective and regular communication nobody is going to finish anything on time, let alone of high quality.
  9. Seriously, go have a beer/beverage/cold drink or something with the team and get things out in the open.

Ok, so there are a ton more steps.  There are things that come after this, that come after the project is repaired, and even after that.  But this is the simple start to correcting the problems.  I really hate seeing projects fail, I HATE seeing projects fail because often, there is no reason for it.  Almost every project I see that fails is because of the dumbest list of reasons;  fear, bad management, Waterfall, miscommunication, and others.  The wicked thing is, every single one of these reasons has a solution that humanity in its everyday project endeavors has resolved!  We as human beings have the knowledge, out there, we just have to search for it and find it and know it!  So many projects don’t have to fail!

So get to it, and I hope everyone that reads this can straighten out their projects and add to the list of successful projects, instead of outright failures.

Got a question recently, from multiple people regarding test driven development.  One simply asked why TDD is not the standard (as in way to develop).  Another person asked me how spending more time writing tests speeds things up over time.  Well, I will cover a bit of that real quick and try to explain my 2 cents on the whole practice.

What is test driven development?  The practice entails developing a test, which fails (because obviously you?ve written it first).  Once you have written the test you then create the initial skeleton that will get that test to pass.  Here is a crude a basic example.  I am using NUnit for these examples, so if you don’t have it, go get it or whatever your test framework of choice is.

First you write the test which will fail.  Also known as getting the "red light".

    [TestFixture]
    public class RamblingsTests
    {
        [Test]
        public void InstantiateRambling()
        {
            Rambling rambling = new Rambling("I'm talking here and all.");
            Assert.IsNotNull(rambling);
        }
    }

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

Next you flesh out the actual class, which if you have the appropriate refactoring tools and awesome stuff like ReSharper takes about 5 seconds ? literally.

    public class Rambling
    {
        public Rambling(string s)
        {
            throw new NotImplementedException();
        }
    }

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

Now when we run this we can see it fail.

Of course to get the test to pass, we simply can get rid of the exception being thrown!  So I do that next and we get a nice green light.

Now the class is pretty useless, so I will add a simple feature next.  But I will follow true TDD style practice.  I will not just whack some code onto the object, we’ll immediately lose the effectiveness of TDD if we just break the process and start cramming code, no matter how small, into the class we’ve just created.  So I have a test instead;

    [Test]
    public void ConfirmRamblingIsRambled()
    {
        Rambling rambling = new Rambling("More rambling is occurring here.");
        Assert.IsNotEmpty(rambling.Text);
    }

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

Running that fails so immediately I will add the code to get a good green light.

    public class Rambling
    {
        public Rambling(string s)
        {
            Text = s;
        }
 
        public string Text { get; set; }
    }

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

Now there is a class, that can be instantiated by passing a string parameter in, and the parameter is then assigned to the Text property which can be retrieved after instantiation.

What else do we have?  We also have immediate regression if any changes are made.  We have the confidence that we know each part works & that nothing got fat fingered in.  Now let us imagine we had to do a bit of editing to the Rambling instantiation so that some business logic occurs after the text is passed in as a parameter.  In other words, we’ll imagine we have a refactor or change requirement to make.

Let us say we wanted to check and make sure there was always going to be at least a period on the end of any Ramble’s Text property.  Now of course that is super easy but don’t go messing the flow up and adding the functionality yet, first add a test.

        [Test]
        public void ConfirmRambleHasPunctuation()
        {
            Rambling rambling = new Rambling("Another rambling ramble.");
            Assert.IsTrue(rambling.Text.EndsWith("."));
        }
 
        [Test]
        public void ConfirmRambleGetsPunctuation()
        {
            Rambling rambling = new Rambling("Another typing rambling ramble");
            Assert.IsTrue(rambling.Text.EndsWith("."));
        }

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

I’ve written two tests above.  It might seem silly or excessive in this scenario, but think if this was some serious heavy duty business logic that had all types of processing going on.  You would want to check more than just one or two scenarios and at least cover most of what one might think up.  Of course Quality Assurance hits the outliers, but no developer should ever be submitting code to QA that has stupid bugs ? ESPECIALLY if it can be resolved via TDD or even test after development.  EVERYONE should be writing tests for their code ? even if they end up not quite meeting the standards of isolated, testable units ? write tests!  When you get into the practice, getting them into isolated testable units gets easier and easier.  So we’ve got two tests now to confirm that the Text Property will end with a period even if the instantiation string parameter isn’t passed with any.

Here is the addition to the code to get green lights on both tests.

    public class Rambling
    {
        public Rambling(string s)
        {
            if(!s.EndsWith("."))
                s += ".";
            Text = s;
        }
 
        public string Text { get; set; }
    }

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

Now we have 4 green lights.  Life is good and our code is tested.

I have a really hard time why some developers seem to just not test their code.  Sometimes it is the management, sometimes other work environment issues, but as for core functional legitimate reasons I can’t find any to not write unit tests.

Some people have brought up not needing to write tests for code that works based solely off of configuration settings, such as from a Web.Config, and I can agree with that.  At most, write a test to verify you’re prepared for a configuration setting not being available that you think might be.  Beyond that, no point in going over ground already traversed – one would hope – with thorough QA and respective resources.

Time Consumption Issues

Now as some of you, especially if you worked through these examples, or even wrote up some of your own you will have noticed that it took more time than if you just wrote the code.  Yeah, on this insanely easy, kindergarten example it did take more time.  But seriously, think about it for a minute, when you’re in the heat of coding (especially if you aren’t paired up) will you actually catch each little mistake?  Maybe during the build of the code, maybe afterwards you might.  Will you actually not miss every single detail and be absolutely sure you get every business rule and detail into the logic?  I would not put trust in anyone to do so.  After 12+ years of software development, I have yet to see someone write code well if they aren’t testing the hell out of it at the same time.  The cleanest, fastest, most well organized code I have ever seen has come from developers working within the TDD mindset & process.  The only individuals I have ever seen produce better code are developers that pair program.

?but I am not going to go into the pair programming paradigm, that is for another entry another day.

TDD drastically increases the quality and integrity of your code.  With higher quality you do not have to take as many steps to refactor, you do not worry as much about quality once the practice is in your head.  The quality comes from the refactorings you do commit and improvements only go up from there.  Using TDD you will eventually find, no matter how hard headed one is in the beginning, that you will vastly increase your code quality and significantly decrease you’re actual post writing QA bugs, rewrites, and all those other assorted annoyances than a good developer should keep minimized.

As for the project planners, it might seem like it takes a while to write tests, but when you see those QA cycles shorten, the code quality increase, and eventually ? yes, I promise ? the legitimate velocity of development increase and then ? drum roll please ? sustain, you’ll be thankful that you or your developers in the team are practicing TDD.

I personally, can barely imagine a world in which I skip tests.  I’ve honestly tried in the past couple years a couple times to stop testing ? just to have a flashback to when I started coding ya know ;) – and have ended up providing a prime example why you do NOT skip unit testing.  Unfortunately I wasn’t prepared for the first failure from not testing, and it took the second "I command you not to test cuz it’s ruining my project plan" bull shit to be prepared to basically test anyway and then show how the non-tested code doesn’t hold up against the unit tested code base.

There are of course pitfalls, and a lot of them, as with anything and developers have to work diligently to avoid them.  At some time in the future I’ll elaborate on those also.  For now I’m going to jump from this and into my thoughts on why some environments do not test still, even with the ever growing mountain of evidence that you’re insane not to.

Fear and Courage

Unfortunately most development teams have, if they are EXTREMELY lucky, at least one super motivated and above average developer.  Once in a very rare time a team will have 2 or more.  But if the team has average, weak, or super strong developers no matter testing should be done.  Even if one is just out of college and not really a strong developer yet, they can still take the torch and push for good practices.  This is where the big question comes for any developer no matter what level ? do they have the courage?  The fear often overrides one’s ability to step up and get testing put into practice among a team.  Above all, step up and have the courage.

Anyway, that’s all the writing I have for the topic right now, got some #strangelovelive to watch and some code to hack out.  Hope this provides some insight into the issues & problems in getting good TDD practice kick started in a development environment among a team.  I’ll definitely have a lot more to say soon as I’ve routinely been joining more and more conversations regarding the Agile and specifically the TDD practice.

Not sure what I can or can't talk about, so I am just going to go on about these things anyway – because some new features we've been working on here at Webtrends are literally right around the corner from release!  So I will be a little risky here and elaborate a bit.

Over the last several months we've been bustling here at the beehive working on some major efforts for opening up our data to increase the flexibility in which users can use the data we collect.  Our strong point at Webtrends has always been exhaustive and elaborate data collection and providing available correlation.  Now we've opened that up in a major way by providing data via web service.  We've done SOAP in the past but that is not really the language of the Internet so we've provided new services that have a new architecture that provide our data for collection more directly.  These new web services are built using REST Architecture principles and if I may gloat a bit, are awesome!  Yeah, awesome!  Nothing else available in the market like this, it is nice to lead.

For more information on these web services for pulling analytics data check out http://developer.webtrends.com for more info.  You can even ping me via the site if you have any further questions – I love talking shop so feel free to get in touch.

On the other end of the spectrum we also have web services for data collection or as we refer to them DC web services as in Data Collection Web Services.  The DC web services are going to allow us to step far beyond mere web site data collection.  Currently we use a lot of JavaScript for collecting data & an assortment of tools, but these new services only require a mere HTTP stack availability within your application, language, or toolset of choice.  They can easily be used then to track nearly anything.

Some of the ideas that keep rushing around in my head include;

  • mobile device applications that aren't wired into a browser.
  • Silverlight
  • Adobe Flash
  • Adobe AIR
  • Microsoft WPF Applications
  • Any RIA Framework built app
  • Qt on Linux
  • .NET Server calls, services, etc.
  • Java UIs of any sort
  • ?and if I spent anymore time I'd make a list so long this entry would get far too wordy.

I believe the initial offering of data collection services will be in a beta for a short time, but as with the web services (which I got to work on the original team ? it rocked ? props to Rob D & James K for the awesome work & continuing awesome work on the web services exchange ? for those curious, I'm working on integrations & consulting now so I get to play with the services that we've built!! )

For any clients out there that would like on premise versions of these services ? please contact us and let us know, as I would love to see the on-premise versions get some high priority ? which they will if you contact us and let us know you want these in addition to our SaaS based OnDemand services!

Anyway, I?m stoked about the offerings coming down the pipeline and am exited to be working with them myself.  I look forward to working with clients & future customers on expanding these offerings and seeing what other data points we'll all come up with to track.

Follow

Get every new post delivered to your Inbox.

Join 3,273 other followers