Before you write one line of code, be sure you:
- Understand of the problem you’re trying to solve.
- Understand basic design principles and concepts.
- Pick a programming language that meets the needs of the software to be built and the environment in which it will operate.
- Select a programming environment that provides tools that will make your work easier.
- Create a set of unit tests that will be applied once the component you code is completed.
As you begin writing code, be sure you
- Constrain your algorithms by following structured programming practice.
- Consider the use of pair programming
- Select data structures that will meet the needs of the design.
- Understand the software architecture and create interfaces that are consistent with it.
- Keep conditional logic as simple as possible.
- Create nested loops in a way that makes them easily testable.
- Select meaningful variable names and follow other local coding standards.
- Write code that is self-documenting.
- Create a visual layout (e.g., indentation and blank lines) that aids understanding.
- All tests should be traceable to customer requirements.
- Tests should be planned long before testing begins.
- The Pareto principle applies to software testing.
- Testing should begin “in the small” and progress toward testing “in the large.”
- Exhaustive testing is not possible.
- Testing effort for each system module commensurate to expected fault density.
- Static testing can yield high results.
- Track defects and look for patterns in defects uncovered by testing.
- Include test cases that demonstrate software is behaving correctly.
After you’ve completed your first coding pass, be sure you:
- Conduct a code walk-through when appropriate.
- Perform unit tests and correct errors you’ve uncovered.
- Refactor the code.