-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathb8cfe518.13410300.js
More file actions
1 lines (1 loc) · 4.56 KB
/
b8cfe518.13410300.js
File metadata and controls
1 lines (1 loc) · 4.56 KB
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{162:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return o})),n.d(t,"rightToc",(function(){return l})),n.d(t,"default",(function(){return p}));var r=n(1),a=n(9),c=(n(0),n(176)),i={id:"doc_tdd",title:"Test Driven Development"},o={id:"practices/doc_tdd",title:"Test Driven Development",description:"## Summary",source:"@site/docs/practices/doc_tdd.md",permalink:"/docs/practices/doc_tdd",editUrl:"https://github.com/pfongkye/cheat-sheets-docs/edit/master/docs/practices/doc_tdd.md",sidebar:"someSidebar",previous:{title:"Interactive Learning",permalink:"/docs/doc_interactive_learning"},next:{title:"Clean Code",permalink:"/docs/practices/doc_clean_code"}},l=[{value:"Summary",id:"summary",children:[]}],u={rightToc:l};function p(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)("h2",{id:"summary"},"Summary"),Object(c.b)("p",null,"To review (Kent Beck's TDD By Example):"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"Red/Green/Refactor cycle"),Object(c.b)("li",{parentName:"ul"},"Test first (Red)"),Object(c.b)("li",{parentName:"ul"},"When implementing",Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},'"Dumb"/"Quick" implementation'),Object(c.b)("li",{parentName:"ul"},"Obvious implementation"),Object(c.b)("li",{parentName:"ul"},"Triangulation"))),Object(c.b)("li",{parentName:"ul"},"When test passes (Green)",Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"Remove duplication (Refactor)"))),Object(c.b)("li",{parentName:"ul"},"Todolist tasks"),Object(c.b)("li",{parentName:"ul"},"Small steps when not sure"),Object(c.b)("li",{parentName:"ul"},"Larger steps when confident or obvious"),Object(c.b)("li",{parentName:"ul"},"Tests should show intent"),Object(c.b)("li",{parentName:"ul"},"Refactor code and tests"),Object(c.b)("li",{parentName:"ul"},"Emergent design")),Object(c.b)("p",null,"TDD done right should help:"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"reduce debugging time"),Object(c.b)("li",{parentName:"ul"},"produce reliable documentation from written tests"),Object(c.b)("li",{parentName:"ul"},"improve code design (decoupling...)"),Object(c.b)("li",{parentName:"ul"},"refactor code confidently (suite tests acts as a parachute)")))}p.isMDXComponent=!0},176:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return d}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var u=a.a.createContext({}),p=function(e){var t=a.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):o({},t,{},e)),n},s=function(e){var t=p(e.components);return a.a.createElement(u.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},m=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),s=p(n),m=r,d=s["".concat(i,".").concat(m)]||s[m]||b[m]||c;return n?a.a.createElement(d,o({ref:t},u,{components:n})):a.a.createElement(d,o({ref:t},u))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,i=new Array(c);i[0]=m;var o={};for(var l in t)hasOwnProperty.call(t,l)&&(o[l]=t[l]);o.originalType=e,o.mdxType="string"==typeof e?e:r,i[1]=o;for(var u=2;u<c;u++)i[u]=n[u];return a.a.createElement.apply(null,i)}return a.a.createElement.apply(null,n)}m.displayName="MDXCreateElement"}}]);