# Kostenrechner 2026 - Next Steps & Testing Guide

**Last Updated:** 2026-01-21

## Pre-Deployment Checklist

### Code Verification

- [x] Ordio pricing verified (€89/location/month for Starter plan)
- [x] All calculation formulas verified (base hours, location scaling, total hours, costs, savings)
- [x] All year references verified (no "2025" references found)
- [x] No console statements found
- [x] Calculation logic reviewed
- [x] Comprehensive test script created (42 tests, 100% pass rate)
- [x] Documentation updated

### Automated Testing

- [x] Run test script: `node v2/scripts/dev-helpers/test-kostenrechner-calculations.js`
- [x] All 42 tests passing (100% pass rate)
- [x] Formula verification tests passing
- [x] Scaling factor tests passing
- [x] Edge case tests passing
- [x] Integration tests passing

## Manual Testing Checklist

### 1. Basic Calculation Functionality

**Test Scenarios:**

- [ ] **Single Location, 12 Employees, Default Values**
  - Employees: 12
  - Hourly Rate: €14
  - Planning Time: 3 h/week
  - Payroll Time: 2 h/week
  - Changes Time: 1.5 h/week
  - Locations: 1
  - Expected: Manual cost ~€450/month, Ordio cost €89/month, Savings ~€360/month
  - Verify: Calculations match expected results

- [ ] **Single Location, 1 Employee, Minimal Time**
  - Employees: 1
  - Hourly Rate: €10
  - Planning Time: 1 h/week
  - Payroll Time: 1 h/week
  - Changes Time: 0.5 h/week
  - Locations: 1
  - Expected: Low manual cost, Ordio cost €89/month
  - Verify: Calculations accurate

- [ ] **Multiple Locations (3), 20 Employees**
  - Employees: 20
  - Hourly Rate: €20
  - Planning Time: 5 h/week
  - Payroll Time: 3 h/week
  - Changes Time: 2 h/week
  - Locations: 3
  - Expected: Higher manual cost due to location scaling, Ordio cost €267/month
  - Verify: Location scaling factor applied correctly

- [ ] **High Employee Count (50), Single Location**
  - Employees: 50
  - Hourly Rate: €25
  - Planning Time: 8 h/week
  - Payroll Time: 5 h/week
  - Changes Time: 3 h/week
  - Locations: 1
  - Expected: High manual cost due to employee scaling
  - Verify: Employee scaling factors applied correctly

- [ ] **Zero Time Inputs**
  - Employees: 10
  - Hourly Rate: €15
  - Planning Time: 0 h/week
  - Payroll Time: 0 h/week
  - Changes Time: 0 h/week
  - Locations: 1
  - Expected: Manual cost €0, Ordio cost €89, Savings €0
  - Verify: Zero time handling correct

- [ ] **High Hourly Rate (€50)**
  - Employees: 15
  - Hourly Rate: €50
  - Planning Time: 4 h/week
  - Payroll Time: 2 h/week
  - Changes Time: 1 h/week
  - Locations: 1
  - Expected: High manual cost, significant savings
  - Verify: High rate calculations accurate

### 2. Scaling Factor Testing

**Test Scenarios:**

- [ ] **Planning Time Scaling (2% per employee)**
  - Test with 10 employees vs 20 employees
  - Same planning time input
  - Expected: Base hours increase with more employees
  - Verify: 2% scaling factor applied correctly

- [ ] **Payroll Time Scaling (1.5% per employee)**
  - Test with 10 employees vs 20 employees
  - Same payroll time input
  - Expected: Base hours increase with more employees
  - Verify: 1.5% scaling factor applied correctly

- [ ] **Changes Time Scaling (2.5% per employee)**
  - Test with 10 employees vs 20 employees
  - Same changes time input
  - Expected: Base hours increase with more employees
  - Verify: 2.5% scaling factor applied correctly

- [ ] **Location Scaling Factor - Single Location**
  - Locations: 1
  - Expected: Location factor = 1
  - Verify: Factor calculation correct

- [ ] **Location Scaling Factor - Two Locations**
  - Locations: 2
  - Expected: Location factor = 1.85
  - Verify: Factor calculation correct

- [ ] **Location Scaling Factor - Three Locations**
  - Locations: 3
  - Expected: Location factor = 2.7
  - Verify: Factor calculation correct

- [ ] **Location Scaling - Diminishing Returns**
  - Compare 2 locations vs 3 locations vs 4 locations
  - Expected: Each additional location adds 0.85 to factor
  - Verify: Diminishing returns logic correct

### 3. Edge Cases Testing

**Test Scenarios:**

