Advanced 25 min read

Review and Refactor

By the end of this lesson, you'll be able to:

  • Review the complete feature and its full test suite together
  • Confirm the test suite genuinely satisfies Module 31's meaningful-testing checklist
  • Recognize the shift this module represents in how testing fits into the development process

Prerequisites: "Test Edge Cases and Exceptions"

The complete test suite, at a glance

Across this module: interest-rate tiers and boundaries, monthly-payment calculation, every validation rejection and the acceptance path, a 200-record bulk test, status-decision boundaries (599/600), validation boundaries (299/300), and a mixed valid/invalid batch. This is a genuinely comprehensive suite — not because it hits some coverage percentage, but because Module 31's checklist was applied deliberately at every step.

Checking against Module 31's meaningful-testing checklist

  • Specific assertions, not weak ones? Yes — every test asserts an exact expected value.
  • Both happy path and exception paths covered? Yes — every validation rule has both a rejection and (at least one) acceptance test.
  • At least one bulk test? Yes — 200 records in one transaction.
  • Repeated setup extracted into a factory? Yes — LoanTestDataFactory, refactored in mid-module once real duplication justified it.

The real shift this module represents

Modules 26, 27, and 30 each built a feature, then manually verified it once, then (implicitly) left formal testing for later. This module built each piece and its tests together, immediately — the natural way testing fits into real development once @isTest is second nature rather than a separate topic bolted on afterward. Every project module from here forward assumes this same rhythm: write it, test it, right there, not as two separate phases.

Exercise

As a comment, describe the workflow shift this module represents compared to Module 26's "build everything, then verify manually at the end" structure.

Show hint

Think about when tests got written relative to when the logic got written.

APEX

Review and Refactor Quiz

1. What is the key structural difference between this module and Module 26's project structure?

Log in to submit the quiz and save your score.

My Notes

Log in to keep private notes on this lesson.

Questions about this lesson

No questions yet — be the first to ask.

Log in to ask a question about this lesson.

Summary

The closing lesson reviews the whole loan-processing feature and its test suite side by side, checking both against everything this course has taught since Module 9.