Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • 8
    I've read each of your questions, recently, and I've noticed a general misunderstanding of what constitutes a unit test, why people write unit tests, and how best to actually structure code to facilitate testing. It is difficult to answer this question, because there are so many misunderstandings. It almost sounds like "unit testing" has been pounded into your head by others without fully explaining why. Given the effort you've made to write thoughtful questions (despite this community's propensity to down-vote everything), you really seem to be struggling with this. Commented Mar 20, 2024 at 19:44
  • 2
    Can you edit the last paragraph of your question to focus on a single perspective of this? We have too many questions in one post to make this answerable. Commented Mar 20, 2024 at 19:48
  • @GregBurghardt Ugh... I'm thinking about it and I'm not sure how to tackle this. The last paragraph has 3 questions. The 3rd one is what I care about, but I need the 2nd one to state the 3rd one. In retrospect I should've probably asked two different questions: (1) does an architecture that follows SRP and prefers very tiny methods mean that classes and methods will be rearranged very often? and (2) in light of (1), are unit tests not fragile? I should probably cut this question to (1), but I can't because it already has two answers covering (2) Commented Mar 20, 2024 at 21:39
  • 2
    To be honest, the SRP and the number of lines in a class or method is completely irrelevant for unit testing. And remember those are guidelines for designing modules in your application. Use them when they make sense. Discard them with prejudice when they don't. Commented Mar 20, 2024 at 22:13
  • I think the questions in the last paragraph are related enough, to be honest. Commented Mar 20, 2024 at 22:19