- [ ] **Minimum Values (1 employee, 1 location, 0 hours)**
  - Employees: 1
  - Hourly Rate: €1
  - All times: 0 h/week
  - Locations: 1
  - Expected: Manual cost €0, Ordio cost €89, Savings €0
  - Verify: Minimum values handled correctly

- [ ] **Minimum Values with Some Time**
  - Employees: 1
  - Hourly Rate: €1
  - Planning Time: 0.5 h/week
  - Payroll Time: 0.5 h/week
  - Changes Time: 0.5 h/week
  - Locations: 1
  - Expected: Low manual cost, still below Ordio cost
  - Verify: Low cost scenarios handled correctly

- [ ] **Very High Employee Count (100)**
  - Employees: 100
  - Hourly Rate: €20
  - Planning Time: 10 h/week
  - Payroll Time: 6 h/week
  - Changes Time: 4 h/week
  - Locations: 1
  - Expected: Very high manual cost due to scaling
  - Verify: High employee count calculations accurate

- [ ] **Very High Hourly Rate (€100)**
  - Employees: 15
  - Hourly Rate: €100
  - Planning Time: 5 h/week
  - Payroll Time: 3 h/week
  - Changes Time: 2 h/week
  - Locations: 1
  - Expected: Very high manual cost, very high savings
  - Verify: High rate calculations accurate

- [ ] **Many Locations (10)**
  - Employees: 20
  - Hourly Rate: €15
  - Planning Time: 4 h/week
  - Payroll Time: 2 h/week
  - Changes Time: 1 h/week
  - Locations: 10
  - Expected: High manual cost, Ordio cost €890/month
  - Verify: Many locations calculations accurate

- [ ] **Zero Time Inputs with Multiple Locations**
  - Employees: 10
  - Hourly Rate: €15
  - All times: 0 h/week
  - Locations: 5
  - Expected: Manual cost €0, Ordio cost €445, Savings €0
  - Verify: Zero time with multiple locations handled correctly

- [ ] **Single vs Multiple Locations Comparison**
  - Same inputs, compare 1 location vs 3 locations
  - Expected: Multiple locations have higher total hours and costs
  - Verify: Location scaling affects calculations correctly

- [ ] **Savings Cannot Be Negative**
  - Low manual cost scenario (below Ordio cost)
  - Expected: Savings = 0 (not negative)
  - Verify: max(0, ...) logic working correctly

### 4. Form Validation Testing

**Test Scenarios:**

- [ ] **Required Fields**
  - Try submitting form with empty fields
  - Expected: HTML5 validation prevents submission
  - Verify: Required attribute working

- [ ] **Min Constraints**
  - Try entering 0 employees (should be prevented by min="1")
  - Try entering negative hourly rate (should be prevented by min="1")
  - Try entering negative time (should be prevented by min="0")
  - Expected: Browser prevents invalid values
  - Verify: Min constraints enforced

- [ ] **Step Values**
  - Try entering 0.25 for time (should allow 0.5 step)
  - Try entering 0.001 for hourly rate (should allow 0.01 step)
  - Expected: Step values enforced
  - Verify: Step attributes working

- [ ] **Invalid Inputs**
  - Try entering text in number fields
  - Try entering very large numbers
  - Expected: Browser validation or JavaScript prevents invalid inputs
  - Verify: Input validation working

### 5. Results Display Testing

**Test Scenarios:**

- [ ] **Currency Formatting (€ with 2 decimals)**
  - Calculate with various amounts
  - Expected: Manual cost and savings displayed as "X.XX €" format
  - Verify: `toLocaleString` formatting correct

- [ ] **Yearly Savings Formatting (whole numbers)**
  - Calculate savings
  - Expected: Yearly savings displayed as whole number (no decimals)
  - Verify: `Math.floor` applied correctly

- [ ] **Total Hours Display**
  - Calculate with various inputs
  - Expected: Total hours displayed as whole number
  - Verify: `Math.floor` applied correctly

- [ ] **All Calculations Displayed**
  - Verify: Manual cost monthly displayed
  - Verify: Savings monthly displayed
  - Verify: Savings yearly displayed
  - Verify: Total hours displayed
  - Verify: Ordio cost displayed (in pricing highlight)

- [ ] **Results Section Visibility**
  - Calculate with values that result in savings > 0
  - Expected: Results section appears (`x-show="savingsYearly > 0"`)
  - Verify: Conditional display working

- [ ] **Results Section Hidden**
  - Calculate with values that result in savings = 0
  - Expected: Results section hidden
  - Verify: Conditional display working

### 6. Schema Validation

**Google Rich Results Test:**

- [ ] **WebPage Schema**
  - URL: https://www.ordio.com/tools/kostenrechner
  - Expected: WebPage schema validates
  - Verify: No errors in Google Rich Results Test

