Strategic architecture, tactical design, and testable code principles (SOLID, Clean Architecture, Design Patterns, Testable Design)
97
97%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
A developer has asked you to apply the Strategy pattern to the following TaxCalculator. Review the code and determine whether the pattern is warranted.
// src/TaxCalculator.ts
export class TaxCalculator {
calculateVat(amount: number): number {
return amount * 0.2
}
}The developer's rationale: "We might add other tax types in the future. I want to be prepared with a Strategy interface."
Produce pattern-evaluation.md with:
Do NOT refactor the code.
clean-architecture
evals
references
design-patterns
solid-principles
testable-design