├── .gitignore ├── 00-the-past-efforts ├── 01-original-version-13-habits.png ├── 02-partially-refined-version-12-habits.png ├── 03-fully-refined-version-12-habits.png └── README.md ├── 01-outcome-of-discussions ├── README.md ├── group-1.jpg ├── group-2.jpg ├── group-3.jpg └── group-4.jpg ├── 02-outcome-of-collation └── tdd-manifesto │ ├── TDDManifesto.png │ ├── contributors.md │ └── tdd-good-habits-manifesto.md ├── 03-proposals └── pending-proposals-after-discussion.md ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### JetBrains template 3 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 4 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 5 | 6 | # User-specific stuff: 7 | .idea/workspace.xml 8 | .idea/tasks.xml 9 | .idea/dictionaries 10 | .idea/vcs.xml 11 | .idea/jsLibraryMappings.xml 12 | 13 | # Sensitive or high-churn files: 14 | .idea/dataSources.ids 15 | .idea/dataSources.xml 16 | .idea/dataSources.local.xml 17 | .idea/sqlDataSources.xml 18 | .idea/dynamic.xml 19 | .idea/uiDesigner.xml 20 | 21 | # Gradle: 22 | .idea/gradle.xml 23 | .idea/libraries 24 | 25 | # Mongo Explorer plugin: 26 | .idea/mongoSettings.xml 27 | 28 | ## File-based project format: 29 | *.iws 30 | 31 | ## Plugin-specific files: 32 | 33 | # IntelliJ 34 | /out/ 35 | 36 | # mpeltonen/sbt-idea plugin 37 | .idea_modules/ 38 | 39 | # JIRA plugin 40 | atlassian-ide-plugin.xml 41 | 42 | # Crashlytics plugin (for Android Studio and IntelliJ) 43 | com_crashlytics_export_strings.xml 44 | crashlytics.properties 45 | crashlytics-build.properties 46 | fabric.properties 47 | 48 | !.gitignore 49 | .idea/ 50 | -------------------------------------------------------------------------------- /00-the-past-efforts/01-original-version-13-habits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neomatrix369/refactoring-developer-habits/bf3290225131450737146b90b3299cf990c375dc/00-the-past-efforts/01-original-version-13-habits.png -------------------------------------------------------------------------------- /00-the-past-efforts/02-partially-refined-version-12-habits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neomatrix369/refactoring-developer-habits/bf3290225131450737146b90b3299cf990c375dc/00-the-past-efforts/02-partially-refined-version-12-habits.png -------------------------------------------------------------------------------- /00-the-past-efforts/03-fully-refined-version-12-habits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neomatrix369/refactoring-developer-habits/bf3290225131450737146b90b3299cf990c375dc/00-the-past-efforts/03-fully-refined-version-12-habits.png -------------------------------------------------------------------------------- /00-the-past-efforts/README.md: -------------------------------------------------------------------------------- 1 | ![Original version with 13 habits](./01-original-version-13-habits.png "Original version with 13 habits") 2 |
3 | ![Partially refined version with 12 habits](./02-partially-refined-version-12-habits.png "Partially refined version with 12 habits") 4 |
5 | ![Fully refined version with 12 habits](./03-fully-refined-version-12-habits.png "Fully refined version with 12 habits") 6 | -------------------------------------------------------------------------------- /01-outcome-of-discussions/README.md: -------------------------------------------------------------------------------- 1 | ![Group 1 outcome](group-1.jpg) 2 |
3 | ![Group 2 outcome](group-2.jpg) 4 |
5 | ![Group 3 outcome](group-3.jpg) 6 |
7 | ![Group 4 outcome](group-4.jpg) 8 | -------------------------------------------------------------------------------- /01-outcome-of-discussions/group-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neomatrix369/refactoring-developer-habits/bf3290225131450737146b90b3299cf990c375dc/01-outcome-of-discussions/group-1.jpg -------------------------------------------------------------------------------- /01-outcome-of-discussions/group-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neomatrix369/refactoring-developer-habits/bf3290225131450737146b90b3299cf990c375dc/01-outcome-of-discussions/group-2.jpg -------------------------------------------------------------------------------- /01-outcome-of-discussions/group-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neomatrix369/refactoring-developer-habits/bf3290225131450737146b90b3299cf990c375dc/01-outcome-of-discussions/group-3.jpg -------------------------------------------------------------------------------- /01-outcome-of-discussions/group-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neomatrix369/refactoring-developer-habits/bf3290225131450737146b90b3299cf990c375dc/01-outcome-of-discussions/group-4.jpg -------------------------------------------------------------------------------- /02-outcome-of-collation/tdd-manifesto/TDDManifesto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neomatrix369/refactoring-developer-habits/bf3290225131450737146b90b3299cf990c375dc/02-outcome-of-collation/tdd-manifesto/TDDManifesto.png -------------------------------------------------------------------------------- /02-outcome-of-collation/tdd-manifesto/contributors.md: -------------------------------------------------------------------------------- 1 | ## Contributors 2 | 3 | Big thank you to all those who contributed to the "Refactoring Developer Habits" session by Mani ([@theNeomatrix369](http://twitter.com/theNeomatrix369)) and Pedro ([@pedromsantos](http://twitter.com/pedromsantos)) at Socrates UK 2016. 4 | 5 | You all brain-stormed and helped shape the 12 habits into a fantastic looking manifesto. 6 | 7 | Here are a list of names (in no particular order): 8 | 9 | - Steve Lydford ([‏@stevelydford](http://twitter.com/@stevelydford)) 10 | - Rachel Davies ([‏@rachelcdavies](http://twitter.com/@rachelcdavies)) 11 | - Houssam Fakih ([‏@houssamfakih](http://twitter.com/‏@houssamfakih)) 12 | - Samir Talwar ([‏@samirtalwar](http://twitter.com/‏@samirtalwar)) 13 | - Alvaro Garcia ([‏@alvarobiz](http://twitter.com/‏@alvarobiz)) 14 | - Sergio Rodrigo ([@srodrigoDev](http://twitter.com/@srodrigoDev)) 15 | - Halima Koundi ([@hkoundi](http://twitter.com/@hkoundi)) 16 | - Ana Nogal ([@anainogal](https://twitter.com/@anainogal)) 17 | - Carlos Peña ([@crafty_coder](http://twitter.com/craft_coder)) 18 | - Michael Bateman ([@m_r_bateman](http://twitter.com/m_r_bateman)) 19 | - Catalina ([@cataflu](http://twitter.com/@cataflu)) 20 | - Alex Soler Sanandres ([@XelamRelos](http://twitter.com/@XelamRelos)) 21 | - Henrik Nyh ([@Henrik](http://twitter.com/@Henrik)) 22 | - Stephane 23 | - Joakim ([@joakimk](http://twitter.com/@joakimk)) 24 | - Johan Martinsson ([@johan_alps](http://twitter.com/@johan_alps)) 25 | - [Jason Peper](https://github.com/jasontrublu) ([@jason_peper](http://twitter.com/jason_peper)) 26 | - and many others who had a peek at it whilst it was being created. 27 | 28 | If you have been to the session and if its not on the list above, please contact us with your name and twitter handle. 29 | 30 | Please share with everyone, use #socratesuk, tweet at [@Socrates_UK](http://twitter.com/Socrates_UK). 31 | 32 | And thank you for those who liked, tweeted and retweeted about the session. 33 | -------------------------------------------------------------------------------- /02-outcome-of-collation/tdd-manifesto/tdd-good-habits-manifesto.md: -------------------------------------------------------------------------------- 1 | ## TDD good habits manifesto 2 | 3 | #### (principles) 4 | - tests should test one thing only 5 | - test one logical assertion 6 | - don't mix assertions of state and collaboration in the same test 7 | - modifications of production code should only break related test cases 8 | - each test should be self-contained, including data 9 | - ensure tests are independent of each other 10 | - don't refactor with a failing test 11 | - organise your unit test projects to reflect your production code 12 | - keep your tests and production code separate 13 | - do not use production data and code to test production code 14 | - if your tests are difficult to write or maintain, consider changing the design 15 | 16 | #### (red phase) 17 | - create more specific tests to drive a more generic solution (Triangulate) 18 | - give your tests meaningful names (behaviour / goal-oriented) that reflect your production system 19 | - write the assertion first and work backwards 20 | - see the test fail for the right reason 21 | - ensure you have meaningful feedback from failing tests 22 | - Organize your test in Arrange, Act and Assert blocks 23 | - Arrange (aka Given) – all necessary preconditions and inputs. 24 | - Act (aka When) – on the object or method under test. 25 | - Assert (aka Then) – that the expected results have occurred. 26 | 27 | #### (green phase) 28 | - write the simplest code to pass the test 29 | - write any code that makes you get to the refactor phase quicker 30 | - it is okay to write any code that you might improve at a later stage 31 | - consider using Transformation Priority Premises to evolve your code 32 | 33 | #### (refactor phase) 34 | - refactor aggressively and constantly 35 | - treat tests as first class code 36 | - use the IDE to refactor quickly and safely 37 | - refactor production and test code independently (except changing public interfaces) 38 | - Use the Rule of 3 to tackle duplication 39 | - Code can be copied once, but when the same code is used three times, it should be refactored/extracted 40 | - Remember that duplication is cheaper than the wrong abstractions 41 | 42 | 43 | ![MindMap](TDDManifesto.png) 44 |
45 | -------------------------------------------------------------------------------- /03-proposals/pending-proposals-after-discussion.md: -------------------------------------------------------------------------------- 1 | These are some of the invaluable suggestions from the outcome of the group discussion but fall a bit outside the TDD Red-Green-Refactor cycle. 2 | 3 | ### (preparation) 4 | 5 | - have a good understanding of the context of the change (who is this change for) 6 | - find out where the change needs to be made in the production code 7 | - which level are the tests written for (unit, integration, ATDD, Acceptance, et...) 8 | - add monitoring checks, if applicable 9 | - commit and push after each passing test 10 | 11 | ### Red 12 | - Organize your test in Arrange, Act and Assert blocks 13 | - Arrange (aka Given) – all necessary preconditions and inputs. 14 | - Act (aka When) – on the object or method under test. 15 | - Assert (aka Then) – that the expected results have occurred. 16 | - Structure the code in tests to reflect these concepts. 17 | 18 | 19 | ### Refactor 20 | - Use the Rule of 3 to tackle duplication 21 | - Remember that duplication is cheaper than the wrong abstractions 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | CC0 1.0 Universal 2 | 3 | Statement of Purpose 4 | 5 | The laws of most jurisdictions throughout the world automatically confer 6 | exclusive Copyright and Related Rights (defined below) upon the creator and 7 | subsequent owner(s) (each and all, an "owner") of an original work of 8 | authorship and/or a database (each, a "Work"). 9 | 10 | Certain owners wish to permanently relinquish those rights to a Work for the 11 | purpose of contributing to a commons of creative, cultural and scientific 12 | works ("Commons") that the public can reliably and without fear of later 13 | claims of infringement build upon, modify, incorporate in other works, reuse 14 | and redistribute as freely as possible in any form whatsoever and for any 15 | purposes, including without limitation commercial purposes. These owners may 16 | contribute to the Commons to promote the ideal of a free culture and the 17 | further production of creative, cultural and scientific works, or to gain 18 | reputation or greater distribution for their Work in part through the use and 19 | efforts of others. 20 | 21 | For these and/or other purposes and motivations, and without any expectation 22 | of additional consideration or compensation, the person associating CC0 with a 23 | Work (the "Affirmer"), to the extent that he or she is an owner of Copyright 24 | and Related Rights in the Work, voluntarily elects to apply CC0 to the Work 25 | and publicly distribute the Work under its terms, with knowledge of his or her 26 | Copyright and Related Rights in the Work and the meaning and intended legal 27 | effect of CC0 on those rights. 28 | 29 | 1. Copyright and Related Rights. A Work made available under CC0 may be 30 | protected by copyright and related or neighboring rights ("Copyright and 31 | Related Rights"). Copyright and Related Rights include, but are not limited 32 | to, the following: 33 | 34 | i. the right to reproduce, adapt, distribute, perform, display, communicate, 35 | and translate a Work; 36 | 37 | ii. moral rights retained by the original author(s) and/or performer(s); 38 | 39 | iii. publicity and privacy rights pertaining to a person's image or likeness 40 | depicted in a Work; 41 | 42 | iv. rights protecting against unfair competition in regards to a Work, 43 | subject to the limitations in paragraph 4(a), below; 44 | 45 | v. rights protecting the extraction, dissemination, use and reuse of data in 46 | a Work; 47 | 48 | vi. database rights (such as those arising under Directive 96/9/EC of the 49 | European Parliament and of the Council of 11 March 1996 on the legal 50 | protection of databases, and under any national implementation thereof, 51 | including any amended or successor version of such directive); and 52 | 53 | vii. other similar, equivalent or corresponding rights throughout the world 54 | based on applicable law or treaty, and any national implementations thereof. 55 | 56 | 2. Waiver. To the greatest extent permitted by, but not in contravention of, 57 | applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and 58 | unconditionally waives, abandons, and surrenders all of Affirmer's Copyright 59 | and Related Rights and associated claims and causes of action, whether now 60 | known or unknown (including existing as well as future claims and causes of 61 | action), in the Work (i) in all territories worldwide, (ii) for the maximum 62 | duration provided by applicable law or treaty (including future time 63 | extensions), (iii) in any current or future medium and for any number of 64 | copies, and (iv) for any purpose whatsoever, including without limitation 65 | commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes 66 | the Waiver for the benefit of each member of the public at large and to the 67 | detriment of Affirmer's heirs and successors, fully intending that such Waiver 68 | shall not be subject to revocation, rescission, cancellation, termination, or 69 | any other legal or equitable action to disrupt the quiet enjoyment of the Work 70 | by the public as contemplated by Affirmer's express Statement of Purpose. 71 | 72 | 3. Public License Fallback. Should any part of the Waiver for any reason be 73 | judged legally invalid or ineffective under applicable law, then the Waiver 74 | shall be preserved to the maximum extent permitted taking into account 75 | Affirmer's express Statement of Purpose. In addition, to the extent the Waiver 76 | is so judged Affirmer hereby grants to each affected person a royalty-free, 77 | non transferable, non sublicensable, non exclusive, irrevocable and 78 | unconditional license to exercise Affirmer's Copyright and Related Rights in 79 | the Work (i) in all territories worldwide, (ii) for the maximum duration 80 | provided by applicable law or treaty (including future time extensions), (iii) 81 | in any current or future medium and for any number of copies, and (iv) for any 82 | purpose whatsoever, including without limitation commercial, advertising or 83 | promotional purposes (the "License"). The License shall be deemed effective as 84 | of the date CC0 was applied by Affirmer to the Work. Should any part of the 85 | License for any reason be judged legally invalid or ineffective under 86 | applicable law, such partial invalidity or ineffectiveness shall not 87 | invalidate the remainder of the License, and in such case Affirmer hereby 88 | affirms that he or she will not (i) exercise any of his or her remaining 89 | Copyright and Related Rights in the Work or (ii) assert any associated claims 90 | and causes of action with respect to the Work, in either case contrary to 91 | Affirmer's express Statement of Purpose. 92 | 93 | 4. Limitations and Disclaimers. 94 | 95 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 96 | surrendered, licensed or otherwise affected by this document. 97 | 98 | b. Affirmer offers the Work as-is and makes no representations or warranties 99 | of any kind concerning the Work, express, implied, statutory or otherwise, 100 | including without limitation warranties of title, merchantability, fitness 101 | for a particular purpose, non infringement, or the absence of latent or 102 | other defects, accuracy, or the present or absence of errors, whether or not 103 | discoverable, all to the greatest extent permissible under applicable law. 104 | 105 | c. Affirmer disclaims responsibility for clearing rights of other persons 106 | that may apply to the Work or any use thereof, including without limitation 107 | any person's Copyright and Related Rights in the Work. Further, Affirmer 108 | disclaims responsibility for obtaining any necessary consents, permissions 109 | or other rights required for any use of the Work. 110 | 111 | d. Affirmer understands and acknowledges that Creative Commons is not a 112 | party to this document and has no duty or obligation with respect to this 113 | CC0 or use of the Work. 114 | 115 | For more information, please see 116 | 117 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Refactoring developer habits 2 | 3 | Presented at the [LSCC Talks - June 2016](http://www.meetup.com/london-software-craftsmanship/events/231798303/), see [Refactoring developer habits slides](http://www.slideshare.net/neomatrix369/refactoring-developer-habits-62785350) and [recording](https://skillsmatter.com/skillscasts/8388-refactoring-developer-habits). 4 | 5 | See how the original list of habits got shaped into, at [TDD Good Habits manifesto](02-outcome-of-collation/tdd-manifesto/tdd-good-habits-manifesto.md) and who the [Contributors](02-outcome-of-collation/tdd-manifesto/contributors.md) behind it were. 6 | 7 | Feel free to contribute to it, create a pull request with your views. 8 | 9 | Make proposals, share ideas and discuss with the community on the **#tdd** channel on the [International Software Craftsmanship slack organisation](http://slack.softwarecraftsmanship.org/). --------------------------------------------------------------------------------