Sunday, April 1, 2012

DRY Learning Plan

I would like to submit my learning plan for the Craft of Software Development course. This is something that I have been working on over the last two weeks.

Main Goal:
Ø  I would like to become accustomed to the “Do not Repeat Yourself” (DRY) principle of software development.

Sub-Goals and Their Learning Activities:
A.      Learn about the benefits of not repeating oneself with respect to software development.
                         1.      Research and read articles that speak positively and negatively about DRY principles.
                         2.      Determine whether not following DRY principles would be beneficial in some cases.
B.      Gain experience in distinguishing code that follows DRY principles from code that does not.
                         1.      Submit my previously written code to (a) Java programmer(s) for peer review.
                         2.      Discuss which areas of the code follow DRY principles and which do not.
                         3.      Discuss whether or not it was just to not follow DRY principles in each particular case.
                         4.      Use code-checking tools to determine whether I have been repeating myself.
                         5.      Compare code where I have not been repeating myself to code where I have.
                         6.      Compare the mindset that I was in when writing code in both of these cases.
C.      Learn how to convert code that does not follow DRY principles into code that does.
                         1.      Check my old projects for instances of failing to follow DRY principles.
                         2.      Convert the code to follow DRY principles.
                         3.      Find code that was meant to self a similar problem and see how it followed DRY.
                         4.      Find code that does not follow DRY principles and fix it to follow them.
                         5.      Use sources such as GitHub, Stack Overflow, and others in order to find such code.
                         6.      Use code-checking tools may be helpful in to find repeating code.
                         7.      Convert the repeating code to follow DRY principles.
                         8.      Ask Java experts or make a detailed post on Stack Overflow if I run into problems.
D.      Understand and get into the mindset of writing code that follows DRY principles from scratch.
                         1.      Engage in pair programming with a programmer who is familiar with Java.
                         2.      Discuss with my partner why employing DRY principles would be beneficial.
                         3.      Keep DRY principles in mind whenever writing code in the future.
                         4.      Record whenever I hit copy paste and what the purpose of it is.
                         5.      Record other applicable metrics and monitor my progress over time.
                         6.      Keep “DAMP not DRY” in mind when writing test cases.

Metrics for Tracking Progress:
1.       Number of instances of copy-pasted code per one hundred lines of code (hloc).
2.       Number of instances of repeated code found using code-checking tools per hloc.
3.       Number of instances of repeated code found by a peer per hloc compared to the tools.
4.       Level of self-awareness of copying code.
                           i.      Level I – I am unaware that I am copying code.
                          ii.      Level II – I am aware that I am copying code.
                         iii.      Level III – I am able to understand why copying code is problematic in a given case.
                         iv.      Level IV – I am to convert duplicate code to follow DRY principles.
                          v.      Level V – I am able to teach others how to refactor their code to follow DRY principles.

Applicable Apprenticeship Patterns:
1.       Finding a coach – I must find a mentor who is familiar with DRY principles who can guide me.
2.       Practice – I must consciously practice using DRY principles while coding.
3.       Exposing ignorance – I must realize my weaknesses with respect to not following DRY principles.
4.       Sharing while learning – I should keep track of my progress and discuss it with others.
5.       Kindred spirits – I should discuss potential solutions with individuals who have similar problems.
6.       Breakable toys – I should first practice outside of my real work prior to applying what I learned.

No comments:

Post a Comment