You are on page 1of 4

IS Innovation and New Technologies Page 1 of 10

Software Problems Part 2

GREAT!!!
You may now proceed to the main lesson.

IV. LESSON PROPER

Based on the preliminary activities, what did you notice about it?
________________________________________________________
CONGRATULATIONS!
You may now proceed to the lesson.

What kind of problem?


Note that when we talk about a software development problem, I mean a problem of any size and scope:

• You’re trying to do a very specific thing and you can’t get some piece of it to behave as expected.
• You’re seeing a strange error message and you have no idea what it means.
• You’re trying to figure out some cryptic section of a legacy code base when the original developers
have all left the organization.
• You know generally what you want to build, but you have no idea what the individual components
of the project will look like.
• You’re trying to decide what software package to use and you don’t know which one is best.
• You know there’s a function to do exactly what you want, but you can’t remember what it’s called.

Identify and understand the problem


This is easier in some cases than in others. Sometimes you get a straightforward error message and you
realize you made a simple mistake: a syntax error, forgetting to pass all the variables you need into a function,
neglecting to import a package.
On the other hand, sometimes the error is totally baffling. Often a bug won’t present itself with flashing red
lights—the program just doesn’t do what you want it to do.
IS Innovation and New Technologies Page 2 of 10
Software Problems Part 2

Even when this is the case, you can try your best to articulate the problem. Ask yourself the following
questions (and maybe even write down the answers):

• What am I trying to do?


• What have I done already?
• What do I think the program should be doing?
• What is it actually doing?

Why do we need to identify the Problem ?


______________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________

Gathering information
Sometimes we see people skipping straight to this step without having done the previous one. Examples
include:
• Googling Stack Overflow as a first step.
• Copying and pasting code—whether from Stack Overflow, a tutorial, or elsewhere in your
codebase—without understanding what it does.

We believe this practice leads to “solving” problems without fully understanding them. That’s not to say any
of these resources—Stack Overflow, tutorials, any other examples you find—are bad. But they should be
treated as a single tool in your toolbox, not the start and end of the problem-solving process.

Iterate potential solutions


Try something. It doesn’t have to be perfect. If you see anything change as a result, that’s a success. You’ll
improve on it soon. Then keep trying things until you’ve made substantial progress on the problem.
IS Innovation and New Technologies Page 3 of 10
Software Problems Part 2
If you’re in unfamiliar territory, it can help to break down the “solution” into very small increments and try them
out piece by piece. Print your data to the console before you worry about how it’ll be rendered. Call a function
you haven’t used before with simple hardcoded arguments and get it to run as expected before replacing
them with the actual data you’ll be using in your application.
This still applies if you’re using someone else’s code from Stack Overflow or a tutorial as an example. Don’t
just copy and paste the code into your editor—type out the code line by line. This has two advantages. First,
you’re forced to engage with the code and understand it in more detail. Second, you’ll have the chance to
update anything that doesn’t translate perfectly to your application.

If you iterate like this for a long time and don’t seem to be getting anywhere, maybe it’s time to start back at
step one and try something different. But if you can get something to work, even if it’s not exactly what you
had in mind, now’s a good time to move on to the next step.

Is Gathering Data Helps you to formulate Solution to a problem? How?


______________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________

Test your solution


Often, we do this by hand: load a web page and check that it contains all the elements we expect it to render.
Try replicating the conditions that led to a bug and confirm that the bug no longer happens. Try using the
feature we added in a few different ways and see what happens.

Another way we do this is with automated tests. Adding a test that asserts a feature works as predicted or a
bug no longer occurs helps prevent unexpected problems down the line.
Test-driven development is an alternate approach that starts with this step rather than leaving it to the end.
For each change you make to your project, you start by writing a test that asserts the change will work as
predicted, then make the change.
IS Innovation and New Technologies Page 4 of 10
Software Problems Part 2
One advantage to the test-driven approach is that it forces you to think about what success means before
you start working on a given section of the project. This is a good question to ask yourself whether you start
by writing a test, write one at the end, or verify your change worked by some other means. It’s part of the first
step defined here—identify and understand the problem—because it’s so fundamental to finding a solution.

Even if you are writing automated tests before you add any program code, you’ll be checking that a given
portion of work satisfies what you’re trying to do: running the test suite, and trying the feature to make sure it
works as expected.

What do we expect on Testing a Solution for a Problem?


_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
______________________________

You might also like