Professional Documents
Culture Documents
Module 4 - Lesson Proper PDF
Module 4 - Lesson Proper PDF
GREAT!!!
You may now proceed to the main lesson.
Based on the preliminary activities, what did you notice about it?
________________________________________________________
CONGRATULATIONS!
You may now proceed to the lesson.
• 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.
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):
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.
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.
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.