create and use chapter 3 of Tests
few refactoring