Tests for integration and weighted average using integration