CPN CPE Software Engineering study materials
CPN CPE Software Engineering study resources

CPN CPE Software Engineering: Software Construction and Implementation

CPN CPE Software Engineering · Work through your exam, one topic at a time.

All guide sections

Software Construction and Implementation

What the domain covers

This domain tests coding practices that turn designs into reliable software: standards, code review, defensive programming, error handling, concurrency, refactoring, static analysis, builds, and continuous integration.

Core rules

  • Prefer clear, consistent code over clever code; follow team standards for naming, formatting, and structure.
  • Handle errors explicitly and preserve context; do not swallow exceptions or catch overly broad types without rethrowing or logging.
  • Manage resources deterministically; close files, connections, and locks in all paths.
  • Concurrency requires identified shared state, a synchronization strategy, and tests for interleavings.
  • Use static analysis and code review to catch defects that tests may miss.

Worked example

A counter is incremented by multiple threads with count = count + 1. The read-modify-write sequence is not atomic, so lost updates occur. Reasoning: two threads can read the same value before either writes. Fixes include an atomic increment operation or a lock around the critical section. The lock must cover both read and write, and tests should include concurrent increments and assert the final value.

Traps

  • Catching a generic exception and continuing as if nothing failed.
  • Ignoring resource cleanup on exception paths.
  • Assuming a single test run proves thread safety.
  • Refactoring without regression tests.

Exam focus

Identify the defect class first, then choose the smallest safe correction.