- Design comprehensive test datasets for your project
- Calculate expected outputs before running tests
- Test edge cases: missing data, extreme values, and boundary conditions
- Use Analytics and Data Inputs views to validate results
Designing test datasets
A good test dataset covers three scenarios: happy path, edge cases, and error cases.- Happy path
- Edge cases
- Error cases
Calculating expected outputs
Before running the pipeline, calculate the expected output for each test scenario by hand or in a spreadsheet. This is critical: without expected values, you can’t tell if the output is correct.Set up a spreadsheet
Enter your test data
Calculate batch-level outputs
Compute ledger totals
Validating results in Mangrove
After running Generate Batches, use these views to validate:Data Inputs view
Check that all events were created correctly:- Event count matches expected
- Datapoint values are correct
- Evidence is attached where required
- Date ranges are within the accounting period
Batch outputs
For each batch, verify:- Gross carbon matches your spreadsheet
- Allocated emissions are proportional to mass
- Transport emissions are assigned to the correct batch
- Net carbon = gross - total emissions
Ledger balances
Check that each ledger reconciles:- Credits (incoming batches) match expected values
- Debits (allocations to downstream ledgers) are correct
- Running balance makes physical sense
Systematic edge case testing
For each edge case, follow this pattern: Edge cases to test for Mangrove Biochar:Check your understanding
Why should you calculate expected outputs before running the pipeline?
Why should you calculate expected outputs before running the pipeline?
What are the 3 types of test scenarios you should create?
What are the 3 types of test scenarios you should create?
Next, learn about common problems and how to fix them in Lesson 5.3: Common Integration Pitfalls.