Petr Heinz is co-developing ShopSys Framework and he is going to speak about writing tests in a clean way in this video. First, he speaks about different layers of tests e.g. unit test, database tests etc. Second, he explains some of the features of a good tests and speaks about three phases of a typical test (arrange, act, assert). Other topics are naming of the testing methods and mocking. Everything is being explained on codes straight from ShopSys Framework.
Video and presentation
Petr provides with some advice in conclusion which are worth repeating. Tests are not an obligation — they should help to rewrite the code in a way that is easier to work with. Start testing the most important scenarios. It is worth to keep demo data well maintained. Some tests are worth deleting.
Čtěte také