Constructions (the Software Coding or Development Phase) can be broken down into several small phases.
While Coding is only one part of Software Engineering, it is a large part, and part of being an engineer is being able to write good code!
Preparation
Make sure you understand the problem.
Understand the basic design principles and concepts
Pick a language that is appropriate – i.e. meets the needs of the software to be built and the environment that it will run.
Create a set of unit tests that will be applied once a component is written.
Coding Principles
Follow structure programming principles.
Consider the use of pair programming, or a similar review methodology.
Select data structures that will meet the needs of the design.
Keep Conditional Logic as Simple as possible. For example: if you have a series of if statements, use all less than, or all greater than for easier readability.
Create nested loops in a way that is testable.
Select meaningful variable and function names.
Write self-documenting code.
Use a visual layout that is easy to follow. (Good use of indenting, and file management.)
Validation Principles
Conduct a code walk through when appropriate.
Perform Unit Test as components are written.
Refactor code as necessary.
Testing Principles
Tests should be traceable to customer outcomes.
Tests should be planned long before testing begins.
Testing should start on the small (components) and work toward the large (integrated tests of the whole system).
Exhaustive testing is not possible!
Apply a level of testing commensurate with it’s expected fault density.
Track tests and look for patterns.
Include tests that show that the software is working as expected with correct data, not just “not breaking”.
Construction Principles – Coding, Validating, and Testing was originally found on Access 2 Learn