Session 5.2 - Coding Discipline & Unit Quality
Chapter 8: Product Implementation | Duration: 1 hr
Learning Objectives
By the end of this session, you will be able to:
- Apply disciplined coding practices aligned with SDS
- Run personal code reviews with checklists
- Create effective unit tests before integration
- Log defects/time/size accurately for postmortem
Introduction
Coding is not free-form. Chapter 8 insists on adherence to standards, personal reviews, and unit tests to prevent defects from leaking into integration and system testing.
Coding Practices
Key Practices
- Code to the SDS—avoid redesign while coding; escalate design gaps.
- Follow naming, interface, and message standards.
- Use CM: check-in/checkout, baselines, change control (CCR).
- Keep code readable; comment intent where not obvious.
Personal Reviews
Personal code reviews precede inspections. Use checklists built from your defect history.
- Check interfaces, error handling, boundary conditions.
- Verify adherence to standards and traceability to design.
- Record defects found/fixed (LOGD) and time spent.
Unit Tests
High-quality unit tests reduce integration pain.
- Cover nominal, boundary, and out-of-range cases.
- Use stubs/drivers only when necessary; prefer designing order to avoid them.
- Log results and defects; keep repeatable test data.
Summary
- Discipline in coding, reviews, and unit tests prevents downstream rework.
- Personal reviews with checklists are mandatory before inspections.
- Unit tests must be thorough and logged; minimize ad-hoc stubs/drivers.
- Accurate data collection feeds postmortem learning and future estimates.