<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="265774" data-post-id="265774">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tcoopman" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tcoopman/120/8112_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tcoopman
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Tests are also code that you need to maintain. Delete tests that don’t have any value anymore. Nothing wasteful about that.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="265774" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/private-a-lib-to-test-private-functions-in-2022/51118/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-265774" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="265774"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #31"></div>
  </section>
</div>
    <div class="postbit" id="265779" data-post-id="265779">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I agree with <a class="mention" href="/u/tcoopman" rel="nofollow">@tcoopman</a> here, some tests do eventually outlive their usefulness and should be deleted at one point.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="265779" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/private-a-lib-to-test-private-functions-in-2022/51118/33">Post #32</a>
	                </div>
	            </div>
              <div id="likers-container-265779" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="265779"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #32"></div>
  </section>
</div>
    <div class="postbit" id="265816" data-post-id="265816">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Another +1 for throwing away such tests.  I often treat TDD like REPL-driven development where instead of having to press up a bunch of times and then enter to re-run the test, I have it in a file and can just press one key-combo to run it.  But it doesn’t necessarily mean that I need to keep that around once things are working if it’s low value.  That said, I’ve definitely felt attached to those tests before (and it still happens).</p>
<p>I also find having mountains of unit tests to incredibly daunting and I have a feeling that that is what contributes to a lot of anti-testing sentiments.  I strive to only have tests that describe business value because I actually want to read them.  If you have lower-level unit tests that always pass and are covered elsewhere anyway, just throw them away.  As mentioned, there is a cost to all code that is kept around.</p>
<p>More on topic: I don’t really want to head-to-head with pragdave, but the module thing he is describing is similar to what I was describing.  Since I’m pro-dynamic programming, even if there are some semblance of types, I feel that some social contracts in code are OK—like, if there is a GenServer API available then obviously you should always use that, even if the impls are public!  That’s maybe an unpopular opinion, though.</p>
<p>And of course, to reiterate what has been said numerous times, there are no set rules.</p>
<aside class="quote no-group" data-username="pragdave" data-post="14" data-topic="51118">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/pragdave/48/1042_2.png" class="avatar"> pragdave:</div>
<blockquote>
<p>FWIW, my personal belief is that no one knows enough about software development to be able to make rules: it’s just too young a discipline.</p>
</blockquote>
</aside>
<p>I say this all the time and there’s no way any of us here will ever live to see the day where there would be set rules (if that’s even possible).  I always that I wonder how many hundreds of years people argued over whether a rock or a heavy stick made a better hammer before the modern hammer was standardized.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="265816" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/private-a-lib-to-test-private-functions-in-2022/51118/34">Post #33</a>
	                </div>
	            </div>
              <div id="likers-container-265816" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="265816"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #33"></div>
  </section>
</div>
    <div class="postbit" id="372599" data-post-id="372599">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="waseigo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/waseigo/120/34129_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  waseigo
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I don’t mean to “necrobump” this thread, but I just want to express how thankful I am to everyone who posted in this thread. It’s a gold mine of opinions and nuance.</p>
<p>I was recently faced with the dilemma of whether I should be testing private functions, and this thread was part of my exploration.</p>
<p>I wrote a blog post that summarizes my finding, though I don’t know if it’s 100% correct, or somewhat opinionated: <a href="https://forum.elixirforum.com/t/things-ive-realized-about-testing-elixir-code/72307" class="inline-onebox" rel="nofollow">Things I've realized about testing Elixir code</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="372599" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/private-a-lib-to-test-private-functions-in-2022/51118/35">Post #34</a>
	                </div>
	            </div>
              <div id="likers-container-372599" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="372599"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>