Boundary wise compression and corresponding tests