Skip to content

Blogs

Age discrimination in the workplace

On Linkedin there's a spirited, 3000+ reply, about hiring those who are 50+ and needles to say most of the responses are positive about it. I've of course not read anything over about 100 replies, but my reading of the posts is the experience and stability brought are worth various quantities of gold.. For me it's almost a mute point, but then perhaps I 'get' it that you can't just rule out someone for a role base on age. It's ludicrous to think that age alone qualifies or disqualifies someone for a role in our software development and testing profession. I like the fact the UK is pretty hot on age discrimination. When I was in manufacturing virtually all the candidates were 50+ women looking for part or full-time roles on the production line for a bit of extra money. I guess my early working years just normalised the idea of hiring older members of staff. In truth, the 'youngsters' were seen as a liability and sad to say, provide themselves to be repeatedly. As the process engineer it was my role to set-up the manufacturing line, optimise layout and £££ return per square foot, research tool selection, get us through ISO9001, etc.

Looking back now, it was fun having these 50+ people (mostly ladies) work there, I mean it, I looked forward to getting into work and wandering over to the line, saying "good morning ladies" in a charming / slightly comedic way and having them take the micky with their "ooh, young maaan" response. I'm pretty much always happy, I don't laugh that much as a rule though, but I laughed every day with them. Thinking about it now I have a sense of colour, sunlight and fresh air, memories are funny eh? What really made it work was the mutual respect. As a 20 something I was in awe at the incredible experience they had, I would constantly ask their advice about how they'd set the line up, write up the instructions, sequence the build and so on. In turn, they produced so little bad quality product, the company let the 'quality controller' go, woops! We ended up just throwing the few defective units into recycling.

Now I'm in software testing and development, I don't see a massive amount of age discrimination. However, there are certainly roles that naturally fit with a person of a certain age. Senior Programme Managers are rarely 22, agile Ruby on Rails developers are rarely 55, except where these individuals are exceptional. But then, hey... they're exceptional so you'd expect them to break the typical patterns. Not that it isn't tricky to get exactly the role you may want for the salary or day rate you'd like. I'd really like to get hands on for 12 to 18 months with Ruby, Cucumber, RSpec, Selenium, etc. but there's younger more technically focused talent out there. I'm sure some of the younger talent would love to be at an investment bank running automation programmes through multiple off-shore teams, but they don't have the experience. That's not age discrimination, it's fitting the best person to the job, sometimes age means you aren't in the right place experience or career stage wise, but it's not the age that's the problem as such.

Talking of exceptions, the youngsters I come across today are a class apart from those I encountered 15 years ago. Our profession certainly breeds them like this to some degree, but I think da yoof have changed. The, let's say 22-25 year olds that I work with now, are in the main pretty inspiring. I consider myself to be the most educated, experienced, erudite, etc. that I have ever been, but I'm not convinced I was as bright and well educated as they are at their age. On the reverse, I don't think the 40 and 50 years olds of today are as old as they were 15 or 20 years ago either. My parents seemed ancient to me when they were 35, at 42 I feel like I've just left university. A general youthfulness of perspective permeates society more so than ever. Daily, I'll be asked for some guidance and advice from a slightly panicked more junior member of staff and I can barely feel a flicker of worry in my mind. Conversely, I turn clueless to the same people and ask for technical guidance and mentoring on how to best approach a problem, to see them answer the problem as if it were the simplest thing in the world. There's definitely a greater equality age wise, it's not perfect, but I don't see it as the disaster some would like to paint.

The 'age' problem exists when an employer assumes if you're over 50 you can't do the role, without any qualification than 'but you're over 50'. It's just like saying you can't do it because you're too young, you're black, an immigrant, a woman. Your blood should rightly boil in all cases. If you apply to a company like this or work for one, do everyone a favour and walk away as fast as you can. Their time is done anyway, they'll fade away into the black hole they deserve to be in soon enough, get away before you and others get sucked in.

The main question when applying for a role or hiring for the same, should of course be whether the person represents the best talent for the role. Career paths to date, education, experience, attitude, interests and outlook are all factors that play hugely into whether you're the right candidate for the role. The youthful and mature alike cry foul at not being able to get the roles they want.That the 50+ crowd shout that it's unfair is a great sign that times and expectations have changed. It's fantastic that people refuse to be limited by a false sense of limitation due to age, that a Linkedin post can get 3000+ responses agreeing age is irrelevant. Finally we're starting to see the first sparks of (some portions) of human society refusing to be held back. It can only be for the good.

However, despite my positive view on this point, there is a very real workplace issue that is not getting the notice it should.

A seriously bad issue. Bad as in as bad as racial and sexual discrimination. A problem so serious, so abhorrent, that no right minded individual should be staying quiet about it.

That problem, is workplace and pay inequality for women.

I'll talk about that in a future post.

Mark
Categories: Blogs

Conventional HTML in ASP.NET MVC: Building larger primitives

Jimmy Bogard - Fri, 07/25/2014 - 16:52

Other posts in this series:

We’ve taken our individual form elements quite far now, adopting a variety of conventions in our output to remove the boring, duplicated code around deciding how to display those individual elements. We have everything we need to extend and alter the conventions around those single elements.

And that’s a good thing – we want to keep using those primitives around individual elements. But what if we peeked a little bit larger? Are there larger common patterns in play that we can start incorporating? Let’s look at the basic input template, from Bootstrap:

<div class="form-group">
    @Html.Label(m => m.Password)
    <div class="col-md-10">
        @Html.Input(m => m.Password)
        @Html.ValidationMessageFor(m => m.Password, ""
          , new { @class = "text-danger" })
    </div>
</div>

Starting with the most basic element, the input tag, let’s look at gradually increasing scope of our building block:

  • Input
  • Input and validation
  • Input, validation in a div
  • Label and the div input
  • Form group

The tricky part here is that at each level, I want to be able to affect the resulting tags, some or all. Our goal here is to create building blocks for each level, so that we can establish a set of reusable components with sensible defaults along the way. This is a similar exercise as building a React class or Angular directive – establish patterns early and standardize your approach.

From the above list of items, I’ll likely only want to create blocks around increasing scopes of DOM elements, so let’s whittle this down to 3 elements:

  • Input
  • Input Block
  • Form Block

We already have our original Input method, let’s create the first input block.

Basic input block

Because we have our HtmlTag primitive, it’s trivial to combine elements together. This is a lot easier than working with strings or MvcHtmlStrings or the less powerful TagBuilder primitive. We’ll return the outer div tag, but we still need ways of altering the inner tags. This includes the Label, the Input, and Validator. Here’s our input block:

public static HtmlTag InputBlock<T>(this HtmlHelper<T> helper,
    Expression<Func<T, object>> expression,
    Action<HtmlTag> inputModifier = null,
    Action<HtmlTag> validatorModifier = null) where T : class
{
    inputModifier = inputModifier ?? (_ => { });
    validatorModifier = validatorModifier ?? (_ => { });

    var divTag = new HtmlTag("div");
    divTag.AddClass("col-md-10");

    var inputTag = helper.Input(expression);
    inputModifier(inputTag);

    var validatorTag = helper.Validator(expression);
    validatorModifier(validatorTag);

    divTag.Append(inputTag);
    divTag.Append(validatorTag);

    return divTag;
}

