Table of Contents
This is a case study for use in a class like Software Development.
Please note: This case builds on a prior case called ‘Making HTML Manageable with CSS‘ and assumes familiarity with its contents.
Prototyping for Usability
Frangelico DeWitt and his team have just started developing a new suite of software for their employer HVAC in a Hurry (a heating and air conditioning service business). Their current focus is on a web application that helps field technicians find availability and pricing for replacement parts.
The good news is that he has an a working on JS fiddle (Making HTML Manageable) and a set of user stories about what he wants to test (see Appendix A).
As a next step, Frangelico has decided he needs to make the prototype interactive so he can test this user story:
‘I don’t know the part number and I want to try to identify it online so I can move the job forward.’
and these test cases:
Make sure it’s possible to search by make/model of units
Make sure it’s possible to search by type
Making Stuff Happen
Looking at the sample code in the JS Fiddle above, can you toggle (show/hide) the #search-controls div with JS? Specifically, how about having a click on the div with ID ‘toggle-search’ show/hide the div with ID ‘search-controls’?
How about a somewhat more involved challenge?! Right now, the code allows the user to filter by manufacturer and model. How would you extend it to also filter by part type?
What else do you think is worth trying? Try it out!
Exhibit A: User Stories
These stories are the primary focal point for the team: they describe both what the team has learned about the user and what they want to do for them. As you get into the details, it’s key not to lose sight of your design intent and what you’ve decided is important to the user.
Epic User Story
‘As Ted the HVAC technician, I want to identify a part that needs replacing so I can decide my next steps.’
Based on their observations in the field, Frangelico’s team thought through the user experience of the epic with the following storyboard:
|‘I know the part number and I want to find it on the system so I can figure out next steps on the repair.’||Make sure it’s possible to search by part number.
Make sure descriptive info. appears as the search narrows (photo?) to help avoid error.
|‘I don’t know the part number and I want to try to identify it online so I can move the job forward.’||Make sure it’s possible to search by make/model of units
Make sure it’s possible to search by type
|‘I don’t know the part number and I can’t determine it and I want help so I can move the job forward.’||Make sure an estimate of the turnaround time for an expert to review is available|
|‘I want to see the cost of the part and time to receive it so I decide on next steps and get agreement from the customer.’||Make sure it’s possible to dispatch a request by email to the customer in case they order their own parts and/or carry their own inventory of spares.
NOTE: How would the customer respond so we can help structure the next steps as we would otherwise?
|Make sure it’s possible to indicate priority
Make sure cost associated with priority delivery are available
|‘I want to order the part so that we can move forward with the repair.’|
Exhibit B: Working with the Sample Code on JS Fiddle
- In the HTML panel, you don’t need any of the exterior HTML tags, <body> on outward.
While machines are getting smarter and smarter, you’ll probably be surprised at how literal and specific you have to be when programming. A single semicolon in the wrong place can break your whole program. That may sound daunting, but all it really means is that you have to be very step-wise and test-driven when you program.
Notice that each full line/statement ends with a semicolon.
Logging to the Console
Since all of the work we’re doing is in the browser, that’s a good place to look at what your code is doing so you can expand and debug it in a test-driven way. Unless you have a strong preference and prior experience doing otherwise, I recommend using Google’s Chrome browser, and the rest of this material assumes that.
1: Click ‘Settings’ in the upper right
2: Disable the option ‘Console in the editor’
From there, to see the console in Chrome just right click within the browser and click ‘Inspect’. Now in the top of menu of the frame that appears, click ‘Console’. You’re there. For more, see this tutorial: The Console in Chrome.
The JS Fiddle below has the two statements you saw before, but now they’re sent to the console:
If you have the console open and you click Result, you’ll see the results of those two statements. Pro tip: You’ll probably be seeing other output from content on this page and maybe your own Chrome plug-in’s. If you use the filter control in type ‘index’, you’ll see just the JS Fiddle stuff.
Note: You will not see the console in JS Fiddle itself. The ‘Result’ screen shows what a user will see.
The If … Else Statement
Another thing you’ll notice in the sample code is if … else statements. Here’s a JS Fiddle with an example:
Comments and Commenting Out Code
You’ll see comments and you’ll probably want to use them to make notes to yourself and temporarily disable code as you’re trying things. For more on that, see this quick note: Comments in Javsascript.
Variables are a place you can store a value to use it later. If that sounds abstract, trust me, you’ll be doing it all the time once you get coding. In this snippet, we declare a variable ‘x’, change its value, and log that value to the console.
Quick note on variables vs. comparisons: In JS, ‘==’ is a comparison operator, meaning it asks ‘are these two things equal?’. The operators ‘!=’ does the opposite: checks if they’re not equal.
Interacting with View Elements (HTML & CSS)
JS has broad and deep support for interacting with end user ‘views’, particularly those implemented in HTML & CSS. Here’s an example, which is a simplified view of what you’ll see in the case:
Below is the JS Fiddle with the function body for filterParts() expanded. Note: my recommendation is just to have a quick look at this and then open the actual JS Fiddle and try making changes to it live so you can actively see how it works.
Supplemental Resources (Only if You’re Stuck)
- Written JS Tutorial on W3Schools: Intro to JS
While it’s probably more breadth than you need to get started, this tutorial does a nice job stepping through the fundamentals.