The goal of good software design is to make code that is maintainable, flexible, reliable, and understandable. The first step we have in making better code is to make "clean" code. For code to be "clean" it must be easy to read and understand. It should clearly show what the programmer's intent is. To make clean code, we will learn to use meaningful names for variables, methods, and classes. We will also learn to employ the "Single Responsibility Principle": ensuring that one coding entity does one and only one thing.
To make code Reliable, we will review best practices for Debugging and Testing in Java.
First Design Principles
For each of these software design principles, be able to articulate it, why it matters, and what coding practices support it:
Single-Responsibility Principle
Encapsulation & Information Hiding
DRY (Don't Repeat Yourself)
Step-down Design
Clean Code - overall idea is to make the intentions of the programmer obvious
Be able to "clean up" code so that it:
Uses meaningful names, including using named constants
Conforms to Java conventions
Has one small, isolated main method
Includes comments where warranted, but prefers self-commenting code
Uses methods rather than duplicating code
Uses one level of abstraction per method
Uses small methods and classes
Debugging
Describe and use good strategies for debugging
Be able to identify some of the most common Java bugs
Testing
Create and Run JUnit tests
Describe different levels of test coverage
Describe Test Driven-Design
Clean Code:
Clean Code book, chapters 1-5