We create an Action<HtmlTag> for the input/validator tags. If someone wants to modify those two elements directly, instead of wonky anonymous-objects-as-dictionaries, we allow them full access to the tag via a callback, similar to jQuery. Next, we default those two modifiers to no-op if they are not supplied.

We then build up our input block, which consists of the outer div with the input tag and validator tag as children. In our view, we can replace the input block:

<div class="form-group">
    @Html.Label(m => m.Email)
    @Html.InputBlock(m => m.Email)
</div>
<div class="form-group">
    @Html.Label(m => m.Password)
    <div class="col-md-10">
        @Html.Input(m => m.Password)
        @Html.Validator(m => m.Password)
    </div>
</div>

Just to contrast, I included the non-input-blocked version. Now that we have this piece, let’s look at building the largest primitive, the form block.

Form input block

In the same tradition of Angular directives, React classes and Ember views, we can build larger components out of smaller ones, reusing the smaller components as necessary. This also ensures our larger component automatically picks up changes from the smaller ones. Here’s our FormBlock method:

public static HtmlTag FormBlock<T>(this HtmlHelper<T> helper,
    Expression<Func<T, object>> expression,
    Action<HtmlTag> labelModifier = null,
    Action<HtmlTag> inputBlockModifier = null,
    Action<HtmlTag> inputModifier = null,
    Action<HtmlTag> validatorModifier = null
    ) where T : class
{
    labelModifier = labelModifier ?? (_ => { });
    inputBlockModifier = inputBlockModifier ?? (_ => { });

    var divTag = new HtmlTag("div");
    divTag.AddClass("form-group");

    var labelTag = helper.Label(expression);
    labelModifier(labelTag);

    var inputBlockTag = helper.InputBlock(
        expression, 
        inputModifier, 
        validatorModifier);
    inputBlockModifier(inputBlockTag);

    divTag.Append(labelTag);
    divTag.Append(inputBlockTag);

    return divTag;
}

It’s very similar to our input block method, where we provide defaults for our initializers, create the outer div tag, build the child tags, apply child modifiers, and append those child tags to the outer div. Going back to our view, it becomes quite simplified:

@Html.FormBlock(m => m.Email)
@Html.FormBlock(m => m.Password)
<div class="form-group">
    <div class="col-md-offset-2 col-md-10">
        <div class="checkbox">
            @Html.Input(m => m.RememberMe).RemoveClasses()
            @Html.Label(m => m.RememberMe).RemoveClasses()
        </div>
    </div>
</div>

We have one outlier, our “remember me” checkbox, which I try to avoid at all costs. Let’s look at a couple of other examples. Here’s our register view:

@Html.ValidationSummary("", new { @class = "text-danger" })
@Html.FormBlock(m => m.Email)
@Html.FormBlock(m => m.Password)
@Html.FormBlock(m => m.ConfirmPassword)
<div class="form-group">
    <div class="col-md-offset-2 col-md-10">
        <input type="submit" class="btn btn-default" value="Register" />
    </div>
</div>

And here’s our reset password view:

@Html.ValidationSummary("", new { @class = "text-danger" })
@Html.Input(m => m.Code)
@Html.FormBlock(m => m.Email)
@Html.FormBlock(m => m.Password)
@Html.FormBlock(m => m.ConfirmPassword)
<div class="form-group">
    <div class="col-md-offset-2 col-md-10">
        <input type="submit" class="btn btn-default" value="Reset" />
    </div>
</div>

Much more simplified, with conventions around the individual input elements and HtmlHelper extensions around larger blocks. I would likely go an additional step and create an HtmlHelper extension around the buttons as well, since Bootstrap buttons have a very predictable, standardized set of HTML to build out.

We’ve removed a lot of our boilerplate HTML, but still allowed customization as needed. We also still expose the smaller components through InputBlock and Input, so that if the HTML varies a lot we can still keep the smaller building blocks. There’s still a bit of magic going on, but it’s only a click away to see what “FormBlock” actually does. Finally, what conventions really allow us to do is stop focusing on the minutiae of the HTML we have to include on every display/input block of HTML.

We remove bike shedding arguments and standardize our approach, allowing us to truly hone in on what is interesting, challenging or different. This is the true power of conventions – stop pointless and wasteful arguments about things that truly don’t matter through a standardized, but extensible, approach built on conventions.

In our next (and final) post, we’ll look at how we can extend these approaches for client-side templates built in Angular, Ember and more.

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

Categories: Blogs

More Reporting - Pitching at the right level

Yet another bloody blog - Mark Crowther - Fri, 07/25/2014 - 15:23
As mentioned before, a key part of any test delivery is the reporting we provide. In my experience, management are often not interested in the majority of what we do. Sure, at a high level they care about whether we know what we're doing, but they're not interested in the low level details as we are. For us, the fun is in the cleverness of analysis, writing great sets of test cases, executing in different ways, maybe adding some automation into the mix and so on. That for us is the important stuff and rightly so, you don't get a delivery without it. However, the management team need mainly just to know what was planned, what happened and where it leaves us. Hence the need for reporting that is informative, easily understood and readily actionable.

When looking at what reporting to provide remember, it's all an 'interpretation' of what happened and you can describe your activities in a way that fits with management expectations. If they're completely on-board with your approach that makes it easier, if not, you might need to get creative. An example that springs to mind was on an engagement where management wanted an approach that followed the typical SDLC phases, weekly steering committee meetings and dashboards produced in Powerpoint slides. Meanwhile the implementation team wanted a more agilistic approach. The desire was to deliver 'something' demonstrable, if not strictly usable, on a weekly basis. That meant following a Scrum like approach to planning and delivery, seemingly opposite to that which management was expecting. Leading this team in a not quite Scrum master role, was a manager who wanted not only weekly reporting updates but end of day updates too.

As the lucky one in charge of environments and testing, it was my job to reconcile the needs of all sides and report out on what the test team were delivering. The technique is to expose essentially the same information but in the way requested. Wow, that was insightful! Let's look at what that means in practice.

The SDLC approach means high level dates on a schedule, spanning key phases, perhaps at best breaking the phase down into key sub-milestones. Phases from this perspective are 'big' - Analysis, Planning, Execution and end of phase Reporting. As these phases proceed a weekly summary of progress for is provided to senior management and execs. This is a sequential, big-up-front approach so senior management expect reporting in that context. Reporting contains data in context of the phase, not so much the activities underneath. For the agilistic mindset, reporting like this can be frustrating, but it needs to be remembered that at some point up the chain, all reporting morphs into this. Board members and Shareholders don't want to know how many test cases in what state there were today. The daily detail needs to be rolled-up into one higher level report.

Where are we through the SDLC phase, are we on target for the end date?
What No. or % of the total are we at and is this matching our plan?
What are the high level common issues being faced?

