HaruAtari2015-09-24 02:02:37
HaruAtari, 2015-09-24 02:02:37

Advanced testing literature?

Good afternoon.
I was puzzled by the quality of my tests lately. I write tests. Modular and functional. I write a lot of them - about a third of the code is tests. The coverage is pretty good and the tests really help.
But I feel like my tests are shit. I am having difficulty with a number of things. For example, testing AR models, integration tests for applications whose architecture is tied to queues, testing smart-ass event-driven systems. There are tests, but they are not stable and difficult to maintain. A lot of time is spent on them.
I need literature (books, articles, code samples) from where I can get a more detailed and deep understanding of what tests should be. I don't care for posts about what TDD is, how tests are useful, and how to test the x+y function. We need best practice. I would be grateful to everyone who shares their experience.
I'm interested in the theory in general, but first of all, what concerns the php code.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
matperez, 2015-09-24

No matter how ridiculous it sounds, I myself did not read these books, but when I was collecting a collection similar to yours, I noticed that they were recommended in many places regardless of the language:
ActiveRecord is normally tested with partial mocks. Even requests are normally tested if they are placed in a separate class, and ActiveRecord::find() is used only as a facade to get an instance of the class with requests.
P.S. Share what you found and what really turned out to be useful.
P.P.S. And here is another good book The Clean Architecture in PHP . It seems to be not complicated, but it describes very well how IoC can be used, and this is a direct path to good tests.

ysaeredir, 2015-09-24

Matt Zandstra - Objects, Patterns, and Programming Techniques

OnYourLips, 2015-09-24

But I feel like my tests are shit. I am having difficulty with a number of things. For example, testing AR models
This is normal: AR is anti-OOP and has problems with testing by design.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question