What is the best way to test new consensus protocol?

I wanted to test a new consensus protocol. However, the bitcoin core is a large codebase (>100k lines). Is there any small codebase which is designed to test new consensus protocols and includes only essential features of a cryptocurrency?