This provides insight into management concerns which usually revolve around money. Is the implementation of the new software on-track with Product Lifecycle plans? Will the product hit market in time for the marketing activities planned? Is the ROI achievable in the time expected to maintain share price? It's a rare tester that sweats this stuff, it's a rare marketeer that sweats the defects and test automation details. For the team closer to the actual work, this level of reporting is too high - it's not adhering to our rules above of being informative and readily actionable.

Back in the team, the reporting needs to be closer to what we discussed in the End of Day Reporting blog article. With their agilistic mindset, the team need information that shows the heartbeat of the project day by day (half-day by half-day is my preference!). In this way they can slow down or speed up as required. This is informative and actionable for them, but isn't useful by senior management. Rolling the daily reports up into a weekly at the same level is also something the team management can respond to.

Looking in on the project, senior management see the sequential phases, following the SDLC as requested. Underneath, the team can be slicing delivery up into small chunks of daily usefulness.

Mark
Categories: Blogs

Conventional HTML in ASP.NET MVC: Validators

Jimmy Bogard - Thu, 07/24/2014 - 20:33

Other posts in this series:

We’re marching towards our goal of creating conventional components, similar to React classes or Angular directives, but there’s one last piece we need to worry about before we get there: validators.

Validators can be a bit tricky, since they largely depend on the validation framework you’re trying to use. My validation framework of choice is still Fluent Validation, but you can use others as well. Since the data annotation validators are fairly popular, this example will use that as the starting point.

First, we have to figure out what our validation HTML should look like, and how it should affect the rest of our output. But we don’t have a “Validator” convention, we only have “Label”, “Editor”, and “Display” as our possibilities.

Luckily, underneath the covers these Label etc. conventions are only categories of elements, and we can easily create a new category of conventions for our own purposes. The Label/Editor/Display properties are only convenience methods. In our base convention class, let’s create a new category of conventions via a similar property:

public class OverrideHtmlConventions : DefaultHtmlConventions
{
    protected ElementCategoryExpression Validators
    {
        get
        {
            var builderSet = Library
                .For<ElementRequest>()
                .Category("Validator")
                .Defaults;
            return new ElementCategoryExpression(builderSet);
        }
    }

