cdk-cost-analyzer 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/.cdk-cost-analyzer-cache/metadata.json +12 -0
  2. package/.gitlab-ci.yml +214 -0
  3. package/.husky/pre-commit +12 -0
  4. package/.kiro/hooks/accessibility-audit.kiro.hook +18 -0
  5. package/.kiro/hooks/api-schema-validation.kiro.hook +21 -0
  6. package/.kiro/hooks/auto-test-on-save.kiro.hook +19 -0
  7. package/.kiro/hooks/cdk-synth-on-change.kiro.hook +20 -0
  8. package/.kiro/hooks/code-coverage-check.kiro.hook +14 -0
  9. package/.kiro/hooks/commit-message-helper.kiro.hook +14 -0
  10. package/.kiro/hooks/dependency-update-check.kiro.hook +14 -0
  11. package/.kiro/hooks/env-file-validation.kiro.hook +18 -0
  12. package/.kiro/hooks/lint-and-format-on-save.kiro.hook +21 -0
  13. package/.kiro/hooks/mcp-config-validation.kiro.hook +17 -0
  14. package/.kiro/hooks/mcp-server-test.kiro.hook +14 -0
  15. package/.kiro/hooks/performance-analysis.kiro.hook +14 -0
  16. package/.kiro/hooks/readme-spell-check.kiro.hook +14 -0
  17. package/.kiro/hooks/security-scan-on-dependency-change.kiro.hook +21 -0
  18. package/.kiro/hooks/translation-update.kiro.hook +18 -0
  19. package/.kiro/hooks/update-documentation.kiro.hook +18 -0
  20. package/.kiro/settings/mcp.json +20 -0
  21. package/.kiro/specs/cdk-cost-analyzer/design.md +620 -0
  22. package/.kiro/specs/cdk-cost-analyzer/requirements.md +183 -0
  23. package/.kiro/specs/cdk-cost-analyzer/tasks.md +357 -0
  24. package/.kiro/specs/github-actions-ci/design.md +281 -0
  25. package/.kiro/specs/github-actions-ci/requirements.md +86 -0
  26. package/.kiro/specs/github-actions-ci/tasks.md +115 -0
  27. package/.kiro/specs/nlb-calculator-test-coverage/design.md +190 -0
  28. package/.kiro/specs/nlb-calculator-test-coverage/requirements.md +84 -0
  29. package/.kiro/specs/nlb-calculator-test-coverage/tasks.md +150 -0
  30. package/.kiro/specs/production-readiness/design.md +1213 -0
  31. package/.kiro/specs/production-readiness/requirements.md +312 -0
  32. package/.kiro/specs/production-readiness/tasks.md +269 -0
  33. package/.kiro/specs/repository-cleanup/design.md +283 -0
  34. package/.kiro/specs/repository-cleanup/requirements.md +74 -0
  35. package/.kiro/specs/repository-cleanup/tasks.md +64 -0
  36. package/.kiro/steering/aws-cli-best-practices.md +41 -0
  37. package/.kiro/steering/cdk-best-practices.md +49 -0
  38. package/.kiro/steering/development-standards.md +54 -0
  39. package/.kiro/steering/docker-best-practices.md +34 -0
  40. package/.kiro/steering/documentation-style.md +151 -0
  41. package/.kiro/steering/git-best-practices.md +37 -0
  42. package/.kiro/steering/mcp-best-practices.md +95 -0
  43. package/.kiro/steering/python-best-practices.md +48 -0
  44. package/.kiro/steering/react-best-practices.md +44 -0
  45. package/.kiro/steering/security-best-practices.md +41 -0
  46. package/.kiro/steering/testing-best-practices.md +59 -0
  47. package/.kiro/steering/typescript-best-practices.md +40 -0
  48. package/CHANGELOG.md +49 -0
  49. package/CONTRIBUTING.md +258 -0
  50. package/LICENSE +19 -0
  51. package/README.md +480 -0
  52. package/SECURITY.md +117 -0
  53. package/dist/api/index.d.ts +11 -0
  54. package/dist/api/index.js +65 -0
  55. package/dist/api/types.d.ts +15 -0
  56. package/dist/api/types.js +3 -0
  57. package/dist/cli/index.d.ts +2 -0
  58. package/dist/cli/index.js +262 -0
  59. package/dist/config/ConfigManager.d.ts +40 -0
  60. package/dist/config/ConfigManager.js +238 -0
  61. package/dist/config/index.d.ts +2 -0
  62. package/dist/config/index.js +19 -0
  63. package/dist/config/types.d.ts +72 -0
  64. package/dist/config/types.js +15 -0
  65. package/dist/diff/DiffEngine.d.ts +7 -0
  66. package/dist/diff/DiffEngine.js +73 -0
  67. package/dist/diff/index.d.ts +2 -0
  68. package/dist/diff/index.js +21 -0
  69. package/dist/diff/types.d.ts +20 -0
  70. package/dist/diff/types.js +3 -0
  71. package/dist/integrations/GitLabIntegration.d.ts +7 -0
  72. package/dist/integrations/GitLabIntegration.js +45 -0
  73. package/dist/integrations/index.d.ts +2 -0
  74. package/dist/integrations/index.js +21 -0
  75. package/dist/integrations/types.d.ts +11 -0
  76. package/dist/integrations/types.js +13 -0
  77. package/dist/parser/TemplateParser.d.ts +8 -0
  78. package/dist/parser/TemplateParser.js +75 -0
  79. package/dist/parser/index.d.ts +2 -0
  80. package/dist/parser/index.js +22 -0
  81. package/dist/parser/types.d.ts +30 -0
  82. package/dist/parser/types.js +3 -0
  83. package/dist/pipeline/PipelineOrchestrator.d.ts +23 -0
  84. package/dist/pipeline/PipelineOrchestrator.js +191 -0
  85. package/dist/pipeline/index.d.ts +2 -0
  86. package/dist/pipeline/index.js +19 -0
  87. package/dist/pipeline/types.d.ts +41 -0
  88. package/dist/pipeline/types.js +13 -0
  89. package/dist/pricing/CacheManager.d.ts +75 -0
  90. package/dist/pricing/CacheManager.js +195 -0
  91. package/dist/pricing/PricingClient.d.ts +17 -0
  92. package/dist/pricing/PricingClient.js +122 -0
  93. package/dist/pricing/PricingService.d.ts +16 -0
  94. package/dist/pricing/PricingService.js +149 -0
  95. package/dist/pricing/calculators/ALBCalculator.d.ts +16 -0
  96. package/dist/pricing/calculators/ALBCalculator.js +163 -0
  97. package/dist/pricing/calculators/APIGatewayCalculator.d.ts +10 -0
  98. package/dist/pricing/calculators/APIGatewayCalculator.js +177 -0
  99. package/dist/pricing/calculators/CloudFrontCalculator.d.ts +59 -0
  100. package/dist/pricing/calculators/CloudFrontCalculator.js +151 -0
  101. package/dist/pricing/calculators/DynamoDBCalculator.d.ts +9 -0
  102. package/dist/pricing/calculators/DynamoDBCalculator.js +146 -0
  103. package/dist/pricing/calculators/EC2Calculator.d.ts +7 -0
  104. package/dist/pricing/calculators/EC2Calculator.js +80 -0
  105. package/dist/pricing/calculators/ECSCalculator.d.ts +9 -0
  106. package/dist/pricing/calculators/ECSCalculator.js +116 -0
  107. package/dist/pricing/calculators/ElastiCacheCalculator.d.ts +8 -0
  108. package/dist/pricing/calculators/ElastiCacheCalculator.js +106 -0
  109. package/dist/pricing/calculators/LambdaCalculator.d.ts +13 -0
  110. package/dist/pricing/calculators/LambdaCalculator.js +111 -0
  111. package/dist/pricing/calculators/NLBCalculator.d.ts +16 -0
  112. package/dist/pricing/calculators/NLBCalculator.js +138 -0
  113. package/dist/pricing/calculators/NatGatewayCalculator.d.ts +12 -0
  114. package/dist/pricing/calculators/NatGatewayCalculator.js +116 -0
  115. package/dist/pricing/calculators/RDSCalculator.d.ts +9 -0
  116. package/dist/pricing/calculators/RDSCalculator.js +103 -0
  117. package/dist/pricing/calculators/S3Calculator.d.ts +8 -0
  118. package/dist/pricing/calculators/S3Calculator.js +68 -0
  119. package/dist/pricing/calculators/VPCEndpointCalculator.d.ts +12 -0
  120. package/dist/pricing/calculators/VPCEndpointCalculator.js +129 -0
  121. package/dist/pricing/index.d.ts +10 -0
  122. package/dist/pricing/index.js +37 -0
  123. package/dist/pricing/types.d.ts +53 -0
  124. package/dist/pricing/types.js +22 -0
  125. package/dist/releasetag.txt +1 -0
  126. package/dist/reporter/Reporter.d.ts +18 -0
  127. package/dist/reporter/Reporter.js +412 -0
  128. package/dist/reporter/index.d.ts +2 -0
  129. package/dist/reporter/index.js +21 -0
  130. package/dist/reporter/types.d.ts +72 -0
  131. package/dist/reporter/types.js +3 -0
  132. package/dist/synthesis/SynthesisOrchestrator.d.ts +26 -0
  133. package/dist/synthesis/SynthesisOrchestrator.js +243 -0
  134. package/dist/synthesis/index.d.ts +2 -0
  135. package/dist/synthesis/index.js +19 -0
  136. package/dist/synthesis/types.d.ts +17 -0
  137. package/dist/synthesis/types.js +13 -0
  138. package/dist/threshold/ThresholdEnforcer.d.ts +29 -0
  139. package/dist/threshold/ThresholdEnforcer.js +143 -0
  140. package/dist/threshold/index.d.ts +2 -0
  141. package/dist/threshold/index.js +19 -0
  142. package/dist/threshold/types.d.ts +15 -0
  143. package/dist/threshold/types.js +17 -0
  144. package/docs/CALCULATORS.md +820 -0
  145. package/docs/CI_CD.md +608 -0
  146. package/docs/CONFIGURATION.md +407 -0
  147. package/docs/DEVELOPMENT.md +387 -0
  148. package/docs/RELEASE.md +223 -0
  149. package/docs/TROUBLESHOOTING.md +847 -0
  150. package/examples/.cdk-cost-analyzer.yml +85 -0
  151. package/examples/.gitlab-ci.yml +125 -0
  152. package/examples/api-usage.js +26 -0
  153. package/examples/complex/base.json +16 -0
  154. package/examples/complex/target.json +29 -0
  155. package/examples/monorepo/.gitlab-ci.yml +251 -0
  156. package/examples/monorepo/README.md +341 -0
  157. package/examples/monorepo/package.json +27 -0
  158. package/examples/monorepo/packages/backend-infra/.cdk-cost-analyzer.yml +34 -0
  159. package/examples/monorepo/packages/backend-infra/bin/app.ts +16 -0
  160. package/examples/monorepo/packages/backend-infra/cdk.json +7 -0
  161. package/examples/monorepo/packages/backend-infra/lib/backend-stack.ts +128 -0
  162. package/examples/monorepo/packages/backend-infra/package.json +30 -0
  163. package/examples/monorepo/packages/backend-infra/tsconfig.json +11 -0
  164. package/examples/monorepo/packages/data-infra/.cdk-cost-analyzer.yml +38 -0
  165. package/examples/monorepo/packages/data-infra/bin/app.ts +16 -0
  166. package/examples/monorepo/packages/data-infra/cdk.json +7 -0
  167. package/examples/monorepo/packages/data-infra/lib/data-stack.ts +121 -0
  168. package/examples/monorepo/packages/data-infra/package.json +30 -0
  169. package/examples/monorepo/packages/data-infra/tsconfig.json +11 -0
  170. package/examples/monorepo/packages/frontend-infra/.cdk-cost-analyzer.yml +31 -0
  171. package/examples/monorepo/packages/frontend-infra/bin/app.ts +16 -0
  172. package/examples/monorepo/packages/frontend-infra/cdk.json +7 -0
  173. package/examples/monorepo/packages/frontend-infra/lib/frontend-stack.ts +60 -0
  174. package/examples/monorepo/packages/frontend-infra/package.json +30 -0
  175. package/examples/monorepo/packages/frontend-infra/tsconfig.json +11 -0
  176. package/examples/monorepo/tsconfig.json +35 -0
  177. package/examples/multi-stack/.cdk-cost-analyzer.yml +72 -0
  178. package/examples/multi-stack/.gitlab-ci.yml +184 -0
  179. package/examples/multi-stack/README.md +279 -0
  180. package/examples/multi-stack/bin/app.ts +36 -0
  181. package/examples/multi-stack/cdk.json +72 -0
  182. package/examples/multi-stack/lib/compute-stack.ts +128 -0
  183. package/examples/multi-stack/lib/networking-stack.ts +69 -0
  184. package/examples/multi-stack/lib/storage-stack.ts +141 -0
  185. package/examples/multi-stack/package-lock.json +4437 -0
  186. package/examples/multi-stack/package.json +42 -0
  187. package/examples/multi-stack/tsconfig.json +34 -0
  188. package/examples/simple/base.json +8 -0
  189. package/examples/simple/target.json +14 -0
  190. package/examples/single-stack/.NVP +0 -0
  191. package/examples/single-stack/.cdk-cost-analyzer.yml +52 -0
  192. package/examples/single-stack/.gitlab-ci.yml +126 -0
  193. package/examples/single-stack/README.md +184 -0
  194. package/examples/single-stack/UeK +0 -0
  195. package/examples/single-stack/bin/app.ts +16 -0
  196. package/examples/single-stack/cdk.json +72 -0
  197. package/examples/single-stack/lib/infrastructure-stack.ts +119 -0
  198. package/examples/single-stack/package-lock.json +4443 -0
  199. package/examples/single-stack/package.json +38 -0
  200. package/examples/single-stack/tsconfig.json +34 -0
  201. package/package.json +139 -0
  202. package/test-cdk-project/README-COMPUTE.md +141 -0
  203. package/test-cdk-project/README.md +95 -0
  204. package/test-cdk-project/app-with-compute.js +102 -0
  205. package/test-cdk-project/app.js +81 -0
  206. package/test-cdk-project/cdk-compute.json +3 -0
  207. package/test-cdk-project/cdk.context.json +7 -0
  208. package/test-cdk-project/cdk.json +3 -0
  209. package/test-cdk-project/cdk.out/TestStack.assets.json +21 -0
  210. package/test-cdk-project/cdk.out/TestStack.template.json +115 -0
  211. package/test-cdk-project/cdk.out/cdk.out +1 -0
  212. package/test-cdk-project/cdk.out/manifest.json +503 -0
  213. package/test-cdk-project/cdk.out/tree.json +1 -0
  214. package/test-cdk-project/cdk.out.base/TestStack.assets.json +21 -0
  215. package/test-cdk-project/cdk.out.base/TestStack.template.json +115 -0
  216. package/test-cdk-project/cdk.out.base/cdk.out +1 -0
  217. package/test-cdk-project/cdk.out.base/manifest.json +503 -0
  218. package/test-cdk-project/cdk.out.base/tree.json +1 -0
  219. package/test-cdk-project/cdk.out.target/TestStack.assets.json +21 -0
  220. package/test-cdk-project/cdk.out.target/TestStack.template.json +183 -0
  221. package/test-cdk-project/cdk.out.target/cdk.out +1 -0
  222. package/test-cdk-project/cdk.out.target/manifest.json +521 -0
  223. package/test-cdk-project/cdk.out.target/tree.json +1 -0
  224. package/test-cdk-project/package-lock.json +422 -0
  225. package/test-cdk-project/package.json +17 -0
  226. package/tools/workflows/README.md +102 -0
  227. package/tools/workflows/validate-workflows.js +109 -0
  228. package/tools/workflows/workflow-utils.ts +181 -0