- [ ] **FAQPage Schema**
  - URL: https://www.ordio.com/tools/kostenrechner
  - Expected: FAQPage schema validates with all 6 FAQs
  - Verify: All FAQs appear in rich results

- [ ] **WebApplication Schema**
  - URL: https://www.ordio.com/tools/kostenrechner
  - Expected: WebApplication schema validates
  - Verify: Calculator information appears correctly

### 7. Content Verification

**Content Review:**

- [ ] **Pricing References**
  - Verify: All pricing references show "€89" or "89€"
  - Verify: Pricing matches code (line 526: `locations * 89`)
  - Locations: Line 736, Line 846

- [ ] **Year References**
  - Verify: No "2025" references remain
  - Verify: Schema dates use PHP functions (dynamic)

- [ ] **Formula Explanations**
  - Verify: FAQ explanations match code logic
  - Verify: Examples calculate correctly

- [ ] **FAQs**
  - Verify: All 6 FAQs match schema FAQs
  - Verify: Examples in FAQs calculate correctly
  - Verify: Savings percentages mentioned (50-80%) are reasonable

### 8. Performance Testing

**Performance Checks:**

- [ ] **Page Load Time**
  - Expected: < 3 seconds
  - Verify: Page loads quickly

- [ ] **Calculation Speed**
  - Expected: < 100ms per calculation
  - Verify: Calculations are fast

- [ ] **No Console Errors**
  - Expected: No JavaScript errors
  - Verify: Browser console shows no errors

- [ ] **Responsive Design**
  - Expected: Works on mobile, tablet, desktop
  - Verify: Layout adapts correctly

### 9. User Experience Testing

**UX Checks:**

- [ ] **Form Usability**
  - Verify: All tooltips are helpful
  - Verify: Labels are clear
  - Verify: Input fields are easy to use

- [ ] **Results Display**
  - Verify: Results are clearly visible
  - Verify: Currency formatting is readable
  - Verify: Savings highlighted appropriately

- [ ] **CTA Buttons**
  - Verify: "Demo vereinbaren" button works
  - Verify: "Kostenlos testen" button works
  - Verify: Modal opens correctly

- [ ] **Smooth Scrolling**
  - Verify: Clicking "Jetzt berechnen" scrolls to results
  - Verify: Scroll behavior is smooth

## Deployment Checklist

### Pre-Deployment

- [x] All automated tests passing
- [ ] All manual tests completed
- [ ] Schema validation passed
- [ ] Content review completed
- [ ] Performance checks passed

### Deployment Steps

1. [ ] **Backup Current Version**
   - Create backup of `v2/pages/tools_kostenrechner.php`
   - Create backup of documentation files

2. [ ] **Deploy Code Changes**
   - Deploy test script `v2/scripts/dev-helpers/test-kostenrechner-calculations.js`
   - No code changes needed (pricing verified correct)

3. [ ] **Deploy Documentation**
   - Deploy updated documentation files
   - Deploy update summary
   - Deploy next steps guide

4. [ ] **Verify Deployment**
   - Check page loads correctly
   - Run automated tests on production
   - Verify schema markup on production

### Post-Deployment

- [ ] **Monitor for Errors**
  - Check error logs for 24 hours
  - Monitor user feedback
  - Check Google Search Console for schema errors

- [ ] **Verify Schema**
  - Re-run Google Rich Results Test
  - Verify FAQs appear in search results

- [ ] **Performance Monitoring**
  - Monitor page load times
  - Monitor calculation performance
  - Check for any performance regressions

## Verification Commands

### Run Automated Tests

```bash
node v2/scripts/dev-helpers/test-kostenrechner-calculations.js
```

Expected output:
```
Total Tests: 42
Passed: 42
Failed: 0
Success Rate: 100.0%
✅ All tests passed!
```

### Verify Ordio Pricing

```bash
grep -n "89\|ordioCostMonthly" v2/pages/tools_kostenrechner.php
```

Expected:
- Line 526: `this.ordioCostMonthly = this.locations * 89;`
- Line 736: "Ordio ab 89 € pro Standort & Monat"
- Line 846: "Ordio bietet transparente Preise ab 89€ pro Standort und Monat"

### Verify No Console Statements

```bash
grep -r "console\.\(log\|error\|warn\)" v2/pages/tools_kostenrechner.php
```

Expected: No matches

### Verify Year References

```bash
grep -n "2025" v2/pages/tools_kostenrechner.php
```

Expected: No matches (or only historical context)

## Notes

- All automated tests are passing (42/42 tests, 100% pass rate)
- All formulas have been verified (all correct)
- Ordio pricing verified as €89/location/month for Starter plan (2026)
- No console statements found
- All content updates have been completed
- Comprehensive test coverage has been added

**Ready for deployment pending manual testing and schema validation.**
