{"id":5003298,"date":"2015-12-16T23:43:51","date_gmt":"2015-12-17T07:43:51","guid":{"rendered":"https:\/\/aadev22.local\/?post_type=aa_glossary&#038;p=5003298"},"modified":"2022-08-30T11:28:35","modified_gmt":"2022-08-30T18:28:35","slug":"rules-of-simplicity","status":"publish","type":"aa_glossary","link":"https:\/\/agilealliance.org\/glossary\/rules-of-simplicity\/","title":{"rendered":"Rules of Simplicity"},"content":{"rendered":"<div>\n<div>\n<p>A set of criteria, in priority order, proposed by Kent Beck to judge whether some source code is \u201csimple enough\u201d:<\/p>\n<ul>\n<li>the code is verified by automated\u00a0<a href=\"http:\/\/guide.agilealliance.org\/guide\/unittest.html\">tests<\/a>, and all such tests pass<\/li>\n<li>the code contains no\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Duplicate_code\">duplication<\/a><\/li>\n<li>the code expresses separately each distinct idea or responsibility<\/li>\n<li>the code is composed of the minimum number of components (classes, methods, lines) compatible with the first three criteria<\/li>\n<\/ul>\n<h2>Common Pitfalls<\/h2>\n<p>The first criterion is easy to judge but implies something far from trivial: namely that the source code in question is \u201ccorrect\u201d, or has no defects. Unit tests are at best suggestive evidence that a program has no defects and certainly no definite proof. Pragmatically, however, Agile discourse considers them an excellent first line of defense.<\/p>\n<p>The next two criteria leave more room for subjective judgment. For instance, code duplication can be taken literally, as character-for-character duplication. Since unfortunately \u201ccopy-paste programming\u201d remains common industry practice, this is a frequent occurrence, which can be alleviated through diligent refactoring. However, competent programmers also recognize more subtle forms of duplication.<\/p>\n<p>Similarly, many distinct attempts at formalizing the third criterion exist, none of them regarded as definitive. Examples include \u201clow\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Coupling_(computer_programming%29\">coupling<\/a>\u00a0and high\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Cohesion_(computer_science%29\">cohesion<\/a>\u201d and the\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/SOLID_(object-oriented_design%29\">SOLID<\/a>\u00a0design principles.<\/p>\n<h2>Origins<\/h2>\n<ul>\n<li>1999: the \u201crules of\u00a0<a href=\"https:\/\/agilealliance.org\/glossary\/simple-design\/\">simple design<\/a>\u201d are described for the first time in an IEEE Computer article by Kent Beck,\u00a0<a href=\"http:\/\/capstone.cs.ucsb.edu\/2012\/cs189a\/papers\/x-prog.pdf\">\u201cEmbracing Change with Extreme Programming\u201d<\/a>, summarizing earlier\u00a0<a href=\"http:\/\/www.ibm.com\/developerworks\/rational\/archives\/otug\/hypermail\/9903\/0646.html\">discussions<\/a>\u00a0on the OTUG mailing list<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div>\n<div><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Rules of Simplicity is a set of criteria, in priority order, proposed by Kent Beck to judge whether some source code is &#8220;simple enough.&#8221;<\/p>\n","protected":false},"author":8027401,"featured_media":8067461,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","categories":[906],"tags":[825],"class_list":["post-5003298","aa_glossary","type-aa_glossary","status-publish","has-post-thumbnail","hentry","category-technology","tag-simple-design"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/aa_glossary\/5003298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/aa_glossary"}],"about":[{"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/types\/aa_glossary"}],"author":[{"embeddable":true,"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/users\/8027401"}],"replies":[{"embeddable":true,"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/comments?post=5003298"}],"version-history":[{"count":0,"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/aa_glossary\/5003298\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/media\/8067461"}],"wp:attachment":[{"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/media?parent=5003298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/categories?post=5003298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agilealliance.org\/wp-json\/wp\/v2\/tags?post=5003298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}