Quick example : where to draw the line on a unit test

This just came up and I've been asked numerous times "when do I draw the line?" when it comes to a set of tests.  Here's a great example of where that line happens...

 

    [TestClass]
    public class ExportStory_Tests
    {
        private string fakeXml = @"
<rss version=""0.92"">
  <channel>     
    <item>
          <title>[TEST-1] Test</title>
          <type id=""1"" iconUrl=""https://someinstance/"">Story</type>
    </item>
    <item>
          <title>[TEST-2] Test</title>
          <type id=""2"" iconUrl=""https://someinstance/"">Backlog</type>
    </item>
    <item>
          <title>[TEST-3] Test</title>
          <type id=""3"" iconUrl=""https://someinstance/"">Defect</type>
    </item>
    <item>
          <title>[TEST-4] Test</title>
          <type id=""4"" iconUrl=""https://someinstance/"">Task</type>
    </item>
  </channel>
</rss>
";

        private ExportStories _exportStories;
        private IEnumerable<XElement> _result;

        [TestInitialize]
        public void Setup()
        {
            _exportStories = new ExportStories(null, null);
            var elements = XDocument.Parse(fakeStoryXml).XPathSelectElements("rss/channel/item");
            _result = _exportStories.GrabStories(elements, new[] { "story", "backlog" });
        }

        [TestMethod]
        public void grabs_two_stories()
        {
            _result.Count().ShouldEqual(2);
        }

        [TestMethod]
        public void grabs_test_one_and_test_two()
        {
            _result.First().Element("title").Value.ShouldEqual("[TEST-1] Test");
            _result.Last().Element("title").Value.ShouldEqual("[TEST-2] Test");
        }
    }

More...

The Farmer Effect / Theory

Yesterday I recorded a podcast with Matt Groves -- a concept I've started calling "The Farmer Effect".  A few years ago, while sitting around with a bunch of teams, someone I was working with and I hit a wall.  I can't remember what it was, but it just wasn't going to work and I said "to hell with this, let's all quit and go be farmers".  A large number of devs agreed and started talking about how they'd rather spend a week in a field, or swinging a hammer ...than work on yet another report.

That touched a nerve.  From this frustration, how possible could it be that a full rejection of technology in nearly every way ... not seem crazy?  Like it's not a bad idea?  How and why was it a thing that a number of us all felt and was serious about??  I started asking more people in technology and many of them (~90% so far) had the same feeling with various degrees of intensity. A desire to do "hardware" instead of software.  I started digging, asking more questions. More...

Do an online conference like a pro

The online conference.  We've all been on these.  Someone can't figure out how to connect. Or someone's headset / phone is cutting out.  Or people talk over each other. Or saying their name when every time they speak (it shows up letting everyone know who it is).  Really I mean like this ...

More likely than not, it's been some variety of the one above.  On average, all of these things happen on every call and I have no idea why, it all seems so simple.  One day, after talking to a prospective client this email hit my inbox.
 
"Find out what headset Jesse is using.  His audio has been fantastic and I want to know all his secrets..."
 
Well, here's my list of secrets... :spoiler, it is nothing magical:More...

The art of the "Tentative" response

Meetings.  The bane of nearly all productivity ...and yet when one pops up, there's just one question that I was asking myself "Am I free or not?".  Clearly someone thinks it's important enough for me, otherwise why would someone request my time?  I MUST BE IMPORTANT TOO AND I. SHALL ATTEND ... <accept>!  Besides, nothing is more important than taking 30 minutes or more to get absolutely nothing done and feel good about it, right?  Anyway.
 
This is a terrible way to determine if I should go attend or not.  For now, I'll ignore all the logical bits that help me decide if I really should or not.  Things like looking at the actual contents of the invite, the 5 paragraph "touch points", "be on the same page" or "things to go over" that let me know its going to be amazingly painful and focus on the meeting equivalent of picking the null response from a nullable boolean.  Not accept, not decline -- the proverbial "meh".  The tentative response.
 
And so I starting doing this ...and unlocked something magical. More...

Revive the posts !

I don't have them queued up necessarily but I do have a number of drafts I want to publish in the next coming weeks.  Everything from mentoring, to code, to incomplete thoughts and questions.  I've wanted to get back to writing and I'm going to force encourage myself to do it.  Stay tuned, a lot of things are coming.

Let agile methods be like ice cubes

I did a few open spaces a while back and noticed a theme within many themes of the topics : as a community, we're really really good at prescriptive remedies -- "have this problem? Talk to your agile authority and use this tool/practice/method" which is largely a good way to fail. Go ask your doctor/mechanic/landscaper/lawyer for <insert fix for problem here> and they're going to ask you a TON of questions (if not, leave), maybe do some research or tests and you might end up with a different fix or nothing all together.  Why?  It's never that simple as checking all the symptom boxes and saying that's what you need, yet as a community, that's what we've been doing, a lot.

  • Confused about your process? Use kanban ! (guilty)
  • Stories take too long? Use scrum !
  • Not delivering ?  Use XP !
  • Need visibility ? Use this tool ! More...

Getting a handle on multiple HttpMockCallouts in Salesforce

Recently I've found myself in Salesforce land, having to deal with api callouts to VersionOne.  Being the second time around, I think I've got a set of classes now that really help out with this and I wanted to share my thoughts on it.

If you've attempted to test your callouts, I found either one of two things happen -- it's way too vague and/or it's way hard to test the things that are really worth testing.  You know, things that break stuff like a spelling error for a url or other silliness.  My first round of attempts looked like the examples and ended up coming out like this and felt overwhelming inadequate... More...

Stuck between agile and waterfall? You're not alone

Years ago when I was introduced to the agile process, I grasped the concept rather quickly and ran with it.  To me, it made total sense and I was all in.  As a team, we weren't full on agile necessarily (not even close), but it was a good start and we evolved.  Granted, this was a consulting group so adopting and trying things were a bit easier than it is for someone in, say, a large organization, but there are now a TON of big organizations on the agile adoption path.  I've heard many times over, "we're agile" ... and they're really not.  Old habits are tough to break, we're hard wired for it. It takes a good level of discipline to break it but that's if its just yourself.  With a team, it can be a mess.

Typically, there's a layer,  somewhere, deep within in the ranks that is all for agile (or at least really trying to do it right) and I see them kind of stuck and largely become frustrated.  More...

Salesforce Apex to VersionOne API

Recently I started doing some work for a client for some integration between Salesforce and VerisonOne.  When I first looked at how they were doing it, it was pretty clear there were some serious struggles which I kind of take personally (I was on the dev team for quite a while).

With the imposed limits of Apex, reusability is a must and for this case specifically, we were doing a lot of writes (POST).  Since Apex now has an XML object that helps with creating those, I came up with a set of objects that handle creating the proper payload for posts to the VersionOne API. More...

Opinion : Lack of Interaction is a self-fail

For the past ... probably 3 years I've tried to articulate this idea I've had into words that would make ANY bit of sense. I've tried various angles and had a few different theories and finally, this is what I came up with. Since my first attempt, I've witnessed different forms of this and have drawn a conclusion with utmost confidence.  "It's all about the people" isn't a cliché but solidly ... no one gives a damn and they should. Now, before you start saying "well duh" or make some excuse, hear me out. More...