@@ -0,0 +1,84 @@
1
+ # Requirements Document
2
+
3
+ ## Introduction
4
+
5
+ The NLBCalculator class currently has very low test coverage (15.82% statements, 40% functions) with most functionality untested. This feature will implement comprehensive test coverage to ensure the Network Load Balancer cost calculation logic is reliable and maintainable.
6
+
7
+ ## Glossary
8
+
9
+ - **NLBCalculator**: The class responsible for calculating AWS Network Load Balancer costs
10
+ - **NLCU**: Network Load Balancer Capacity Units - AWS pricing metric for NLB usage
11
+ - **PricingClient**: Interface for fetching AWS pricing data
12
+ - **MonthlyCost**: Data structure containing cost amount, currency, confidence level, and assumptions
13
+ - **ResourceWithId**: CDK resource representation with properties and metadata
14
+
15
+ ## Requirements
16
+
17
+ ### Requirement 1: Core Functionality Testing
18
+
19
+ **User Story:** As a developer, I want comprehensive tests for the NLBCalculator core methods, so that I can trust the cost calculations are accurate.
20
+
21
+ #### Acceptance Criteria
22
+
23
+ 1. WHEN the supports method is called with "AWS::ElasticLoadBalancingV2::LoadBalancer", THE NLBCalculator SHALL return true
24
+ 2. WHEN the supports method is called with any other resource type, THE NLBCalculator SHALL return false
25
+ 3. WHEN calculateCost is called with a network load balancer resource, THE NLBCalculator SHALL return a valid MonthlyCost object
26
+ 4. WHEN calculateCost is called with a non-network load balancer resource, THE NLBCalculator SHALL return zero cost with appropriate assumptions
27
+
28
+ ### Requirement 2: NLCU Calculation Testing
29
+
30
+ **User Story:** As a developer, I want to verify NLCU calculations are correct, so that cost estimates reflect actual AWS billing logic.
31
+
32
+ #### Acceptance Criteria
33
+
34
+ 1. WHEN calculating NLCU from new connections per second, THE NLBCalculator SHALL divide by 800 to get NLCU consumption
35
+ 2. WHEN calculating NLCU from active connections per minute, THE NLBCalculator SHALL divide by 100,000 to get NLCU consumption
36
+ 3. WHEN calculating NLCU from processed bytes, THE NLBCalculator SHALL convert monthly GB to hourly GB for NLCU calculation
37
+ 4. WHEN multiple NLCU calculations are performed, THE NLBCalculator SHALL use the highest value for billing
38
+ 5. WHEN custom usage parameters are provided, THE NLBCalculator SHALL use those instead of defaults
39
+
40
+ ### Requirement 3: Region Handling Testing
41
+
42
+ **User Story:** As a developer, I want to ensure region normalization works correctly, so that pricing lookups succeed for all supported regions.
43
+
44
+ #### Acceptance Criteria
45
+
46
+ 1. WHEN normalizeRegion is called with a supported AWS region code, THE NLBCalculator SHALL return the corresponding AWS pricing region name
47
+ 2. WHEN normalizeRegion is called with an unsupported region, THE NLBCalculator SHALL return the original region string
48
+ 3. WHEN getRegionPrefix is called with a supported AWS region code, THE NLBCalculator SHALL return the correct pricing prefix
49
+ 4. WHEN getRegionPrefix is called with an unsupported region, THE NLBCalculator SHALL return an empty string
50
+
51
+ ### Requirement 4: Error Handling Testing
52
+
53
+ **User Story:** As a developer, I want to verify error scenarios are handled gracefully, so that the application doesn't crash when pricing data is unavailable.
54
+
55
+ #### Acceptance Criteria
56
+
57
+ 1. WHEN pricing client returns null for hourly rate, THE NLBCalculator SHALL return zero cost with appropriate assumptions
58
+ 2. WHEN pricing client returns null for NLCU rate, THE NLBCalculator SHALL return zero cost with appropriate assumptions
59
+ 3. WHEN pricing client throws an exception, THE NLBCalculator SHALL return zero cost with error message in assumptions
60
+ 4. WHEN both pricing calls succeed, THE NLBCalculator SHALL return calculated cost with detailed assumptions
61
+
62
+ ### Requirement 5: Default Values Testing
63
+
64
+ **User Story:** As a developer, I want to verify default usage parameters are applied correctly, so that cost calculations work without custom configuration.
65
+
66
+ #### Acceptance Criteria
67
+
68
+ 1. WHEN no custom parameters are provided, THE NLBCalculator SHALL use 25 new connections per second
69
+ 2. WHEN no custom parameters are provided, THE NLBCalculator SHALL use 3000 active connections per minute
70
+ 3. WHEN no custom parameters are provided, THE NLBCalculator SHALL use 100 GB processed bytes per month
71
+ 4. WHEN custom parameters are provided, THE NLBCalculator SHALL override the corresponding defaults
72
+ 5. THE NLBCalculator SHALL use 730 hours per month for all time-based calculations
73
+
74
+ ### Requirement 6: Cost Calculation Accuracy Testing
75
+
76
+ **User Story:** As a developer, I want to verify the final cost calculation combines all components correctly, so that users get accurate monthly cost estimates.
77
+
78
+ #### Acceptance Criteria
79
+
80
+ 1. WHEN calculating total cost, THE NLBCalculator SHALL add hourly cost and NLCU cost
81
+ 2. WHEN calculating hourly cost, THE NLBCalculator SHALL multiply hourly rate by 730 hours
82
+ 3. WHEN calculating NLCU cost, THE NLBCalculator SHALL multiply NLCU rate by NLCU per hour by 730 hours
83
+ 4. WHEN returning cost results, THE NLBCalculator SHALL include detailed breakdown in assumptions
84
+ 5. WHEN calculations succeed, THE NLBCalculator SHALL set confidence level to "medium"
@@ -0,0 +1,150 @@
1
+ # Implementation Plan: NLBCalculator Test Coverage Enhancement
2
+
3
+ ## Overview
4
+
5
+ This implementation plan will create comprehensive test coverage for the NLBCalculator class, improving coverage from 15.82% to over 90% through unit tests and property-based tests.
6
+
7
+ ## Tasks
8
+
9
+ - [ ] 1. Set up test infrastructure and dependencies
10
+ - Install fast-check for property-based testing if not already available
11
+ - Create test directory structure for NLBCalculator tests
12
+ - Set up TypeScript configuration for test files
13
+ - _Requirements: All requirements (foundation for testing)_
14
+
15
+ - [ ] 2. Create test utilities and mocks
16
+ - [ ] 2.1 Implement MockPricingClient test double
17
+ - Create mock implementation of PricingClient interface
18
+ - Add methods to configure pricing responses and errors
19
+ - _Requirements: 4.1, 4.2, 4.3_
20
+
21
+ - [ ] 2.2 Create test resource factory
22
+ - Implement factory methods for creating test resources
23
+ - Support network load balancer, application load balancer, and generic resources
24
+ - _Requirements: 1.1, 1.2, 1.3, 1.4_
25
+
26
+ - [ ] 2.3 Create test data generators
27
+ - Implement generators for usage parameters, regions, and pricing data
28
+ - Support both valid and edge case scenarios
29
+ - _Requirements: 2.1, 2.2, 2.3, 2.4, 2.5_
30
+
31
+ - [ ] 3. Implement basic method tests
32
+ - [ ] 3.1 Test supports method functionality
33
+ - Test with AWS::ElasticLoadBalancingV2::LoadBalancer resource type
34
+ - Test with various other resource types
35
+ - _Requirements: 1.1, 1.2_
36
+
37
+ - [ ] 3.2 Write property test for supports method
38
+ - **Property 1: Resource Type Rejection**
39
+ - **Validates: Requirements 1.2**
40
+
41
+ - [ ] 3.3 Test region normalization methods
42
+ - Test normalizeRegion with supported and unsupported regions
43
+ - Test getRegionPrefix with supported and unsupported regions
44
+ - _Requirements: 3.1, 3.2, 3.3, 3.4_
45
+
46
+ - [ ] 3.4 Write property tests for region methods
47
+ - **Property 9: Unsupported Region Passthrough**
48
+ - **Property 10: Unsupported Region Empty Prefix**
49
+ - **Validates: Requirements 3.2, 3.4**
50
+
51
+ - [ ] 4. Implement NLCU calculation tests
52
+ - [ ] 4.1 Test individual NLCU calculations
53
+ - Test new connections per second calculation
54
+ - Test active connections per minute calculation
55
+ - Test processed bytes calculation
56
+ - _Requirements: 2.1, 2.2, 2.3_
57
+
58
+ - [ ] 4.2 Write property tests for NLCU calculations
59
+ - **Property 4: New Connections NLCU Calculation**
60
+ - **Property 5: Active Connections NLCU Calculation**
61
+ - **Property 6: Processed Bytes NLCU Calculation**
62
+ - **Validates: Requirements 2.1, 2.2, 2.3**
63
+
64
+ - [ ] 4.3 Test maximum NLCU selection logic
65
+ - Test with various combinations of NLCU values
66
+ - Verify highest value is always selected
67
+ - _Requirements: 2.4_
68
+
69
+ - [ ] 4.4 Write property test for maximum NLCU selection
70
+ - **Property 7: Maximum NLCU Selection**
71
+ - **Validates: Requirements 2.4**
72
+
73
+ - [ ] 5. Checkpoint - Ensure basic functionality tests pass
74
+ - Ensure all tests pass, ask the user if questions arise.
75
+
76
+ - [ ] 6. Implement cost calculation tests
77
+ - [ ] 6.1 Test default parameter usage
78
+ - Test constructor with no custom parameters
79
+ - Verify default values are used in calculations
80
+ - _Requirements: 5.1, 5.2, 5.3, 5.5_
81
+
82
+ - [ ] 6.2 Test custom parameter override
83
+ - Test constructor with custom parameters
84
+ - Verify custom values override defaults
85
+ - _Requirements: 5.4_
86
+
87
+ - [ ] 6.3 Write property test for custom parameter override
88
+ - **Property 8: Custom Parameter Override**
89
+ - **Validates: Requirements 2.5, 5.4**
90
+
91
+ - [ ] 6.4 Test cost calculation mathematics
92
+ - Test hourly cost calculation (rate × 730)
93
+ - Test NLCU cost calculation (rate × NLCU × 730)
94
+ - Test total cost addition
95
+ - _Requirements: 6.1, 6.2, 6.3_
96
+
97
+ - [ ] 6.5 Write property tests for cost calculations
98
+ - **Property 13: Cost Addition**
99
+ - **Property 14: Hourly Cost Calculation**
100
+ - **Property 15: NLCU Cost Calculation**
101
+ - **Validates: Requirements 6.1, 6.2, 6.3**
102
+
103
+ - [ ] 7. Implement error handling tests
104
+ - [ ] 7.1 Test null pricing responses
105
+ - Test when hourly rate is null
106
+ - Test when NLCU rate is null
107
+ - Verify zero cost and appropriate assumptions
108
+ - _Requirements: 4.1, 4.2_
109
+
110
+ - [ ] 7.2 Test pricing client exceptions
111
+ - Test various exception types
112
+ - Verify graceful error handling
113
+ - _Requirements: 4.3_
114
+
115
+ - [ ] 7.3 Write property test for exception handling
116
+ - **Property 11: Exception Handling**
117
+ - **Validates: Requirements 4.3**
118
+
119
+ - [ ] 8. Implement comprehensive integration tests
120
+ - [ ] 8.1 Test successful cost calculation flow
121
+ - Test end-to-end calculation with valid data
122
+ - Verify MonthlyCost structure and assumptions
123
+ - _Requirements: 1.3, 4.4, 6.4, 6.5_
124
+
125
+ - [ ] 8.2 Write property tests for successful calculations
126
+ - **Property 2: Valid MonthlyCost Structure**
127
+ - **Property 12: Successful Calculation Structure**
128
+ - **Validates: Requirements 1.3, 4.4, 6.4**
129
+
130
+ - [ ] 8.3 Test non-network load balancer handling
131
+ - Test with application load balancer
132
+ - Test with resources missing Type property
133
+ - Verify zero cost response
134
+ - _Requirements: 1.4_
135
+
136
+ - [ ] 8.4 Write property test for non-NLB resources
137
+ - **Property 3: Non-NLB Resource Zero Cost**
138
+ - **Validates: Requirements 1.4**
139
+
140
+ - [ ] 9. Final checkpoint and coverage verification
141
+ - Run test coverage analysis
142
+ - Verify coverage exceeds 90% for statements, branches, and functions
143
+ - Ensure all tests pass, ask the user if questions arise.
144
+
145
+ ## Notes
146
+
147
+ - Each task references specific requirements for traceability
148
+ - Property tests validate universal correctness properties using fast-check
149
+ - Unit tests validate specific examples and edge cases
150
+ - Both testing approaches are complementary and necessary for comprehensive coverage