<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>List - Tag - My Notes</title><link>https://blog.emecas.net/tags/list/</link><description>List - Tag - My Notes</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sun, 06 Sep 2020 19:42:06 +0000</lastBuildDate><atom:link href="https://blog.emecas.net/tags/list/" rel="self" type="application/rss+xml"/><item><title>DopplerHQ/awesome-interview-questions</title><link>https://blog.emecas.net/posts/2020-09-06-dopplerhq-awesome-interview-questions/</link><pubDate>Sun, 06 Sep 2020 19:42:06 +0000</pubDate><author>emecas</author><guid>https://blog.emecas.net/posts/2020-09-06-dopplerhq-awesome-interview-questions/</guid><description><![CDATA[<p>DopplerHQ/awesome-interview-questions<br>
:octocat: A curated awesome list of lists of interview questions. Feel free to contribute! :mortar_board:<br>
Repository by DopplerHQ, created in 2015, with 85,500 stars and 9,609 forks. Archived by its owner. Starred on 2020-09-06.<br>
Homepage: <a href="https://doppler.com" target="_blank" rel="noopener noreffer ">https://doppler.com</a><br>
<a href="https://github.com/DopplerHQ/awesome-interview-questions" target="_blank" rel="noopener noreffer ">https://github.com/DopplerHQ/awesome-interview-questions</a></p>
<hr>
<p><em>Source: starred on GitHub on 2020-09-06: <a href="https://github.com/DopplerHQ/awesome-interview-questions" target="_blank" rel="noopener noreffer ">DopplerHQ/awesome-interview-questions</a>.</em></p>]]></description></item><item><title>7 Popular Unit Test Naming Conventions</title><link>https://blog.emecas.net/posts/2020-04-29-7-popular-unit-test-naming-conventions/</link><pubDate>Wed, 29 Apr 2020 18:54:24 -0400</pubDate><author>emecas</author><guid>https://blog.emecas.net/posts/2020-04-29-7-popular-unit-test-naming-conventions/</guid><description><![CDATA[<p>7 Popular Unit Test Naming Conventions<br>
<a href="https://dzone.com/articles/7-popular-unit-test-naming" target="_blank" rel="noopener noreffer ">https://dzone.com/articles/7-popular-unit-test-naming</a></p>
<p>1. MethodName_StateUnderTest_ExpectedBehavior: There are arguments against this strategy that if method names change as part of code refactoring 	than test name like this should also change or it becomes difficult to comprehend at a later stage. Following are some of the example:<br>
isAdult_AgeLessThan18_False<br>
withdrawMoney_InvalidAccount_ExceptionThrown<br>
admitStudent_MissingMandatoryFields_FailToAdmit<br>
2. MethodName_ExpectedBehavior_StateUnderTest: Slightly tweeked from above, but a section of developers also recommend using this naming technique. This technique also has disadvantage that if method names get changed, it becomes difficult to comprehend at a later stage. Following is how tests in first example would read like if named using this technique:<br>
isAdult_False_AgeLessThan18<br>
withdrawMoney_ThrowsException_IfAccountIsInvalid<br>
admitStudent_FailToAdmit_IfMandatoryFieldsAreMissing<br>
3. test[Feature being tested]: This one makes it easy to read the test as the feature to be tested is written as part of test name. Although, there are arguments that the “test” prefix is redundant. However, some sections of developer love to use this technique. Following is how the above tests would read like if named using this technique:<br>
testIsNotAnAdultIfAgeLessThan18<br>
testFailToWithdrawMoneyIfAccountIsInvalid<br>
testStudentIsNotAdmittedIfMandatoryFieldsAreMissing<br>
4. Feature to be tested: Many suggests that it is better to simply write the feature to be tested because one is anyway using annotations to identify method as test methods. It is also recommended for the reason that it makes unit tests as alternate form of documentation and avoid code smells. Following is how tests in first example would read like if named using this technique:<br>
IsNotAnAdultIfAgeLessThan18<br>
FailToWithdrawMoneyIfAccountIsInvalid<br>
StudentIsNotAdmittedIfMandatoryFieldsAreMissing<br>
5. Should_ExpectedBehavior_When_StateUnderTest: This technique is also used by many as it makes it easy to read the tests. Following is how tests in first example would read like if named using this technique:<br>
Should_ThrowException_When_AgeLessThan18<br>
Should_FailToWithdrawMoney_ForInvalidAccount<br>
Should_FailToAdmit_IfMandatoryFieldsAreMissing<br>
6. When_StateUnderTest_Expect_ExpectedBehavior: Following is how tests in first example would read like if named using this technique:<br>
When_AgeLessThan18_Expect_isAdultAsFalse<br>
When_InvalidAccount_Expect_WithdrawMoneyToFail<br>
When_MandatoryFieldsAreMissing_Expect_StudentAdmissionToFail<br>
7. Given_Preconditions_When_StateUnderTest_Then_ExpectedBehavior: This approach is based on naming convention developed as part of Behavior-Driven Development (BDD). The idea is to break down the tests into three part such that one could come up with preconditions, state under test and expected behavior to be written in above format. Following is how tests in first example would read like if named using this technique:<br>
Given_UserIsAuthenticated_When_InvalidAccountNumberIsUsedToWithdrawMoney_Then_TransactionsWillFail</p>]]></description></item><item><title>Tasks</title><link>https://blog.emecas.net/posts/2020-02-28-tasks/</link><pubDate>Fri, 28 Feb 2020 20:00:52 -0500</pubDate><author>emecas</author><guid>https://blog.emecas.net/posts/2020-02-28-tasks/</guid><description><![CDATA[<p>Tasks<br>
<a href="https://tasks.org/" target="_blank" rel="noopener noreffer ">https://tasks.org/</a><br>
Astrid To-Do List Clone<br>
Bringing Astrid Tasks back from the dead <a href="http://tasks.org" target="_blank" rel="noopener noreffer ">http://tasks.org</a><br>
github <a href="https://github.com/tasks/tasks" target="_blank" rel="noopener noreffer ">https://github.com/tasks/tasks</a> <a class="star-note-link" href="/posts/2020-03-02-tasks-tasks/" title="tasks/tasks: my star note">★&nbsp;star&nbsp;note</a></p>
<hr>
<p><em>Source: commit <a href="https://github.com/emecas/My-Notes/commit/c99e4accd82a8505e18d28cd43ac162c71bcad4f" target="_blank" rel="noopener noreffer "><code>c99e4ac</code></a> in My-Notes.</em></p>]]></description></item><item><title>trimstray/the-book-of-secret-knowledge</title><link>https://blog.emecas.net/posts/2020-02-09-trimstray-the-book-of-secret-knowledge/</link><pubDate>Sun, 09 Feb 2020 03:25:09 +0000</pubDate><author>emecas</author><guid>https://blog.emecas.net/posts/2020-02-09-trimstray-the-book-of-secret-knowledge/</guid><description><![CDATA[<p>trimstray/the-book-of-secret-knowledge<br>
A collection of inspiring lists, manuals, cheatsheets, blogs, hacks, one-liners, cli/web tools and more.<br>
Repository by trimstray, created in 2018, with 257,490 stars and 14,843 forks. License: MIT. Starred on 2020-02-09.<br>
<a href="https://github.com/trimstray/the-book-of-secret-knowledge" target="_blank" rel="noopener noreffer ">https://github.com/trimstray/the-book-of-secret-knowledge</a></p>
<hr>
<p><em>Source: starred on GitHub on 2020-02-09: <a href="https://github.com/trimstray/the-book-of-secret-knowledge" target="_blank" rel="noopener noreffer ">trimstray/the-book-of-secret-knowledge</a>.</em></p>]]></description></item><item><title>Python Removing from List</title><link>https://blog.emecas.net/posts/2013-05-23-python-removing-from-list/</link><pubDate>Thu, 23 May 2013 16:13:53 +0200</pubDate><author>emecas</author><guid>https://blog.emecas.net/posts/2013-05-23-python-removing-from-list/</guid><description><![CDATA[<p>Python Remove from List<br>
Never Remove anything from a List that you are iterating on instead mark it and remove later</p>
<p># define event handler for mouse click, draw<br>
def click(pos):<br>
remove = []<br>
for ball in ball_list:<br>
if distance(ball, pos) &lt; ball_radius:<br>
remove.append(ball)</p>
<p>if remove == []:<br>
ball_list.append(pos)<br>
else:<br>
for ball in remove:<br>
ball_list.pop(ball_list.index(ball))</p>
<hr>
<p><em>Source: commit <a href="https://github.com/emecas/My-Notes/commit/36dedb575ac68fb78fefc86e6d098a47e372f12a" target="_blank" rel="noopener noreffer "><code>36dedb5</code></a> in My-Notes.</em></p>]]></description></item></channel></rss>