    public OverrideHtmlConventions()
    {
        Editors.Always.AddClass("form-control");
        Labels.Always.AddClass("control-label");
        Labels.Always.AddClass("col-md-2");

This will allow us to append additional conventions to a Validator category of element requests. With a custom builder, we can create a default version of our validator span (without any validation messages):

public class SpanValidatorBuilder : IElementBuilder
{
    public HtmlTag Build(ElementRequest request)
    {
        return new HtmlTag("span")
            .AddClass("field-validation-error")
            .AddClass("text-danger")
            .Data("valmsg-for", request.ElementId);
    }
}

And add it to our default conventions:

public OverrideHtmlConventions()
{
    Validators.Always.BuildBy<SpanValidatorBuilder>();

    Editors.Always.AddClass("form-control");
    Labels.Always.AddClass("control-label");
    Labels.Always.AddClass("col-md-2");

The last part is actually generating the HTML. We need to do two things –

  • Determine if the current field has any validation errors
  • If so, build out the tag with the correct error text

The first part is actually fairly straightforward – ha ha just kidding, it’s awful. Getting validation messages out of ASP.NET MVC isn’t easy, but the source is available so we can just copy what’s there.

public static HtmlTag Validator<T>(this HtmlHelper<T> helper,
    Expression<Func<T, object>> expression) where T : class
{
    // MVC code don't ask me I just copied
    var expressionText = ExpressionHelper.GetExpressionText(expression);
    string fullHtmlFieldName 
        = helper.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName(expressionText);

    if (!helper.ViewData.ModelState.ContainsKey(fullHtmlFieldName))
        return new NoTag();

    ModelState modelState = helper.ViewData.ModelState[fullHtmlFieldName];
    ModelErrorCollection modelErrorCollection = modelState == null 
        ? null 
        : modelState.Errors;
    ModelError error = modelErrorCollection == null || modelErrorCollection.Count == 0 
        ? null 
        : modelErrorCollection.FirstOrDefault(m => !string.IsNullOrEmpty(m.ErrorMessage)) 
        ?? modelErrorCollection[0];
    if (error == null)
        return new NoTag();
    // End of MVC code

    var tagGeneratorFactory = DependencyResolver.Current.GetService<ITagGeneratorFactory>();
    var tagGenerator = tagGeneratorFactory.GeneratorFor<ElementRequest>();
    var request = new ElementRequest(expression.ToAccessor())
    {
        Model = helper.ViewData.Model
    };

    var tag = tagGenerator.Build(request, "Validator");

    tag.Text(error.ErrorMessage);

    return tag;
}

Ignore what’s going on in the first section – I just grabbed it from the MVC source. The interesting part is at the bottom, where I grab a tag generator factory, create a tag generator, and build an HtmlTag using the Validator category for the given ElementRequest. This is what our Label/Editor/Display methods do underneath the covers, so I’m just emulating their logic. It’s a bit clunkier than I want, but I’ll amend that later.

Finally, after building the base validator tag, we set the inner text to the error message we determined earlier. We only use the first error message – too many and it becomes difficult to read. The validation summary can still be used for multiple errors. Our view is now:

<div class="form-group">
    @Html.Label(m => m.Email)
    <div class="col-md-10">
        @Html.Input(m => m.Email)
        @Html.Validator(m => m.Email)
    </div>
</div>
<div class="form-group">
    @Html.Label(m => m.Password)
    <div class="col-md-10">
        @Html.Input(m => m.Password)
        @Html.Validator(m => m.Password)
    </div>
</div>

Since we know that every validation message will need that “text-danger” class applied, applying it once to our conventions means that we’ll never have to copy-paste that portion around ever again. And much easier to develop against than the MVC templates, which quite honestly, are quite difficult to develop against.

We could go a step further and modify our Label conventions to pick up on the “Required” attribute and show an asterisk or bold required field labels.

Now that we have quite a bit of consistency in our groups of form elements, in the next post we’ll look at tackling grouping multiple tags into a single input/form component.

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

Categories: Blogs

Networking is important–or what we are really not good at

Decaying Code - Maxime Rouiller - Thu, 07/24/2014 - 05:16

virtualbusinessMany of us a software developer work with computers to avoid contact with people. To be fair, we all had our fair share of clients that would not understand why we couldn’t draw red lines with green ink. I understand the reason why would rather stay away from people who don’t understand what we do.

However… (there’s always an however) as I recently started my own business recently, I’ve really started to understand the meaning of building your network and staying in contact with people. While being an MVP has always lead me to meet great people all around Montreal, the real value I saw was when it was a very good contact of mine that introduced me to one of my first client. He knew they needed someone with my skills and directly introduced while skipping all the queues.

You can’t really ask for more. My first client was a big company. You can’t get in there without either being a big company that won a bid, be someone that is renowned or have the right contacts.

You can’t be the big company, you might not ever be someone but you can definitely work on contacts and expanding the amount of people you know.

So what can you do to expand your contacts and grow your network?

Go to user groups

This is killing 2 birds with one stone. First, you learn something new. It might be boring if you already now everything but let me give you a nice trick.

Arrive early and chat with people. If you are new, ask them if they are new too, ask them about their favourite presentation (if any), where they work, whether they like it, etc. Boom. First contact is done. You can stop sweating.

If this person has been here more than once, s/he probably knows other people that you can be introduced.

Always have business cards

I’m a business owner now. I need to have cards. You might think of yourself a low importance developer but if you meet people and impress them with your skills… they will want to know where you hang out.

If your business doesn’t have 50$ to put on you, make your own!  VistaPrint makes those “Networking cards” where you an just input your name, email, position, social network, whatever on them and you can get 500 for less than 50$.

Everyone in the business should have business cards. Especially those that makes the company money.

Don’t expect anything

I know… giving out your card sounds like you want to sell something to people or that you want them to call you back.

When I give my card, it’s in the hope that when they come back later that night and see my card they will think “Oh yeah it’s that guy I had a great conversation with!”. I don’t want them to think I’m there to sell them something.

My go-to phrase when I give it to them is “If you have any question or need a second advice, call me or email me! I’m always available for people like you!”

And I am.

Follow-up after giving out your card

When you give your card and receive another in exchange (you should!), send them a personal email. Tell them about something you liked from the conversation you had and ask them if you could add them on LinkedIn (always good). Seem simple  to salesman but us developers often forget that an email the day after has a very good impact.

People will remember you for writing to them personally with specific details from the conversation.

Yes. That means no “copy/paste” email. Got to make it personal.

If the other person doesn’t have a business card, take the time to note their email and full name (bring a pad!).

Rinse and repeat

If you keep on doing this, you should start to build a very strong network of developers in your city. If you have a good profile, recruiters should also start to notice you. Especially if you added all those people on LinkedIn.

It’s all about incremental growth. You won’t be a superstar tomorrow (and neither am I) but by working at it, you might end-up finding your next job through weird contacts that you only met once but that were impressed by who you are.

Conclusion

So here’s the Too Long Didn’t read version. Go out. Get business cards. Give them to everyone you meet. You intention is to help them, not sell them anything. Repeat often.

But in the long run, it’s all about getting out there. If you want a more detailed read of what real networking is about, you should definitely read Work the Pond by Darcy Rezac. It’s a very good read.

Categories: Blogs

Massive Community Update 2014-07-04

Decaying Code - Maxime Rouiller - Thu, 07/24/2014 - 05:16

So here I go again! We have Phil Haack explaining how he handle tasks in his life with GitHub, James Chamber’s series on MVC and Bootstrap, Visual Studio 2014 Update 3, MVC+WebAPI new release and more!

Especially, don’t miss this awesome series by Tomas Jansson about CQRS. He did an awesome job and I think you guys need to read it!

So beyond this, I’m hoping you guys have a great day!

Must Read

GitHub Saved My Marriage - You've Been Haacked (haacked.com)

James Chamber’s Series

Day 21: Cleaning Up Filtering, the Layout & the Menu | They Call Me Mister James (jameschambers.com)

Day 22: Sprucing up Identity for Logged In Users | They Call Me Mister James (jameschambers.com)

Day 23: Choosing Your Own Look-And-Feel | They Call Me Mister James (jameschambers.com)

Day 24: Storing User Profile Information | They Call Me Mister James (jameschambers.com)

Day 25: Personalizing Notifications, Bootstrap Tables | They Call Me Mister James (jameschambers.com)

Day 26: Bootstrap Tabs for Managing Accounts | They Call Me Mister James (jameschambers.com)

Day 27: Rendering Data in a Bootstrap Table | They Call Me Mister James (jameschambers.com)

NodeJS

Nodemon vs Grunt-Contrib-Watch: What’s The Difference? (derickbailey.com)

.NET

Update 3 Release Candidate for Visual Studio 2013 (blogs.msdn.com)

Test-Driven Development with Entity Framework 6 -- Visual Studio Magazine (visualstudiomagazine.com)

ASP.NET

Announcing the Release of ASP.NET MVC 5.2, Web API 2.2 and Web Pages 3.2 (blogs.msdn.com)

Using Discovery and Katana Middleware to write an OpenID Connect Web Client | leastprivilege.com on WordPress.com (leastprivilege.com)

Project Navigation and File Nesting in ASP.NET MVC Projects - Rick Strahl's Web Log (weblog.west-wind.com)

ASP.NET Session State using SQL Server In-Memory (blogs.msdn.com)

CQRS Series (code on GitHub)

CQRS the simple way with eventstore and elasticsearch: Implementing the first features (blog.tomasjansson.com)

CQRS the simple way with eventstore and elasticsearch: Implementing the rest of the features (blog.tomasjansson.com)

CQRS the simple way with eventstore and elasticsearch: Time for reflection (blog.tomasjansson.com)

CQRS the simple way with eventstore and elasticsearch: Build the API with simple.web (blog.tomasjansson.com)

CQRS the simple way with eventstore and elasticsearch: Integrating Elasticsearch (blog.tomasjansson.com)

CQRS the simple way with eventstore and elasticsearch: Let us throw neo4j into the mix (blog.tomasjansson.com)

Ending discussion to my blog series about CQRS and event sourcing (blog.tomasjansson.com)

Architecture

Michael Feathers - Microservices Until Macro Complexity (michaelfeathers.silvrback.com)

Windows Azure

Azure Cloud Services and Elasticsearch / NoSQL cluster (PAAS) | I'm Pedro Alonso (www.pedroalonso.net)

NuGet

Monitoring nuget.org (blog.nuget.org)

Search Engines (ElasticSearch, Solr, etc.)

Fast Search and Analytics on Hadoop with Elasticsearch | Hortonworks (hortonworks.com)

Elasticsearch.org This Week In Elasticsearch | Blog | Elasticsearch (www.elasticsearch.org)

Solr vs. ElasticSearch: Part 1 – Overview | Sematext Blog on WordPress.com (blog.sematext.com)

Categories: Blogs

Community Update 2014-06-25

Decaying Code - Maxime Rouiller - Thu, 07/24/2014 - 05:16

So not everything is brand new since I did my last community update 8 days ago. What I suggest highly is the combination of EventStore and ElasticSearch in a great article by Tomas Jansson.

It’s definitely a must read and I highly recommend it. Of course, don’t miss the series by James Chambers on Bootstrap and MVC.

Enjoy all the reading!

Must Read

Be more effective with your data - ElasticSearch | Raygun Blog (raygun.io)

Your Editor should Encourage You - You've Been Haacked (haacked.com)

Exploring cross-browser math equations using MathML or LaTeX with MathJax - Scott Hanselman (www.hanselman.com)

CQRSShop - Tomas Jansson (blog.tomasjansson.com) – Link to a tag that contains 3 blog post that are must read.

James Chambers Series

Day 18: Customizing and Rendering Bootstrap Badges | They Call Me Mister James (jameschambers.com)

Day 19: Long-Running Notifications Using Badges and Entity Framework Code First | They Call Me Mister James (jameschambers.com)

Day 20: An ActionFilter to Inject Notifications | They Call Me Mister James (jameschambers.com)

Web Development

Testing Browserify Modules In A (Headless) Browser (derickbailey.com)

ASP.NET

Fredrik Normén - Using Razor together with ASP.NET Web API (weblogs.asp.net)

A dynamic RequireSsl Attribute for ASP.NET MVC - Rick Strahl's Web Log (weblog.west-wind.com)

Versioning RESTful Services | Howard Dierking (codebetter.com)

ASP.NET vNext Routing Overview (blogs.msdn.com)

.NET

Exceptions exist for a reason – use them! | John V. Petersen (codebetter.com)

Nuget Dependencies and latest Versions - Rick Strahl's Web Log (weblog.west-wind.com)

Trying Redis Caching as a Service on Windows Azure - Scott Hanselman (www.hanselman.com)

Categories: Blogs

Massive Community Update 2014-06-17

Decaying Code - Maxime Rouiller - Thu, 07/24/2014 - 05:16

So as usual, here’s what’s new since a week ago.

Ever had problem downloading SQL Server Express? Too many links, download manager, version selection, etc. ? Fear not. Hanselman to the rescue. I’m also sharing with you the IE Developer channel that you should definitely take a look at.

We also continue to follow the series by James Chambers.

Enjoy your reading!

Must Read

Download SQL Server Express - Scott Hanselman (www.hanselman.com)

Announcing Internet Explorer Developer Channel (blogs.msdn.com)

Thinktecture.IdentityManager as a replacement for the ASP.NET WebSite Administration tool - Scott Hanselman (www.hanselman.com)

NodeJS

Why Use Node.js? A Comprehensive Introduction and Examples | Toptal (www.toptal.com)

Building With Gulp | Smashing Magazine (www.smashingmagazine.com) James Chambers Series

Day 12: | They Call Me Mister James (jameschambers.com)

Day 13: Standard Styling and Horizontal Forms | They Call Me Mister James (jameschambers.com)

Day 14: Bootstrap Alerts and MVC Framework TempData | They Call Me Mister James (jameschambers.com)

Day 15: Some Bootstrap Basics | They Call Me Mister James (jameschambers.com)

Day 16: Conceptual Organization of the Bootstrap Library | They Call Me Mister James (jameschambers.com)

ASP.NET vNext

Owin middleware (blog.tomasjansson.com)

Imran Baloch's Blog - K, KVM, KPM, KLR, KRE in ASP.NET vNext (weblogs.asp.net)

Jonathan Channon Blog - Nancy, ASP.Net vNext, VS2014 & Azure (blog.jonathanchannon.com)

Back To the Future: Windows Batch Scripting & ASP.NET vNext | A developer's blog (blog.tpcware.com)

Dependency Injection in ASP.NET vNext (blogs.msdn.com)

.NET

Here Come the .NET Containers | Wintellect (wintellect.com)

Architecture and Methodology

BoundedContext (martinfowler.com)

UnitTest (martinfowler.com)

Individuals, Not Groups | 8th Light (blog.8thlight.com)

Open Source

Download Emojis With Octokit.NET - You've Been Haacked (haacked.com)

ElasticSearch

Elasticsearch migrations with C# and NEST | Thomas Ardal (thomasardal.com)

Categories: Blogs

Massive Community Update 2014-06-12

Decaying Code - Maxime Rouiller - Thu, 07/24/2014 - 05:16

So I’ve been doing a bit of an experiment. I’ve seen that those community updates are normally rather small. I’ve waited a whole week before posting something new to see if we have better content.

I like the “Massive Community Update” for the amount of links it provides and for the occasion to put James Chambers whole series in perspective.

If you’re still thinking about it… read it. It’s worth it.

Visual Studio “14” CTP

TWC9: Visual Studio "14" CTP Episode (channel9.msdn.com)

NDC Oslo 2014

0-layered architecture on Vimeo (vimeo.com)

Monitoring your app with Logstash and Elasticsearch on Vimeo (vimeo.com)

James Chambers Series

Day 7: Semi-Automatic Bootstrap – Display Templates | They Call Me Mister James (jameschambers.com)

Day 8: Semi-Automatic Bootstrap – Editor Templates | They Call Me Mister James (jameschambers.com)

Day 9: Templates for Complex Types | They Call Me Mister James (jameschambers.com)

Day 10: HtmlHelper Extension Methods | They Call Me Mister James (jameschambers.com)

Day 11: Realistic Test Data for Our View | They Call Me Mister James (jameschambers.com)

Web Development

NDC 2014: SOLID CSS/JavaScript & Bower talks | Anthony van der Hoorn (blog.anthonyvanderhoorn.com)

Browserify: My New Choice For Modules In A Browser / Backbone App (derickbailey.com)

.NET

Final Thoughts on Nuget and Some Initial Impressions on the new KVM | The Shade Tree Developer on WordPress.com (jeremydmiller.com)

C# - A C# 6.0 Language Preview (msdn.microsoft.com)

ASP.NET

Host AngularJS (Html5Mode) in ASP.NET vNext (geekswithblogs.net)

ASP.NET: Building Web Application Using ASP.NET and Visual Studio (channel9.msdn.com)

jaywayco » Is ASP.Net vNext The New Node.js (blog.jaywayco.co.uk)

Learn How to Build a Modern Web Application with Client Side JavaScript and ASP.NET (channel9.msdn.com)

Fire and Forget on ASP.NET (blog.stephencleary.com)

ASP.NET vNext Moving Parts: OWIN (whereslou.com)

POCO controllers in ASP.NET vNext - StrathWeb (www.strathweb.com)

Jon Galloway - A 30 Minute Look At ASP.NET vNext (weblogs.asp.net)

Miscellaneous

FIXED: Blue Screen of Death (BSOD) 7E in HIDCLASS.SYS while installing Windows 7 - Scott Hanselman (www.hanselman.com)

Guide to Freeing up Disk Space under Windows 8.1 - Scott Hanselman (www.hanselman.com)

GitHub for Windows 2.0 - You've Been Haacked (haacked.com)

Simplified Setup and Use of Docker on Microsoft Azure | MS OpenTech (msopentech.com)

Categories: Blogs

Community Update 2014-06-04 ASP.NET vNext, @CanadianJames MVC Bootstrap series and what we learned from C++

Decaying Code - Maxime Rouiller - Thu, 07/24/2014 - 05:16

So the big news is that Visual Studio 14 actually reached CTP. Of course, this is not the final name and is very temporary.

If you want to install it, I suggest booting up a VM locally or on Windows Azure.

Enjoy!

Visual Studio “14”

Visual Studio "14" CTP Downloads (www.visualstudio.com)

Announcing web features in Visual Studio “14” CTP (blogs.msdn.com)

Visual Studio "14" CTP (blogs.msdn.com)

ASP.NET vNext in Visual Studio “14” CTP (blogs.msdn.com)

Morten Anderson - ASP.NET vNext is now in Visual Studio (www.mortenanderson.net)

James Chambers MVC/Bootstrap Series

Day 4: Making a Page Worth a Visit | They Call Me Mister James (jameschambers.com)

Web Development

To Node.js Or Not To Node.js | Haney Codes .NET (www.haneycodes.net)

ASP.NET

aburakab/ASP-MVC-Tooltip-Validation · GitHub (github.com) – Translate MVC errors to Bootstrap notification

Download Microsoft Anti-Cross Site Scripting Library V4.3 from Official Microsoft Download Center (www.microsoft.com)

ASP.NET Web API parameter binding part 1 - Understanding binding from URI (www.strathweb.com)

Cutting Edge - External Authentication with ASP.NET Identity (msdn.microsoft.com)

Forcing WebApi controllers to output JSON (blog.bjerner.dk)

Videos

What – if anything – have we learned from C++? (channel9.msdn.com)

Search Engine

Elasticsearch.org Elasticsearch 1.2.1 Released | Blog | Elasticsearch (www.elasticsearch.org)

Elasticsearch.org Marvel 1.2 Released | Blog | Elasticsearch (www.elasticsearch.org)

Dealing with human language (www.elasticsearch.org)

Categories: Blogs

Late Community Update 2014-06-02 REST API, Visual Studio Update 3, data indexing, Project Orleans and more

Decaying Code - Maxime Rouiller - Thu, 07/24/2014 - 05:16

So I was at the MVP Open Days and I’ve missed a few days. It seems that my fellow MVP James Chambers has started a great initiative about exploring Bootstrap and MVC with lots of tips and tricks. Do not miss out!

Otherwise, this is your classic “I’ve missed a few days so here are 20,000 interesting links that you must read” kind of day.

Enjoy!

Must Read

AppVeyor - A good continuous integration system is a joy to behold - Scott Hanselman (www.hanselman.com)

This URL shortener situation is officially out of control - Scott Hanselman (www.hanselman.com)

James Chambers Bootstrap and MVC series

Day 0: Boothstrapping Mvc for the Next 30 Days | They Call Me Mister James (jameschambers.com)

Day 1: The MVC 5 Starter Project | They Call Me Mister James (jameschambers.com)

Day 2: Examining the Solution Structure | They Call Me Mister James (jameschambers.com)

Day 3: Adding a Controller and View | They Call Me Mister James (jameschambers.com)

Web Development

How much RESTful is your API | Bruno Câmara (www.bfcamara.com)

Data-binding Revolutions with Object.observe() - HTML5 Rocks (www.html5rocks.com)

ASP.NET

ASP.NET Moving Parts: IBuilder (whereslou.com)

Supporting only JSON in ASP.NET Web API - the right way - StrathWeb (www.strathweb.com)

Shamir Charania: Hacky In Memory User Store for ASP.NET Identity 2.0 (www.shamirc.com)

.NET

Missing EF Feature Workarounds: Filters | Jimmy Bogard's Blog (lostechies.com)

Visual Studio/Team Foundation Server 2013 Update 3 CTP1 (VS 2013.3.1 if you wish) (blogs.msdn.com)

TWC9: Visual Studio 2013 Update 3 CTP 1, Code Map, Code Lens for Git and more... (channel9.msdn.com)

.NET 4.5 is an in-place replacement for .NET 4.0 - Rick Strahl's Web Log (weblog.west-wind.com)

ASP.NET - Topshelf and Katana: A Unified Web and Service Architecture (msdn.microsoft.com)

Windows Azure

Episode 142: Microsoft Research project Orleans simplify development of scalable cloud services (channel9.msdn.com)

Tool

JSON to CSV (konklone.io)

Search Engines

The Absolute Basics of Indexing Data | Java Code Geeks (www.javacodegeeks.com)

Categories: Blogs

Incompatibility between Nancy and Superscribe

Decaying Code - Maxime Rouiller - Thu, 07/24/2014 - 05:16

So I’ve had the big idea of building an integration of Nancy and Superscribe and try to show how to do it.

Sadly, this is not going to happen.

Nancy doesn’t treat routing as a first class citizen like Superscribe does and doesn’t allow interaction with routing middleware. Nancy has its own packaged routing and will not allow Superscribe to provide it the URL.

Nancy does work with Superscribe but you have to hard-code the URL inside the NancyModule. So if you upgrade your Superscribe graph URL, Nancy will not respond on the new URL without you changing the hardcoded string.

I haven’t found a solution yet but if you do, please let me know!

Categories: Blogs

Skills Matrix & Development Plan - Template Walkthrough

Yet another bloody blog - Mark Crowther - Thu, 07/24/2014 - 00:33
One thing we'll get asked at some point is to assess the skills and competencies of the test team. To do that we need to understand what the skills competencies actually are and how we're going to assess them. We also need to decide what we're going to do with the information we gather.

Skills and competencies come in many shapes and forms. They draw on hard learning from the team members study up to raw experience gained over many years and projects delivered. As such we need to agree how to group them, then break them down into our Skills Matrix.



YouTube Channel: [WATCH, RATE, SUBSCRIBE]http://www.youtube.com/user/Cyreath


In the Skills Matrix on the site, we have the following examples:

  • Technical - Tools and Technology
  • Testing
  • Application

Clearly you could break these down in many ways, but these are a good start. Under each category we have entered specific examples such as;


  • Tools: ALM, UFT, Jira, Toad, PuTTY


Technology is more general and could include scripting languages, protocols or maybe servers and operating systems. As with all templates, it provides a guide but it's up to you to interpret and apply it to your unique testing or management problem.

Enumeration
In order for the team to be ranked (or rank themselves), we need to understand what those ranks are and what 'value' we're assigning. On the About tab, you'll see this has been defined as:

  Level   Definition 1 No knowledge   No practical, working knowledge, should be able to use if provided clear guidance 2 Awareness   Can work with existing solutions and practices, understand what to do but perhaps not fully why 3 Proficiency    Can maintain and provide minor improvements, notable skill in some areas 4 Competency   Full understanding of existing solutions and practices required for day to day work 5 Expertise   Able to critically assess and improve on current use and build future capability
Clear definitions are essential, but in no way perfect. Use these as a guide but encourage the team not to labour too much over them.

A word of warning...
When rolling out the Skills Matrix and asking the team to rank themselves, the first question will be 'Why?'. It isn't unreasonable that you'll spook the team into wondering what it might mean to rank low on the items you want to assess. You wouldn't be getting them to complete it if it wasn't relevant.

Be sure to reassure them, that this is to help identify the skill base of the team, to make assignment of testing tasks more effective, to identify ways in which the team members can be trained and so increase the team's capability. 

Professional Development Planning
You would do well to introduce a strong process of review and assessment of the team, before you roll out the Skills Matrix.

To help with this, grab a copy of the PDP Scratch Pad template and have a read through of the Developing the Team paper to learn more about implementing an appraisal process, both are on the main site.

Mark.

Liked this post?Say thanks by Following the blog or subscribing to the YouTube Channel!



Categories: Blogs

Seeking the Light – A question from a recent TDD training attendee

James Grenning’s Blog - Wed, 07/23/2014 - 21:51

Here is a good question, and my reply, from a recent attendee of my Test-Driven Development for Embedded C training.

Hi James,

As I work more with TDD, one of the concepts I am still struggling to grasp is how to test “leaf” components that touch real hardware. For example, I am trying to write a UART driver. How do I test that using TDD? It seems like to develop/write the tests, I will need to write a fake UART driver that doesn’t touch any hardware. Let’s say I do that. Now I have a really nice TDD test suite for UART drivers. However, I still need to write a real UART driver…and I can’t even run the TDD tests I created for it on the hardware. What value am I getting from taking the TDD approach here?

I feel like for low-level, hardware touching stuff you can’t really apply TDD. I understand if I didn’t have the hardware I could write a Mock, but in my case I have the hardware so why not just write the real driver?

I am really confused about this…and so are my co-workers. Can you offer any words of wisdom to help us see the light?

Thanks!

Seeking the Light

Hi Seeking the Light

I am happy to help. Thanks for the good question.

Unit tests and integration tests are different. We focussed on unit testing in the class. You test-drove the flash driver Tuesday afternoon. That showed you how to test-drive a device driver from the spec. You mocked out IORead and IOWrite, not the flash driver. You test-drove the flash driver so that when you go to the hardware you have code that is doing what you think it is supposed to do.

The unit tests you write with mock IO are not meant to run with the real IO device, but with the fake versions of IORead and IOWrite. You could run the test suite on the real hardware, but the unit tests would still use mock IO.

I think the flash driver exercise illustrated the value. Pretty much everyone that does the flash driver exercise cannot get the ready loop right without several attempts. Most end up with an infinite loop, or a loop that does not run at all. With the TDD approach, we discover logic mistakes like that during off-target TDD. We want to find logic mistakes during test-driving because they are easy to identify and fix with the fast feedback TDD provides. Finding the problem on-target with a lot of other code (that can be wrong) is more difficult and time consuming. If your diver ready check resulted in an infinite loop, that can be hard to find. Maybe your watchdog timer will keep resetting the board as you hunt for the problem. Bottom line, it is cheaper to find those mistakes with TDD.

TDD can’t find every problem. What if you were wrong about which bit was the ready bit? An integration test could find it. An integration test would use the real UART driver with the real IORead and IOWrite functions. These tests make sure that the driver works with the real hardware. These are different than the unit tests and are worth writing. You could put a loopback connector on your UART connector. Your integration test could send and receive test data over the loopback. If your was looking at the wrong bit for the ready check, you would still have an infinite loop, but that happens only if you mis-read the spec. You’d have to find that mistake via review or integration test.

An integration test may be partially automated. You don’t need to run these so often so, partial automation should be OK. You would only rerun them when you touch the driver or are doing some release. (Loopback is probably better in this case as it can run unattended.) So the test might output a string to a terminal and wait for a string to be entered. Depending on other signals that your driver supports, you may want to breakout and control those signals in a physical test harness.

An integration test for the flash driver would exercise the flash device through the driver. You might read and write blocks of values to the real flash device. You might do the flash identification sequence. You might protect a block and try to write to it. Your integration test would make sure modification is prevented and generates the right error message. These tests use the real versions of IORead and IOWrite and run on the hardware only. When integration problems are found, solve them and then go back to the unit tests and make them reflect reality. You will know which tests need to be changed, because once the integration problems are fixed, the associated unit test will fail.

Some other words in your question makes me want to talk about a fake UART driver. You will want a fake UART driver when you are test-driving code that uses the UART driver. For example a message processor that waits for a string will be much easier to test if you fake the get_string() function. You can build that fake with mocking or hand crafted, depending upon your needs.

All that said, in general the test above the hardware abstraction layer (the layer your UART driver is part of) are the most valuable tests. They should encompass your product’s intelligence and uniqueness. Hardware comes and then it goes, as do the drivers as the components change. Your business logic has, or should have, a long useful life. The business logic for a successful product should last longer than any hardware platform’s life. Consequently those test have a longer useful life too. If I was creating a driver from scratch, I would use TDD because it is the fastest way for me to work, and results in code that can be safely changed as I discover where my mistakes are.

I hope this helps.

James

Categories: Blogs

Conventional HTML in ASP.NET MVC: Data-bound elements

Jimmy Bogard - Wed, 07/23/2014 - 19:03

Other posts in this series:

We’re now at the point where our form elements replace the existing templates in MVC, extend to the HTML5 form elements, but there’s still something missing. I skipped over the dreaded DropDownList, with its wonky SelectListItem objects.

Drop down lists can be quite a challenge. Typically in my applications I have drop down lists based on a few known sets of data:

  • Static list of items
  • Dynamic list of items
  • Dynamic contextual list of items

The first one is an easy target, solved with the previous post and enums. If a list doesn’t change, just create an enum to represent those items and we’re done.

The second two are more of a challenge. Typically what I see is attaching those items to the ViewModel or ViewBag, along with the actual model. It’s awkward, and combines two separate concerns. “What have I chosen” is a different concern than “What are my choices”. Let’s tackle those last two choices separately.

Dynamic lists

Dynamic lists of items typically come from a persistent store. An administrator goes to some configuration screen to configure the list of items, and the user picks from this list.

Common here is that we’re building a drop down list based on set of known entities. The definition of the set doesn’t change, but its contents might.

On our ViewModel, we’d handle this in our form post with an entity:

public class RegisterViewModel
{
    [Required]
    public string Email { get; set; }

    [Required]
    public string Password { get; set; }

    public string ConfirmPassword { get; set; }

    public AccountType AccountType { get; set; }
}

We have our normal registration data, but the user also gets to choose their account type. The values of the account type, however, come from the database (and we use model binding to automatically bind up in the POST the AccountType you chose).

Going from a convention point of view, if we have a model property that’s an entity type, let’s just load up all the entities of that type and display them. If you have an ISession/DbContext, this is easy, but wait, our view shouldn’t be hitting the database, right?

Wrong.

Luckily for us, our conventions let us easily handle this scenario. We’ll take the same approach as our enum drop down builder, but instead of using type metadata for our list, we’ll use our database.

Editors.Modifier<EnitityDropDownModifier>();

// Our modifier
public class EnitityDropDownModifier : IElementModifier
{
    public bool Matches(ElementRequest token)
    {
        return typeof (Entity).IsAssignableFrom(token.Accessor.PropertyType);
    }

    public void Modify(ElementRequest request)
    {
        request.CurrentTag.RemoveAttr("type");
        request.CurrentTag.TagName("select");
        request.CurrentTag.Append(new HtmlTag("option"));

        var context = request.Get<DbContext>();
        var entities = context.Set(request.Accessor.PropertyType)
            .Cast<Entity>()
            .ToList();
        var value = request.Value<Entity>();

        foreach (var entity in entities)
        {
            var optionTag = new HtmlTag("option")
                .Value(entity.Id.ToString())
                .Text(entity.DisplayValue);

            if (value != null && value.Id == entity.Id)
                optionTag.Attr("selected");

            request.CurrentTag.Append(optionTag);
        }
    }
}

Instead of going to our type system, we query the DbContext to load all entities of that property type. We built a base entity class for the common behavior:

public abstract class Entity
{
    public Guid Id { get; set; }
    public abstract string DisplayValue { get; }
}

This goes into how we build our select element, with the display value showed to the user and the ID as the value. With this in place, our drop down in our view is simply:

<div class="form-group">
    @Html.Label(m => m.AccountType)
    <div class="col-md-10">
        @Html.Input(m => m.AccountType)
    </div>
</div>

And any entity-backed drop-down in our system requires zero extra effort. Of course, if we needed to cache that list we would do so but that is beyond the scope of this discussion.

So we’ve got dynamic lists done, what about dynamic lists with context?

Dynamic contextual list of items

In this case, we actually can’t really depend on a convention. The list of items is dynamic, and contextual. Things like “display a drop down of active users”. It’s dynamic since the list of users will change and contextual since I only want the list of active users.

It then comes down to the nature of our context. Is the context static, or dynamic? If it’s static, then perhaps we can build some primitive beyond just an entity type. If it’s dynamic, based on user input, that becomes more difficult. Rather than trying to focus on a specific solution, let’s take a look at the problem: we have a list of items we need to show, and have a specific query needed to show those items. We have an input to the query, our constraints, and an output, the list of items. Finally, we need to build those items.

It turns out this isn’t really a good choice for a convention – because a convention doesn’t exist! It varies too much. Instead, we can build on the primitives of what is common, “build a name/ID based on our model expression”.

What we wound up with is something like this:

public static HtmlTag QueryDropDown<T, TItem, TQuery>(this HtmlHelper<T> htmlHelper,
    Expression<Func<T, TItem>> expression,
    TQuery query,
    Func<TItem, string> displaySelector,
    Func<TItem, object> valueSelector)
    where TQuery : IRequest<IEnumerable<TItem>>
{
    var expressionText = ExpressionHelper.GetExpressionText(expression);
    ModelMetadata metadata = ModelMetadata.FromLambdaExpression(expression, htmlHelper.ViewData);
    var selectedItem = (TItem)metadata.Model;

    var mediator = DependencyResolver.Current.GetService<IMediator>();
    var items = mediator.Send(query);
    var select = new SelectTag(t =>
    {
        t.Option("", string.Empty);
        foreach (var item in items)
        {
            var htmlTag = t.Option(displaySelector(item), valueSelector(item));
            if (item.Equals(selectedItem))
                htmlTag.Attr("selected");
        }

        t.Id(expressionText);
        t.Attr("name", expressionText);
    });

    return select;
}

We represent the list of items we want as a query, then execute the query through a mediator. From the results, we specify what should be the display/value selectors. Finally, we build our select tag as normal, using an HtmlTag instance directly. The query/mediator piece is the same as I described back in my controllers on a diet series, we’re just reusing the concept here. Our usage would look something like:

<div class="col-md-10">
    @Html.QueryDropDown(m => m.User,
        new ActiveUsersQuery(),
        t => t.FullName,
        t => t.Id)
</div

If the query required contextual parameters – not a problem, we simply add them to the definition of our request object, the ActiveUsersQuery class.

So that’s how we’ve tackled dynamic lists of items. Depending on the situation, it requires conventions, or not, but either way the introduction of the HtmlTag library allowed us to programmatically build up our HTML without resorting to strings.

We’ve tackled the basics of building input/output/label elements, but we can go further. In the next post, we’ll look at building higher-level components from these building blocks that can incorporate things like validation messages.

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

Categories: Blogs

How do you take notes? Want to share it?

The Social Tester - Wed, 07/23/2014 - 13:53
As some of you may know I’ve been doing some on and off research over the last five years on note taking. I’ve been interviewing people, gathering notes, observing people and studying about note taking. I’m bringing all of this together in an upcoming book. The book will be released next year via Lean Pub... Read More
Categories: Blogs

The Deadline to Sign up for GTAC 2014 is Jul 28

Google Testing Blog - Wed, 07/23/2014 - 02:53
Posted by Anthony Vallone on behalf of the GTAC Committee

The deadline to sign up for GTAC 2014 is next Monday, July 28th, 2014. There is a great deal of interest to both attend and speak, and we’ve received many outstanding proposals. However, it’s not too late to add yours for consideration. If you would like to speak or attend, be sure to complete the form by Monday.

We will be making regular updates to our site over the next several weeks, and you can find conference details there:
  developers.google.com/gtac

For those that have already signed up to attend or speak, we will contact you directly in mid August.

Categories: Blogs

Test Status Report - Template and Walkthrough

Yet another bloody blog - Mark Crowther - Wed, 07/23/2014 - 02:27
As mentioned in the End of Day Reporting - Worked Example article, EoD reporting is something we'll get asked to do as software testers, on virtually all our projects. In fact it should be literally all our projects, even when we're not asked we should provide it.

In order to do so, we need a means to capture the data that will be included in a report. That data is just data though and we need to convert it into easily digestible information. Be mindful that raw numbers may be accurate and are valuable, but they are often devoid of meaning. When reporting, don't be shy about including context and narrative - your report may be unreadable without it!

The previous article on End of Day reporting covered some points around presentation, so let's look at capturing and interpreting the raw data here. When reading through this article, have a copy of the template open in front of you. We'll walk-through each of the key sections here, but it's best to watch the YouTube video and refer to the template for a more in depth look at the Workbook.

Get a copy of the Test Status Tracker Template



YouTube Channel: [WATCH, RATE, SUBSCRIBE]http://www.youtube.com/user/Cyreath
Oh, watch out for formulas, there are plenty of them on the Worksheets!

--------------

Project Details
Enter the following details about the application. This data is used throughout the Workbook.

Project Name: [Enter the name of the project or application under test]
Start Date: [Enter the date as nn-mmm, e.g. 21-Jul]
Total No of Cases: [Enter the total Test Cases in scope]

Daily Tracker
There is nothing you need to enter on this tab. It is generated from the Data Table and Issue Tracker tabs. However, you will need to manually edit chart symbol colours. Refer to the status table and review variance against plan on the chart. You'll then need to select the individual data point on the green Actual line, then fill the correct colour into the point.

Data Table
There are two main sections, Planned and Actual, where you need to enter data. Before completing the table, enter the names of the testing staff in the left hand column. When planning out the amount items that will be worked on each day, enter the total in the above 'Total No. Of Test Cases' box first. Then map out what can be delivered on a day by day basis, for each member of staff.

At the end of each day, enter the Actual numbers achieved by each team member.
With the data in place you will need to select the calculation cells at the bottom of the 'Actual' table and using the fill handle, populate the cells under the day you have just entered data for

This is done daily to avoid showing zero figures on the chart, making progress easier to see.

Issues Tracker
Where an issue or risk emerges during delivery, track it on this tab if your project has no other central place to record the data.

Downtime Tracker
Each time the team are unable to progress with delivery due to some issue, this is 'downtime' and should be recorded on the Downtime Tracker tab.

The tracker forms a historic record of time lost and allows reconciliation of lost time against plan, to support reporting and re-scheduling activities.

--------------

As stated above, watch the video for a clearer run-down of the tracker. This is one worked example to show some tricks and tips of how you can make your own. If you make any interesting changes be sure to let us know!

Mark


Liked this post?
Say thanks by Following the blog or subscribing to the YouTube Channel!



Categories: Blogs