Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mangrovesystems.com/llms.txt

Use this file to discover all available pages before exploring further.

What you’ll learn in this lesson:
  • 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
Testing a production accounting project isn’t just about running the pipeline and seeing if it works. You need pre-calculated expected outputs, systematic edge case coverage, and a clear process for validating every result.

Designing test datasets

A good test dataset covers three scenarios: happy path, edge cases, and error cases.
Normal operations with typical values. This is your baseline — if this doesn’t work, nothing will.Example for Mangrove Biochar (January 2024):
Event TypeCountTypical Values
Feedstock Receipt58-15 t wet mass, 10-20% moisture
Lab Analysis375-85% carbon, 0.2-0.5 H:C ratio
Biochar Delivery42-6 t biochar
Energy Consumption110,000 kWh, 500 gal propane
Transportation4100-250 km per delivery

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.
1

Set up a spreadsheet

Create a spreadsheet with columns for each input value and each intermediate/final calculation. Include all 5 steps from your Module 2 model plus the LCA calculations from Module 3.
2

Enter your test data

Fill in the test values for each event. Calculate each intermediate value step by step, exactly as your model should.
3

Calculate batch-level outputs

For each batch (delivery), compute: gross carbon, allocated emissions (proportional + direct), and net carbon.
4

Compute ledger totals

Sum all batch outputs per ledger. Verify that ledger balances reconcile (inputs = outputs + inventory changes).
Example spreadsheet layout:
DeliveryMass (t)Carbon %Gross tCO2eAlloc. ElecAlloc. PropaneTransportNet tCO2e
DEL-001380%8.811.250.610.116.84
DEL-002578%14.312.091.020.1411.06
DEL-003482%12.041.670.820.139.42
DEL-004279%5.800.830.410.094.47
Total1440.965.842.860.4731.79
The numbers above are illustrative — your actual values will depend on your model structure and emission factors. The point is to have a reference table before you run the pipeline, so you can compare against the results.

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:
Edge CaseExpected Behavior
Moisture = 50%Dry mass is halved; all downstream values proportionally reduced
H:C ratio = 0.75Permanence factor = 0.7 (lowest tier); net carbon is lower
Mass = 0.5 tVery small batch; emissions may be a large proportion of gross carbon
Distance = 0 kmTransport emissions = 0; only shared emissions allocated
Carbon content = 95%High carbon; verify no overflow or rounding errors
Document each edge case test and its result. This becomes your test suite — when you modify the model later, you can re-run these tests to catch regressions.

Check your understanding

Without pre-calculated expected values, you have no way to verify if the pipeline output is correct — only that it runs without errors. A pipeline can produce wrong numbers silently. Pre-calculated values give you a reference to compare against, catching formula errors, unit mismatches, and configuration problems.
Happy path (normal operations with typical values), edge cases (unusual but valid values that test boundaries), and error cases (invalid data that should be caught by validation). Together these cover the range of inputs your project might encounter in production.

Next, learn about common problems and how to fix them in Lesson 5.3: Common Integration Pitfalls.